LFM3-1.7B-JA-Leakfix
A tiny weight edit of LiquidAI/LFM3-1.7B that makes it less likely to slip Chinese or Korean characters into Japanese answers.
No training was involved. The edit touches 8 columns of a single matrix, model.layers.23.feed_forward.w2.weight, which is 16,329 weights or about 0.001% of the model. Everything else is byte-for-byte the base model, including the tokenizer, chat template and reasoning behaviour.
Files
| File | Format |
|---|---|
model.safetensors and config files | Transformers (bf16) |
LFM3-1.7B-JA-Leakfix-Q8_0.gguf | llama.cpp, Q8_0 |
LFM3-1.7B-JA-Leakfix-Q4_K_M.gguf | llama.cpp, Q4_K_M |
Use it exactly like the base model. It needs a Transformers or llama.cpp version that supports LFM3.
What was changed
The last layer has a few MLP channels that fire mainly when the reply should be Japanese. The edit:
- Takes the mean residual-stream activation after layer 22 for Japanese prompts, minus the mean for Chinese and Korean prompts, and scales it by the
post_ffn_normweights. - Adds that direction to the
w2columns of 8 channels (4427, 3963, 4931, 4069, 2293, 2264, 2408, 3886), scaled to each column's norm.
This nudges the output toward Japanese at the points where the base model sometimes switches script. It does not remove the root cause. In the GGUF files only blk.23.ffn_down differs from the base model's conversion.
Evaluation
The evaluation was a set of Japanese agentic tasks: file and office-document work with tool calling and reasoning on. There were 49 tasks with 4 runs each, 196 runs per model. A run counts as a "leak" if Chinese or Korean text appears in the answer, a tool argument or a written file.
| Q8_0 | Base | This model |
|---|---|---|
| Tasks passed | 159 / 196 | 165 / 196 |
| Runs with a leak | 10 / 196 | 2 / 196 (one-sided Fisher p ≈ 0.02) |
| Median generated tokens per run | 2,182 | 2,858 |
| Q4_K_M, same GPU, run side by side | Base | This model |
|---|---|---|
| Tasks passed | 147 / 196 | 148 / 196 |
| Runs with a leak | 3 / 196 | 2 / 196 (not significant) |
- Task success did not drop, and reasoning length was not reduced.
- The effect is clearest at Q8_0. The base Q4_K_M leaked rarely in this test, so no difference could be measured there.
- In everyday use the difference is small. Leaks were already uncommon in the base model.
Limitations
- The edit was tested only on Japanese. Its effect on other languages has not been measured, and they may get slightly worse.
- Some leaks remain, for example Chinese written only in characters that are also valid Japanese kanji (
新的フォルダー).
License
This model is a derivative of LFM3-1.7B and is distributed under the LFM Open License v1.0.
Notice of modification: model.safetensors and the GGUF files differ from the original only in model.layers.23.feed_forward.w2.weight, as described above. All other files are unchanged from the base model.
日本語
LiquidAI/LFM3-1.7B の重みを少しだけ書き換え、日本語の回答に中国語や韓国語の字が混ざりにくくしたモデルです。
学習はしていません。変えたのは最後の層の MLP の出力行列 model.layers.23.feed_forward.w2.weight の 8 列(16,329 個の重み、モデル全体の約 0.001%)だけです。トークナイザー、チャットテンプレート、推論のしかたは元のモデルと同じです。
- 評価: 日本語のエージェント課題(ツールを使うファイル・文書の作業、推論あり)196 回で測りました。
- Q8_0: 中国語や韓国語が混ざった実行が 10 回から 2 回に減りました。合格は 159 から 165 で、下がっていません。
- Q4_K_M: 元のモデルでも混ざった実行が 3 回と少なく、差は測れませんでした(合格は 147 から 148)。
- 普段の使い心地: 元のモデルでも混ざることはまれなので、違いは小さめです。
- 日本語以外: 日本語と英語以外の言語での影響は測っていません。
- ライセンス: LFM Open License v1.0 です。