kmamaroziqov commited on
Commit
30e8f3b
·
verified ·
1 Parent(s): 80c3430

Rename to MustaqiLLM; correct dtype/EOS/memory facts; resolve news class names; fix broken table

Browse files
Files changed (1) hide show
  1. README.md +43 -62
README.md CHANGED
@@ -10,19 +10,15 @@ tags:
10
  - o'zbek
11
  - chat
12
  - instruction-tuned
13
- base_model: kmamaroziqov/NeuronAI-5B-Base
14
  library_name: transformers
15
  ---
16
 
17
- # MilliyLM-5B
18
 
19
- An instruction-tuned Uzbek chat model, supervised fine-tuned from
20
- [`kmamaroziqov/NeuronAI-5B-Base`](https://huggingface.co/kmamaroziqov/NeuronAI-5B-Base).
21
-
22
- MilliyLM-5B is a **chat and text-classification model**. It follows Uzbek instructions
23
- reliably, writes fluent Uzbek in both Latin and Cyrillic script, and is strong on
24
- sentiment and news classification. It is **not** a knowledge model: on multiple-choice
25
- knowledge benchmarks it performs at chance. Read the
26
  [Evaluation](#evaluation) and [Limitations](#limitations) sections before using it —
27
  they are specific about what works and what does not.
28
 
@@ -36,7 +32,7 @@ they are specific about what works and what does not.
36
  | Context length | 4096 tokens |
37
  | Vocabulary | 48,000 (BPE) |
38
  | Embeddings | untied |
39
- | Weights dtype | bfloat16 |
40
  | Languages | Uzbek (Latin + Cyrillic), English, Russian |
41
 
42
  ---
@@ -50,7 +46,7 @@ code ships inside this repository.
50
  import torch
51
  from transformers import AutoModelForCausalLM, AutoTokenizer
52
 
53
- model_id = "NeuronUz/MilliyLM-5B"
54
 
55
  tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
56
  model = AutoModelForCausalLM.from_pretrained(
@@ -73,7 +69,7 @@ with torch.no_grad():
73
  **inputs,
74
  max_new_tokens=256,
75
  do_sample=False, # greedy; see Generation settings below
76
- eos_token_id=5, # <|im_end|> -- NOT the config's </s>
77
  pad_token_id=3, # <pad>
78
  )
79
 
@@ -104,12 +100,16 @@ model was trained with.
104
 
105
  | setting | value | why |
106
  |---|---|---|
107
- | `eos_token_id` | **5** (`<|im_end|>`) | The turn terminator. Token id 1 (`</s>`) is the *pretraining* EOS and never appears in chat data using it means generation runs to `max_new_tokens`. |
108
- | `pad_token_id` | 3 (`<pad>`) | |
109
- | `do_sample` | `False` for classification/extraction; `True`, `temperature≈0.7`, `top_p≈0.9` for open chat | Every benchmark below was measured greedy. |
110
  | `dtype` | `torch.bfloat16` | Trained in bf16. |
111
 
112
- Memory: ~10.5 GB for weights in bf16, so a single 16 GB GPU is enough for inference.
 
 
 
 
 
113
 
114
  ### Serving
115
 
@@ -125,7 +125,9 @@ serve).
125
 
126
  ## Training
127
 
128
- Supervised fine-tuning only no continued pretraining was performed on top of the base.
 
 
129
 
130
  | | |
131
  |---|---|
@@ -154,7 +156,7 @@ The backbone mixes general Uzbek assistant data, benchmark-format task data
154
  retention slice. Third-person rubric-grading text was filtered out of the backbone
155
  before training.
156
 
157
- The Cyrillic and Russian slices exist because the base model reads and writes Uzbek
158
  Cyrillic *better* than Latin (bits-per-byte 0.2288 vs 0.3868) yet had almost no Cyrillic
159
  chat behaviour attached to it, and because Russian-language instructions were nearly
160
  absent. Checkpoint selection was done by running the full benchmark suite on all 12
@@ -175,7 +177,7 @@ test sets (no subsampling). Scores are accuracy unless noted.
175
  | uzlib (Uzbek linguistic MCQ) | 1,861 | 0.2875 | 0.0000 |
176
  | TUMLU-Uzbek (Uzbek MMLU) | 700 | 0.3286 | 0.0000 |
177
  | MMLU-Uz (translated MMLU) | 14,042 | 0.2584 | 0.0000 |
178
- | News topic classification (10-way) | 96,970 | **0.6531** | 0.0000 |
179
  | Sentiment (binary) | 10,000 | **0.9259** | 0.0001 |
180
 
181
  Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentiment.
@@ -207,36 +209,16 @@ Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentimen
207
  | class | n | score |
208
  |---|---:|---:|
209
  | Sport | 16,113 | 0.8743 |
210
- | class 2 | 5,177 | 0.7309 |
211
- | class 4 | 2,405 | 0.7081 |
212
- | class 0 | 29,500 | 0.6794 |
213
- | class 1 | 10,755 | 0.6596 |
214
- | class 5 | 3,505 | 0.6579 |
215
- | class 7 | 1,987 | 0.6548 |
216
- | class 8 | 1,784 | 0.5667 |
217
- | class 9 | 11,732 | 0.5124 |
218
  | Oila va Jamiyat (Family & Society) | 14,012 | 0.4273 |
219
 
220
- ### Comparison with prior SFTs of the same base
221
-
222
- Same benchmark suite, same conditions.
223
-
224
- | benchmark | **MilliyLM-5B** | NeuronAI-5B-v4 | NeuronAI-5B (v1) |
225
- |---|---:|---:|---:|
226
- | uzlib | **0.2875** | 0.2708 | 0.2638 |
227
- | TUMLU-Uz | **0.3286** | 0.2100 | 0.1914 |
228
- | MMLU-Uz | **0.2584** | 0.2136 | 0.2154 |
229
- | MMLU (English) | **0.2619** | 0.2142 | 0.2196 |
230
- | News | **0.6531** | 0.1834 | 0.1542 |
231
- | Sentiment | **0.9259** | 0.1186 | 0.2647 |
232
- | FLORES en→uz BLEU | 5.17 | **7.68** | 7.37 |
233
- | FLORES uz→en BLEU | 1.83 | **4.21** | 5.15 |
234
-
235
- Most of the classification gain comes from **format compliance** rather than raw
236
- capability: the earlier models emitted unparseable answers on 63–78% of sentiment items
237
- and 6–13% of TUMLU items, while MilliyLM-5B's invalid rate is ≤0.0001 across every task.
238
- Translation is the one axis where the earlier models are better — see Limitations.
239
-
240
  ### Contamination check
241
 
242
  44.1% of the sentiment evaluation set also appears in the training data, because the
@@ -260,14 +242,13 @@ with training data.
260
  **Multiple-choice knowledge tasks perform at chance.** uzlib, MMLU-Uz and MMLU-English
261
  all sit within noise of their 0.25 random baseline, across roughly 30,000 questions.
262
  Invalid rates near zero mean the model answers in the correct format every time and is
263
- still wrong — this is missing knowledge, not broken parsing. The base model completed a
264
- single pretraining epoch, and supervised fine-tuning cannot add facts that were never
265
- learned. **Do not use this model for factual question answering, exams, or retrieval-free
266
- knowledge tasks.** TUMLU-Uzbek at 0.3286 is the only MCQ result above chance, and its
267
- 700-item sample gives it a ±3.5% confidence interval.
268
-
269
- **Uzbek → English translation is weak and regressed against the base's earlier SFTs.**
270
- BLEU 1.83 with a 1.229 length ratio and 12.5% unigram precision means the model
271
  over-generates English that mostly does not match the reference. English → Uzbek is
272
  usable (COMET 0.7397) but not competitive with dedicated translation systems.
273
 
@@ -281,8 +262,8 @@ output.** Loanwords and brand names inside Cyrillic text can come out mangled
281
  Latin words. Cyrillic *chat* is coherent and does not degenerate, but Cyrillic
282
  *orthography* is less reliable than Latin.
283
 
284
- **Self-identification.** The identity training data names the model "NeuronAI 5B", so
285
- asked who it is, it answers with that name rather than "MilliyLM-5B".
286
 
287
  **News classification is uneven.** The "Oila va Jamiyat" (Family & Society) class scores
288
  0.4273 across 14,012 items — a semantically diffuse catch-all the model handles poorly,
@@ -309,16 +290,16 @@ advice).
309
 
