kmamaroziqov commited on
Commit
dc86321
·
verified ·
1 Parent(s): f87d409

Add tokenizer fertility and cross-model benchmark comparison

Browse files

Tokenizer fertility on uz-crawl (2.41 vs 3.43 tokens/word against stock Qwen3.5-2B) and a full eight-task suite comparison against alloma-1B, alloma-3B, and stock Qwen3.5-2B, with all four runs rescored under one COMET-primary weighting. Also corrects the lineage step: the tokenizer is a retrofit at unchanged vocabulary size, not an extension.

.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ assets/suite_by_task.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -18,7 +18,7 @@ tags:
18
 
19
  # NeuronAI 2B
20
 
21
- `NeuronUz/qwen3.5-2b-fine-tuned` is an Uzbek-first, text-only Qwen3.5 2B
22
  assistant model with English capability retained. The published weights are a
23
  merged checkpoint: no adapter is required at inference time.
24
 
@@ -29,7 +29,7 @@ replaces the previous full-parameter SFT checkpoint.
29
  ## Model lineage
30
 
31
  1. `Qwen/Qwen3.5-2B-Base`
32
- 2. Uzbek tokenizer extension and embedding initialization
33
  3. Uzbek continued pretraining
34
  4. Annealing
35
  5. Assistant-only supervised fine-tuning with LoRA r64
@@ -66,6 +66,73 @@ Checkpoint 1188 scored higher on UzLiB (0.54326), but checkpoint 4749 was
66
  selected because it was stronger overall, particularly in translation,
67
  classification, and sentiment.
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ## Training summary
70
 
71
  - Base: Uzbek CPT + anneal checkpoint
@@ -96,7 +163,7 @@ not distributed in this model repository.
96
  import torch
97
  from transformers import AutoModelForCausalLM, AutoTokenizer
98
 
99
- model_id = "NeuronUz/qwen3.5-2b-fine-tuned"
100
 
101
  tokenizer = AutoTokenizer.from_pretrained(model_id)
