Rahspide commited on
Commit
dca989a
Β·
verified Β·
1 Parent(s): 153c8b0

docs: v1 results, GGUF builds, honest en/zh regression

Browse files
Files changed (1) hide show
  1. README.md +31 -15
README.md CHANGED
@@ -23,9 +23,9 @@ tags:
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
  that teaches it Russian while keeping English and Chinese intact. It is a small multilingual continuation
@@ -42,7 +42,7 @@ continues a typed prefix instead of answering it. English and Chinese are kept a
42
  | Training tokens | 1.2B (0.9B ru + 0.204B en + 0.096B zh) |
43
  | Method | full fine-tune, 1 epoch, no LoRA |
44
  | Hardware | single Colab T4 16 GB, 4.8k tok/s, ~69 h total |
45
- | Progress (2026-11-09) | step 1,340 / 36,621, 44M tokens |
46
 
47
  ## Why the recipe looks like this: Russian is expensive in this tokenizer
48
 
@@ -99,16 +99,19 @@ were used, so the resulting weights stay publishable.
99
  Per language: perplexity, **bits per character**, and top-1 / top-5 next-token accuracy. Bits/char is the
100
  metric that stays comparable across tokenizers, which perplexity is not.
101
 
102
- Baseline, the untouched base model (measured 2026-11-09, 100k held-out tokens per language):
103
 
104
- | Lang | ppl | bits/char | top-1 | top-5 | chars/token |
105
- |---|---|---|---|---|---|
106
- | ru | 10.42 | 1.625 | 46.2% | 69.3% | 2.08 |
107
- | en | 21.85 | 1.016 | 39.9% | 64.1% | 4.40 |
108
- | zh | 23.95 | 3.274 | 41.9% | 62.0% | 1.42 |
109
 
110
- Fine-tuned numbers: *(pending)*. The acceptance gate is a clear drop in Russian bits/char with at most a
111
- ~10% regression on English and Chinese bits/char.
 
 
 
112
 
113
  ## Two models, two jobs
114
 
@@ -129,6 +132,20 @@ The split exists because the two tasks reward opposite behaviour. Training a sin
129
  it mediocre at each: a continuation model that starts answering, and an assistant that leaks into
130
  completion mode.
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  ## Intended use
133
 
134
  - On-device next-word and short-phrase suggestion in a keyboard or IME, Russian first, English and Chinese
@@ -149,8 +166,8 @@ This checkpoint is the first of several variants, ordered by cost:
149
 
150
  | Variant | What | Status |
151
  |---|---|---|
152
- | **v1** | Russian continuation model β€” this run | training |
153
- | **v2** | Russian assistant: instruction tuning (SFT on ChatML) on top of v1, not a separate pretraining run β€” see [`MNN-Pocket-0.3B-RU-Chat`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU-Chat) | planned |
154
  | **v3** | Tokenizer extension: ~4–8k extra Cyrillic BPE merges plus an embedding resize, warm-started from v1, cutting Russian tokens per word by roughly half | optional, after v1 |
155
  | **v4** | Quantised builds for devices: GGUF Q8_0 / Q4_K_M and MNN INT4, with device-side tok/s measurements | after v1 |
156
 
@@ -159,7 +176,6 @@ is then a short SFT on top of it rather than another round of pretraining.
159
 
160
  ## Limitations
161
 
162
- - **Work in progress.** No quality claims until the run finishes and the table above is filled.
163
  - Russian is tokenised near character level (see above): slower decoding and a larger effective cost per
164
  Russian word than the same model pays for English.
165
  - Web text only. Register is mostly written/informal blog Russian; no dialogue corpora, no post-training.
 
23
 
24
  # MNN-Pocket-0.3B-RU (work in progress)
25
 
26
+ > **Status: v1 released.** Trained on 1.2B tokens (one epoch), weights in this repository, GGUF builds in
27
+ > `gguf/`. Training log, checkpoints and the evaluation script live in the private repo
28
+ > `Rahspide/mnn-pocket-ru-run`.
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
  that teaches it Russian while keeping English and Chinese intact. It is a small multilingual continuation
 
42
  | Training tokens | 1.2B (0.9B ru + 0.204B en + 0.096B zh) |
43
  | Method | full fine-tune, 1 epoch, no LoRA |
44
  | Hardware | single Colab T4 16 GB, 4.8k tok/s, ~69 h total |
