Rahspide commited on
Commit
b63bfc8
·
verified ·
1 Parent(s): b3c7a16

docs: model card (work in progress)

Browse files
Files changed (1) hide show
  1. README.md +142 -0
README.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ru
4
+ - en
5
+ - zh
6
+ license: apache-2.0
7
+ base_model: taobao-mnn/MNN-Pocket-0.3B-Base
8
+ library_name: transformers
9
+ pipeline_tag: text-generation
10
+ datasets:
11
+ - HuggingFaceFW/fineweb-2
12
+ - HuggingFaceFW/fineweb
13
+ tags:
14
+ - russian
15
+ - on-device
16
+ - edge
17
+ - mnn
18
+ - qwen3
19
+ - gguf
20
+ - keyboard
21
+ - work-in-progress
22
+ ---
23
+
24
+ # MNN-Pocket-0.3B-RU (work in progress)
25
+
26
+ > **Status: still training.** No weights in this repository yet. This card documents the recipe and the
27
+ > measurements taken so far; checkpoints live in the private repo `Rahspide/mnn-pocket-ru-run`
28
+ > (`ckpt/state.pt`). Sections marked *(pending)* will be filled when training finishes.
29
+
30
+ A continued-pretraining run of [`taobao-mnn/MNN-Pocket-0.3B-Base`](https://huggingface.co/taobao-mnn/MNN-Pocket-0.3B-Base)
31
+ on Russian, aimed at on-device next-word and short-phrase suggestions for an Android keyboard.
32
+
33
+ The goal is not instruction following. The model is trained as a plain causal LM on raw Russian text, so it
34
+ continues a typed prefix instead of answering it. English and Chinese are kept alive with a 25% replay mix.
35
+
36
+ | | |
37
+ |---|---|
38
+ | Base | `taobao-mnn/MNN-Pocket-0.3B-Base` (Qwen3 architecture, 303M non-embedding / 361M total params) |
39
+ | Tokenizer | 65,536 tokens, byte-level BPE, `<|endoftext|>` = 65510 |
40
+ | Training tokens | 1.2B (0.9B ru + 0.204B en + 0.096B zh) |
41
+ | Method | full fine-tune, 1 epoch, no LoRA |
42
+ | Hardware | single Colab T4 16 GB, 4.8k tok/s, ~69 h total |
43
+ | Progress (2026-11-09) | step ~1,100 / 36,621, ~36M tokens |
44
+
45
+ ## Why the recipe looks like this: Russian is expensive in this tokenizer
46
+
47
+ The base tokenizer is a distilled 65k vocabulary with almost no Cyrillic merges. Russian comes out
48
+ close to character level — `Спасибо` becomes 6 tokens:
49
+
50
+ ```
51
+ "Спасибо" -> ['С', 'п', 'аÑģ', 'и', 'б', 'о']
52
+ ```
53
+
54
+ Measured on prose samples with the real tokenizer:
55
+
56
+ | Tokenizer | RU chars/token | RU tokens per word | EN chars/token |
57
+ |---|---|---|---|
58
+ | MNN-Pocket / Qwen3-distilled (65,536) | **1.75–1.85** | **≈3.3** | 3.78 |
59
+ | ruGPT3-small (50k, Russian BPE) | 4.2 | ≈1.3 | — |
60
+
61
+ Consequences that shaped the plan:
62
+
63
+ - the same 1.2B-token budget buys ~2.2B Russian characters (~340M words), roughly 2.2× less text than
64
+ a Russian-native tokenizer would fit;
65
+ - on a phone, one suggested Russian word costs ~3 decode steps instead of ~1, which matters for a
66
+ keyboard latency budget;
67
+ - vocabulary surgery (adding a few thousand Cyrillic merges plus an embedding resize) is a separate
68
+ experiment, not part of v1. v1 stays tokenizer-compatible with the base model so it drops into the
69
+ existing MNN / GGUF toolchain.
70
+
71
+ ## Training recipe
72
+
73
+ - Full fine-tune from `MNN-Pocket-0.3B-Base`, fp32 master weights with fp16 autocast (T4 has no usable bf16).
74
+ - Sequence length 1024, random windows over a packed `uint16` token stream, `<|endoftext|>` between documents.
75
+ - 32,768 tokens per optimizer step (micro-batch 4 × 1024, gradient accumulation 8).
76
+ - AdamW, β = (0.9, 0.95), weight decay 0.1, gradient clip 1.0, lr 2e-4 with 1% linear warmup and cosine decay.
77
+ - One epoch over 1.2B tokens = 36,621 steps.
78
+ - Checkpoint every 500 steps, uploaded to a private HF repo; training auto-resumes from the last checkpoint
79
+ after a session restart.
80
+
81
+ ## Data
82
+
83
+ All sources are public Hugging Face datasets. `*` marks the validation split: the first 100k tokens of each
84
+ stream are held out before training starts, so validation text is never seen.
85
+
86
+ | Language | Dataset | Config | Tokens | Share |
87
+ |---|---|---|---|---|
88
+ | ru | [`HuggingFaceFW/fineweb-2`](https://huggingface.co/datasets/HuggingFaceFW/fineweb-2) | `rus_Cyrl` | 0.90B (100k held out*) | 75% |
89
+ | en | [`HuggingFaceFW/fineweb`](https://huggingface.co/datasets/HuggingFaceFW/fineweb) | `sample-100BT` | 0.204B (100k held out*) | 17% |
90
+ | zh | [`HuggingFaceFW/fineweb-2`](https://huggingface.co/datasets/HuggingFaceFW/fineweb-2) | `cmn_Hani` | 0.096B (100k held out*) | 8% |
91
+
92
+ Licences: FineWeb / FineWeb-2 are ODC-BY 1.0. No scraped Telegram dumps or other unlicensed chat corpora
93
+ were used, so the resulting weights stay publishable.
94
+
95
+ ## Evaluation
96
+
97
+ Per language: perplexity, **bits per character**, and top-1 / top-5 next-token accuracy. Bits/char is the
98
+ metric that stays comparable across tokenizers, which perplexity is not.
99
+
100
+ Baseline, the untouched base model (measured 2026-11-09, 100k held-out tokens per language):
101
+
102
+ | Lang | ppl | bits/char | top-1 | top-5 | chars/token |
103
+ |---|---|---|---|---|---|
104
+ | ru | 10.42 | 1.625 | 46.2% | 69.3% | 2.08 |
105
+ | en | 21.85 | 1.016 | 39.9% | 64.1% | 4.40 |
106
+ | zh | 23.95 | 3.274 | 41.9% | 62.0% | 1.42 |
107
+
108
+ Fine-tuned numbers: *(pending)*. The acceptance gate is a clear drop in Russian bits/char with at most a
109
+ ~10% regression on English and Chinese bits/char.
110
+
111
+ ## Intended use
112
+
113
+ - On-device next-word / short-phrase suggestion in a Russian keyboard.
114
+ - Any task that needs a ~200 MB quantised causal LM that continues Russian text.
115
+
116
+ Not intended for: instruction following, factual question answering, code, long-form reasoning. This is a
117
+ 0.36B model trained for 1.2B tokens; its knowledge is narrow by construction.
118
+
119
+ ## Limitations
120
+
121
+ - **Work in progress.** No quality claims until the run finishes and the table above is filled.
122
+ - Russian is tokenised near character level (see above): slower decoding and a larger effective cost per
123
+ Russian word than the same model pays for English.
124
+ - Web text only. Register is mostly written/informal blog Russian; no dialogue corpora, no post-training.
125
+ - Capacity is 0.36B. Expect weak facts, weak arithmetic, and drift on long generations.
126
+ - English and Chinese are expected to regress somewhat; the 25% replay mix limits but does not remove this.
127
+ - The ChatML template from the base model is inherited but untrained here — do not use this checkpoint in
128
+ chat mode.
129
+
130
+ ## Licence and attribution
131
+
132
+ Weights: Apache-2.0, inherited from the base model. Data: ODC-BY 1.0 (FineWeb, FineWeb-2).
133
+ If you use this model, credit the base release:
134
+
135
+ ```bibtex
136
+ @misc{mnn_pocket_03b,
137
+ title = {MNN-Pocket-0.3B},
138
+ author = {Taobao MNN team},
139
+ year = {2026},
140
+ url = {https://huggingface.co/taobao-mnn/MNN-Pocket-0.3B}
141
+ }
142
+ ```