102
  model = AutoModelForCausalLM.from_pretrained(
@@ -137,7 +204,7 @@ The model emits `<|im_end|>` and the generation metadata registers both
137
  from vllm import LLM, SamplingParams
138
 
139
  llm = LLM(
140
- model="NeuronUz/qwen3.5-2b-fine-tuned",
141
  max_model_len=4096,
142
  )
143
  params = SamplingParams(temperature=0.0, max_tokens=512)
 
18
 
19
  # NeuronAI 2B
20
 
21
+ `NeuronUz/NeuronAI-2B` is an Uzbek-first, text-only Qwen3.5 2B
22
  assistant model with English capability retained. The published weights are a
23
  merged checkpoint: no adapter is required at inference time.
24
 
 
29
  ## Model lineage
30
 
31
  1. `Qwen/Qwen3.5-2B-Base`
32
+ 2. Uzbek tokenizer retrofit (same vocabulary size) and embedding re-initialization
33
  3. Uzbek continued pretraining
34
  4. Annealing
35
  5. Assistant-only supervised fine-tuning with LoRA r64
 
66
  selected because it was stronger overall, particularly in translation,
67
  classification, and sentiment.
68
 
69
+ ## Tokenizer fertility
70
+
71
+ The Uzbek tokenizer work in this model is a **retrofit, not an extension**: the
72
+ vocabulary stays at Qwen3.5's 248,044 entries, and Uzbek merges replace low-value
73
+ slots rather than being appended. The embedding matrix
74
+ therefore does not grow, and the parameter count is unchanged from the base
75
+ model -- the gain is purely in how Uzbek text segments.
76
+
77
+ ![Uzbek tokenizer fertility on uz-crawl](assets/fertility_uzcrawl.png)
78
+
79
+ | Tokenizer | Vocabulary | Tokens per word (uz-crawl) |
80
+ | --- | ---: | ---: |
81
+ | NeuronAI-2B | 248,044 | **2.407** |
82
+ | Qwen3.5-2B (stock) | 248,044 | 3.426 |
83
+
84
+ Measured on 20,000 documents (4.8M whitespace words) reservoir-sampled with seed 42
85
+ from uz-crawl (tahrirchi web crawl), keeping documents of at least 250 characters.
86
+ Stock Qwen3.5 needs **1.42x** as many tokens for the same Uzbek text, so the retrofit
87
+ is worth about **30%** of the context window, the prefill cost, and the decode steps
88
+ on Uzbek input.
89
+
90
+ Caveat: uz-crawl is part of the Uzbek continued-pretraining corpus, so it is
91
+ in-domain for the tokenizer that was fitted on it. The fertility gap on unseen
92
+ Uzbek web text is expected to be somewhat smaller.
93
+
94
+ ## Comparison with other models
95
+
96
+ ![Uzbek public benchmark suite, weighted score](assets/weighted_score.png)
97
+
98
+ Compared against the two open Uzbek instruction models in this size class
99
+ (`alloma-1B-Instruct` and `alloma-3B-Instruct`, both Llama-3.2 fine-tunes) and
100
+ against the stock base model, `Qwen/Qwen3.5-2B`.
101
+
102
+ ![Uzbek public benchmark suite, per task](assets/suite_by_task.png)
103
+
104
+ | Benchmark | Metric | Weight | NeuronAI-2B | Qwen3.5-2B | alloma-3B | alloma-1B |
105
+ | --- | --- | ---: | ---: | ---: | ---: | ---: |
106
+ | uzlib (uz MCQ) | accuracy | 0.20 | 0.4960 | 0.2869 | 0.3208 | 0.2332 |
107
+ | TUMLU-uz | accuracy | 0.20 | 0.3257 | 0.3129 | 0.2771 | 0.2200 |
108
+ | FLORES en->uz (COMET) | COMET | 0.15 | 0.8762 | 0.7010 | 0.8673 | 0.7383 |
109
+ | News classification | accuracy | 0.10 | 0.7855 | 0.3675 | 0.1360 | 0.2541 |
110
+ | MMLU (en) | accuracy | 0.10 | 0.5407 | 0.5239 | 0.3873 | 0.2198 |
111
+ | MMLU-uz | accuracy | 0.10 | 0.4685 | 0.3710 | 0.3274 | 0.2111 |
112
+ | FLORES uz->en (COMET) | COMET | 0.05 | 0.8535 | 0.8072 | 0.7954 | 0.7636 |
113
+ | Sentiment (binary) | accuracy | 0.05 | 0.9550 | 0.7687 | 0.3885 | 0.7954 |
114
+ | **Weighted score** | | 0.95 | **0.5657** | **0.4301** | **0.3940** | **0.3478** |
115
+
116
+ **On score comparability.** These four runs were produced by three different
117
+ suite revisions. The alloma runs used the APST suite variant, stock Qwen used the
118
+ plain variant, and NeuronAI-2B used the COMET-primary variant; the first two weight
119
+ translation by BLEU and the third by COMET, so their archived weighted scores are
120
+ not on one scale. Every run passed `--compute-comet`, so the table above recomputes
121
+ all four from the per-task outputs under a single weighting (the COMET-primary
122
+ weights, translation scored by COMET). The NeuronAI-2B weighted score therefore
123
+ reads 0.5657 here versus 0.5954 in the section above, which normalizes over the 0.95 total weight; the ranking is unaffected.
124
+
125
+ Both alloma models were evaluated with the apostrophe-to-`APST` substitution their
126
+ model card requires. Their runs tripped the suite's invalid-output gate on several
127
+ MCQ tasks (alloma-1B on uzlib and TUMLU, alloma-3B on TUMLU and MMLU-en), meaning
128
+ part of their MCQ gap is format compliance rather than knowledge.
129
+
130
+ NeuronAI-2B leads the weighted score and every one of the eight tasks, including
131
+ against alloma-3B at over half again its parameter count. The margin is narrowest
132
+ on FLORES+ en->uz (0.8762 against alloma-3B's 0.8673) and on TUMLU-Uzbek, which is
133
+ the weakest task for every model tested, ours included -- at 0.3257 it is close
134
+ enough to the 0.25 four-way chance level to treat as unsolved at this scale.
135
+
136
  ## Training summary
137
 
138
  - Base: Uzbek CPT + anneal checkpoint
 
163
  import torch
164
  from transformers import AutoModelForCausalLM, AutoTokenizer
165
 
166
+ model_id = "NeuronUz/NeuronAI-2B"
167
 
168
  tokenizer = AutoTokenizer.from_pretrained(model_id)
169
  model = AutoModelForCausalLM.from_pretrained(
 
204
  from vllm import LLM, SamplingParams
205
 
206
  llm = LLM(
207
+ model="NeuronUz/NeuronAI-2B",
208
  max_model_len=4096,
209
  )
210
  params = SamplingParams(temperature=0.0, max_tokens=512)
assets/fertility_uzcrawl.png ADDED
assets/suite_by_task.png ADDED

Git LFS Details

  • SHA256: bde18eee5f45decb9b5d54af20cc0efa4aa4549b30f99c262ca08119b91a1a10
  • Pointer size: 131 Bytes
  • Size of remote file: 124 kB
assets/weighted_score.png ADDED