45
+ | Training | 36,621 steps Γ— 32,768 tokens = 1.2B tokens, ~11 h on one A100 40 GB (25k tok/s), ~35 h on L4 |
46
 
47
  ## Why the recipe looks like this: Russian is expensive in this tokenizer
48
 
 
99
  Per language: perplexity, **bits per character**, and top-1 / top-5 next-token accuracy. Bits/char is the
100
  metric that stays comparable across tokenizers, which perplexity is not.
101
 
102
+ 100k held-out tokens per language, identical settings for both models:
103
 
104
+ | Lang | ppl base β†’ v1 | bits/char base β†’ v1 | top-1 base β†’ v1 | top-5 base β†’ v1 |
105
+ |---|---|---|---|---|
106
+ | **ru** | 10.42 β†’ **5.05** | 1.625 β†’ **1.123** (βˆ’31%) | 46.2% β†’ **61.0%** | 69.3% β†’ **80.6%** |
107
+ | en | 21.85 β†’ 41.16 | 1.016 β†’ 1.225 (+21%) | 39.9% β†’ 35.5% | 64.1% β†’ 58.7% |
108
+ | zh | 23.95 β†’ 51.86 | 3.274 β†’ 4.071 (+24%) | 41.9% β†’ 37.7% | 62.0% β†’ 55.6% |
109
 
110
+ Russian landed well past the target (bits/char 1.123 against a 1.40 gate). English and Chinese regressed
111
+ by 21–24%, i.e. beyond the +10% the recipe aimed for: a 25% replay mix is too thin at 0.36B when the target
112
+ language is tokenised this badly. A second pass with a 50/25/25 mix at lr 5e-5 was started to pull en/zh
113
+ back, and it got through ~50M of the planned 200M tokens before the compute budget ran out β€” that variant is
114
+ **not** published. Treat v1 as Russian-first, with working but measurably weaker English and Chinese.
115
 
116
  ## Two models, two jobs
117
 
 
132
  it mediocre at each: a continuation model that starts answering, and an assistant that leaks into
133
  completion mode.
134
 
135
+ ## GGUF builds
136
+
137
+ | File | Size | Note |
138
+ |---|---|---|
139
+ | `gguf/MNN-Pocket-0.3B-RU-Q8_0.gguf` | 310 MB | near-lossless, the one to use on desktop |
140
+ | `gguf/MNN-Pocket-0.3B-RU-Q4_K_M.gguf` | 223 MB | the size to ship on a phone |
141
+
142
+ Converted with llama.cpp `convert_hf_to_gguf.py` (f16) and quantised with `llama-quantize`. Measured on a
143
+ 16-thread x86 CPU: ~78 tok/s generation on Q4_K_M, ~88 tok/s prompt processing β€” no GPU involved.
144
+
145
+ The base model's tokenizer ships a pre-tokenizer that current llama.cpp does not hash-match, so conversion
146
+ needs the Qwen pre-tokenizer pinned by hand (`qwen2`) and `extra_special_tokens` removed from
147
+ `tokenizer_config.json`. Both are fixed in this repository's copy of the file.
148
+
149
  ## Intended use
150
 
151
  - On-device next-word and short-phrase suggestion in a keyboard or IME, Russian first, English and Chinese
 
166
 
167
  | Variant | What | Status |
168
  |---|---|---|
169
+ | **v1** | Russian continuation model β€” this run | **released** |
170
+ | **v2** | Russian assistant: instruction tuning (SFT on ChatML) on top of v1 β€” see [`MNN-Pocket-0.3B-RU-Chat`](https://huggingface.co/Rahspide/MNN-Pocket-0.3B-RU-Chat) | planned |
171
  | **v3** | Tokenizer extension: ~4–8k extra Cyrillic BPE merges plus an embedding resize, warm-started from v1, cutting Russian tokens per word by roughly half | optional, after v1 |
172
  | **v4** | Quantised builds for devices: GGUF Q8_0 / Q4_K_M and MNN INT4, with device-side tok/s measurements | after v1 |
173
 
 
176
 
177
  ## Limitations
178
 
 
179
  - Russian is tokenised near character level (see above): slower decoding and a larger effective cost per
180
  Russian word than the same model pays for English.
181
  - Web text only. Register is mostly written/informal blog Russian; no dialogue corpora, no post-training.