Gemma 4 E2B for Fluent Books (A2, Q4_K_M GGUF, with the context of the novel)
A LoRA fine-tune of google/gemma-4-E2B-it with its vocabulary cut from 262,144 to 40,000 tokens, merged and quantised (Q4_K_M, the per-layer embedding table at Q3_K, with an importance matrix), for the on-device assistant of the Fluent Books reading app (an English reader for Russian speakers). It runs on llama.cpp; the app downloads this single file. It needs a device with 8 GB of memory or more (about 520 MB while it works).
- File:
gemma-4-e2b-ft-a2.Q4_K_M.gguf, 1,350,381,280 bytes, SHA-256544a763285f7ad0b2ceacd76fb54f89cc580aa05362749a6bf346cefe21c31f2. - Licence: Apache License 2.0, as the base model (see
LICENSE). Copyright of the base model: Google. - Prompt format: Gemma 4 turns without a thinking block (
<bos><|turn>system … <turn|>\n<|turn>user … <turn|>\n<|turn>model\n), exactly as the app sends it. The model is trained on the app's own prompts: English→Russian sentence translation, choosing the dictionary meaning of a word in its sentence (JSON{"ru": "...", "sense": N}), a short Russian explanation of a word or of a grammar point, the subject and main verb of a long sentence, and a yes/no check ("0"/"1") whether an English expression is used in a sentence. - Context: a translation prompt may carry a block above the sentence,
Context (earlier in the novel; do not translate):+ the one or two sentences before it +Sentence to translate:. The model uses it for what one sentence cannot say (the sex of an "I" speaker or of the person addressed as "you", the grammatical gender of what "it" is). Without the block it translates the sentence alone.
Training
Vocabulary: the 40,000 most useful tokens were kept (by frequency over the training set, Project Gutenberg text, and English and Russian Wikipedia); the tokenisation of every kept token is exact. LoRA (rank 32, alpha 64, the attention and MLP projections of every layer), 2 epochs (6,306 steps), learning rate 1e-4, batch 16, loss on the answer only, bf16, one H200 (about 1.6 hours). 50,444 training examples:
| part | examples | where the answers come from |
|---|---|---|
| ordinary sentences (EN→RU) | 13,752 | sentences from public-domain novels (Project Gutenberg); translations written by Claude Sonnet 5.5 agents |
| hard cases: gender, «you» to several people, names that are words | 1,974 / 1,644 / 3,466 | the same |
| expressions, real and false | 7,352 / 1,982 | the same, with a hint to the translating agent; whether the words are the expression: two Claude agents agree |
| translation traps by kind: passive, modal perfect, inversion, cleft, participle clause, gerund subject, idioms, false friends | 2,160 | the same, with a hint per kind |
| aligned sentence pairs of public-domain human translations | 6,292 | Twain/Engelhardt (d. 1915), Swift/Frankovsky (d. 1942), Wells/Pimenova (d. 1935) and Wells/Morozov (d. 1946), Haggard/Bekertova-Krasnova (d. 1892), London/Vershinina (d. 1942); texts from ru.wikisource.org and the owner's copies of the Engelhardt translations, English from Project Gutenberg, aligned with LaBSE, kept at confidence 0.70 or more |
| dictionary-meaning choice | 7,851 | answers on which Gemma 4 26B-A4B and 31B (Apache-2.0) agree with a probability of 0.9 or more |
| word explanation, grammar-point explanation, sentence skeleton | 962 / 728 / 590 | Claude Sonnet 5.5 agents |
| expression check (0/1) | 1,183 | the digit on which Gemma 4 26B-A4B and 31B agree |
| of these, translation prompts that carry the two sentences before (75 % of the human pairs, 25 % of the other translation groups) | 9,793 | the same answers; the context is the text of the novel |
| synthetic contrast pairs: the same sentence, two contexts, two Russian translations that differ in gender (speaker, addressee, antecedent of "it") | 550 | written by Claude Sonnet 5.5 agents (own text, no book is quoted) |
No source sentence comes from a textbook or from the evaluation sets (checked by exact match and by 8-word overlap), and no synthetic sentence is, or is close to, an evaluation sentence. «The Picture of Dorian Gray», the held-out books of the expression test set and the sentences of every gold set are excluded.
Evaluation (blind judges, our own sets; 3 Nov 2026, the file as the app runs it)
Strict count: a translation is right only when both of two blind judges (language models) say so.
| this model | Apple Translation | Qwen3.5-2B v3 (earlier model of the app; other session) | |
|---|---|---|---|
| 120 trap sentences (gender, «you», names, passive, idioms …), of 120 | 115 | 112 | 103 |
| 223 extended traps, of 223 | 185 | 149 | 166 |
| expression translation, of 100 | 87 | 76 | 78 |
| dictionary-meaning choice, of 462 | 386 | – | 377 |
| pairwise with Apple on 138 sentences (model : Apple : equal), both judges agree | 73 : 20 : 45 | – | 46 : 46 : 46 |
| names that are words, «you» to several, gender (of 40 each) | 35 / 40 / 40 | 33 / 40 / 39 | 28 / 39 / 36 |
Context (60 pairs: one target sentence, two contexts that decide the Russian form, 20 pairs each for the sex of an "I" speaker, the sex of the person addressed, the gender of "it"): with the context block the model gets 39 pairs right on both contexts (19 / 11 / 9); without it 0 (it cannot be right on both). The base Gemma 4 E2B gets 32 with the block, the earlier Fluent Books fine-tune (no context in its training) 17. The set is synthetic and small; "it" is the weakest kind (some sentences are naturally impersonal in Russian).
General text (WMT24++ English→Russian, 960 segments, professional post-edits; not the domain of the model): chrF++ 41.2 (base Gemma 4 E2B 43.2), COMET (wmt22-comet-da) 0.799 (base 0.805): a little below the base model, in the style of our own translations rather than in meaning. "Has not forgotten the other tasks": judges prefer this model's word and grammar explanations to the base model's (34 : 7 and 36 : 3); the sentence skeleton is found in 7 of the 8 sentences it answers.
Known limitations
- Only English→Russian novel sentences were evaluated; not for other languages, long documents or safety-critical use. The evaluation sets and judges are our own; the judges are language models, and between two sessions a count moves by 4–7 sentences of 120: do not read small differences as a change.
- It is a little weaker than the base model on general (non-novel) text, see WMT24++ above.
- The 0/1 expression check separates right from wrong uses better than the base model (balanced accuracy 0.77–0.79 between thresholds 0.7 and 0.9, AUC 0.86; the base 0.62 at the usual 0.15, AUC 0.75), but its probability of "1" is shifted upwards: use a threshold of about 0.80, not 0.15.
- The synthetic contrast pairs and the human translations are in the style of 19th-century novels.