310
  ## License
311
 
312
- Apache 2.0, inherited from the base model. Training data licensing follows the sources
313
- of the underlying public datasets.
314
 
315
  ## Citation
316
 
317
  ```bibtex
318
- @misc{milliylm5b,
319
- title = {MilliyLM-5B: an instruction-tuned Uzbek language model},
320
  author = {NeuronUz},
321
  year = {2026},
322
- url = {https://huggingface.co/NeuronUz/MilliyLM-5B}
323
  }
324
  ```
 
10
  - o'zbek
11
  - chat
12
  - instruction-tuned
 
13
  library_name: transformers
14
  ---
15
 
16
+ # MustaqiLLM
17
 
18
+ MustaqiLLM is a 5.17-billion-parameter Uzbek **chat and text-classification model**. It
19
+ follows Uzbek instructions reliably, writes fluent Uzbek in both Latin and Cyrillic
20
+ script, and is strong on sentiment and news classification. It is **not** a knowledge
21
+ model: on multiple-choice knowledge benchmarks it performs at chance. Read the
 
 
 
22
  [Evaluation](#evaluation) and [Limitations](#limitations) sections before using it —
23
  they are specific about what works and what does not.
24
 
 
32
  | Context length | 4096 tokens |
33
  | Vocabulary | 48,000 (BPE) |
34
  | Embeddings | untied |
35
+ | Weights dtype | bfloat16 (embeddings and `lm_head` stored fp32) |
36
  | Languages | Uzbek (Latin + Cyrillic), English, Russian |
37
 
38
  ---
 
46
  import torch
47
  from transformers import AutoModelForCausalLM, AutoTokenizer
48
 
49
+ model_id = "NeuronUz/MustaqiLLM"
50
 
51
  tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
52
  model = AutoModelForCausalLM.from_pretrained(
 
69
  **inputs,
70
  max_new_tokens=256,
71
  do_sample=False, # greedy; see Generation settings below
72
+ eos_token_id=5, # <|im_end|> -- also the repo default
73
  pad_token_id=3, # <pad>
74
  )
75
 
 
100
 
101
  | setting | value | why |
102
  |---|---|---|
103
+ | `eos_token_id` | **5** (`<\|im_end\|>`) | The turn terminator, and already the default in `config.json` / `generation_config.json` you do not need to pass it. Do **not** override it with the pretraining EOS (`</s>`), which never appears in chat data: generation would then run to `max_new_tokens`. |
104
+ | `do_sample` | `False` for classification/extraction; `True`, `temperature≈0.7`, `top_p≈0.9` for open chat | `generation_config.json` ships `do_sample: true` with no temperature or top_p set, so pass these explicitly. Every benchmark below was measured greedy. |
 
105
  | `dtype` | `torch.bfloat16` | Trained in bf16. |
106
 
107
+ Memory: the checkpoint is 11.0 GB on disk (embeddings and `lm_head` are stored fp32); loading with
108
+ `dtype=torch.bfloat16` as above casts them down to ~10.3 GB of weights, so a single 16 GB GPU is
109
+ enough for inference.
110
+
111
+ `config.json` sets `use_cache: false`, but `generation_config.json` sets `use_cache: true`, so
112
+ `generate()` uses the KV cache. Pass `use_cache=True` explicitly if you write your own decode loop.
113
 
114
  ### Serving
115
 
 
125
 
126
  ## Training
127
 
128
+ MustaqiLLM is the instruction-following stage on top of an in-house 5.17 B Uzbek
129
+ pretrained model. The pretrained checkpoint completed a single pass over its corpus;
130
+ this stage is supervised fine-tuning only — no continued pretraining was performed.
131
 
132
  | | |
133
  |---|---|
 
156
  retention slice. Third-person rubric-grading text was filtered out of the backbone
157
  before training.
158
 
159
+ The Cyrillic and Russian slices exist because the pretrained model reads and writes Uzbek
160
  Cyrillic *better* than Latin (bits-per-byte 0.2288 vs 0.3868) yet had almost no Cyrillic
161
  chat behaviour attached to it, and because Russian-language instructions were nearly
162
  absent. Checkpoint selection was done by running the full benchmark suite on all 12
 
177
  | uzlib (Uzbek linguistic MCQ) | 1,861 | 0.2875 | 0.0000 |
178
  | TUMLU-Uzbek (Uzbek MMLU) | 700 | 0.3286 | 0.0000 |
179
  | MMLU-Uz (translated MMLU) | 14,042 | 0.2584 | 0.0000 |
180
+ | News topic classification (10-way, `risqaliyevds/uzbek-zero-shot-classification`) | 96,970 | **0.6531** | 0.0000 |
181
  | Sentiment (binary) | 10,000 | **0.9259** | 0.0001 |
182
 
183
  Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentiment.
 
209
  | class | n | score |
210
  |---|---:|---:|
211
  | Sport | 16,113 | 0.8743 |
212
+ | Texnologiya (Technology) | 5,177 | 0.7309 |
213
+ | Madaniyat (Culture) | 2,405 | 0.7081 |
214
+ | Siyosat (Politics) | 29,500 | 0.6794 |
215
+ | Iqtisodiyot (Economy) | 10,755 | 0.6596 |
216
+ | Salomatlik (Health) | 3,505 | 0.6579 |
217
+ | Ta'lim (Education) | 1,987 | 0.6548 |
218
+ | Ekologiya (Ecology) | 1,784 | 0.5667 |
219
+ | Xorijiy Yangiliklar (World news) | 11,732 | 0.5124 |
220
  | Oila va Jamiyat (Family & Society) | 14,012 | 0.4273 |
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  ### Contamination check
223
 
224
  44.1% of the sentiment evaluation set also appears in the training data, because the
 
242
  **Multiple-choice knowledge tasks perform at chance.** uzlib, MMLU-Uz and MMLU-English
243
  all sit within noise of their 0.25 random baseline, across roughly 30,000 questions.
244
  Invalid rates near zero mean the model answers in the correct format every time and is
245
+ still wrong — this is missing knowledge, not broken parsing. The underlying pretrained
246
+ model completed a single pretraining epoch, and supervised fine-tuning cannot add facts
247
+ that were never learned. **Do not use this model for factual question answering, exams,
248
+ or retrieval-free knowledge tasks.** TUMLU-Uzbek at 0.3286 is the only MCQ result above
249
+ chance, and its 700-item sample gives it a ±3.5% confidence interval.
250
+
251
+ **Uzbek → English translation is weak.** BLEU 1.83 with a 1.229 length ratio and 12.5% unigram precision means the model
 
252
  over-generates English that mostly does not match the reference. English → Uzbek is
253
  usable (COMET 0.7397) but not competitive with dedicated translation systems.
254
 
 
262
  Latin words. Cyrillic *chat* is coherent and does not degenerate, but Cyrillic
263
  *orthography* is less reliable than Latin.
264
 
265
+ **Self-identification.** The identity training data predates the current name, so asked
266
+ who it is, the model answers "NeuronAI 5B" rather than "MustaqiLLM".
267
 
268
  **News classification is uneven.** The "Oila va Jamiyat" (Family & Society) class scores
269
  0.4273 across 14,012 items — a semantically diffuse catch-all the model handles poorly,
 
290
 
291
  ## License
292
 
293
+ Apache 2.0. Training data licensing follows the sources of the underlying public
294
+ datasets.
295
 
296
  ## Citation
297
 
298
  ```bibtex
299
+ @misc{mustaqillm,
300
+ title = {MustaqiLLM: an instruction-tuned Uzbek language model},
301
  author = {NeuronUz},
302
  year = {2026},
303
+ url = {https://huggingface.co/NeuronUz/MustaqiLLM}
304
  }
305
  ```