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

Release NeuronAI 2B LoRA r64 checkpoint 4749

Browse files

Replace the previous full-parameter SFT release with the merged CPT+anneal, grouped-v4 LoRA r64 checkpoint 4749. Updates model card with the completed eight-task COMET-primary suite and BLEU results.

Files changed (4) hide show
  1. README.md +81 -148
  2. config.json +4 -1
  3. model.safetensors +1 -1
  4. tokenizer_config.json +1 -1
README.md CHANGED
@@ -12,117 +12,83 @@ tags:
12
  - text-generation
13
  - conversational
14
  - axolotl
 
 
15
  ---
16
 
17
- # Qwen3.5 2B Uzbek Fine-Tuned
18
 
19
- A text-only Qwen3.5 2B checkpoint for Uzbek instruction following and
20
- conversation, with English retained. Uzbek continued pretraining and annealing,
21
- then a full-parameter supervised fine-tune.
22
 
23
- This release replaces the earlier LoRA-broad checkpoint. It scores higher on
24
- every benchmark below and, unlike its predecessor, **stops generating on its
25
- own** the previous checkpoints never learned to emit the turn terminator and
26
- needed sentence counters and repetition penalties to produce usable output. The
27
- usage example below is correspondingly plain.
28
 
29
  ## Model lineage
30
 
31
  1. `Qwen/Qwen3.5-2B-Base`
32
- 2. Uzbek tokenizer extension (vocabulary 248,320) and embedding initialization
33
  3. Uzbek continued pretraining
34
  4. Annealing
35
- 5. Full-parameter supervised fine-tuning (no LoRA — these are the trained weights)
36
-
37
- ## Benchmarks
38
-
39
- ### Comparison with alloma-1B and alloma-3B
40
-
41
- Run with the benchmark protocol published in the **alloma model card** — its
42
- tasks, datasets and prompts, used verbatim so the comparison does not depend
43
- on prompt formats chosen by us. alloma's required APST apostrophe preprocessing
44
- is applied to the alloma models. Full test splits, greedy decoding. COMET is
45
- `Unbabel/wmt22-comet-da`. Higher is better throughout.
46
-
47
- | Benchmark | **This model** (1.88B) | alloma-1B (1.24B) | alloma-3B (3.21B) |
48
- | --- | ---: | ---: | ---: |
49
- | Uzbek sentiment analysis | **93.09** | 58.05 | 81.53 |
50
- | Uzbek news classification | **56.47** | 15.85 | 33.78 |
51
- | MMLU (English) | **52.81** | 28.61 | 45.34 |
52
- | BLEU uz→en | 21.04 | 16.10 | **24.62** |
53
- | COMET uz→en | 81.06 | 80.08 | **85.14** |
54
- | BLEU en→uz | 9.85 | 8.70 | **14.54** |
55
- | COMET en→uz | 83.82 | 81.20 | **86.80** |
56
-
57
- Read this honestly, in both directions:
58
-
59
- - This model beats **alloma-1B on every metric**, and beats the ~1.7x larger
60
- **alloma-3B on classification and English knowledge** by wide margins
61
- (sentiment +11.6, news +22.7, MMLU +7.5).
62
- - **alloma-3B is clearly better at translation**, in both directions and on both
63
- BLEU and COMET. If translation quality is your priority, alloma-3B is the
64
- stronger choice, and alloma-8B stronger still.
65
-
66
- ### Full public suite
67
-
68
- Our own eight-task Uzbek suite, vLLM backend, full test splits, greedy decoding.
69
- Shown against this model's predecessor and the stock instruct model.
70
-
71
- | Benchmark | Metric | **This model** | Previous release (LoRA broad) | Qwen3.5-2B-Instruct (stock) |
72
- | --- | --- | ---: | ---: | ---: |
73
- | UzLiB | accuracy | **0.4863** | 0.4782 | 0.2880 |
74
- | TUMLU-Uzbek | accuracy | **0.3214** | 0.3686 | 0.3129 |
75
- | News classification | accuracy | **0.7948** | 0.7355 | 0.3675 |
76
- | Sentiment (binary) | accuracy | **0.9626** | 0.9348 | 0.7676 |
77
- | MMLU (English) | accuracy | **0.5422** | 0.5300 | 0.5241 |
78
- | MMLU (Uzbek) | accuracy | **0.4707** | 0.4640 | 0.3711 |
79
- | FLORES+ en→uz | BLEU | **9.90** | 4.05 | 4.16 |
80
- | FLORES+ en→uz | COMET | **0.8496** | 0.7413 | 0.6790 |
81
- | FLORES+ uz→en | BLEU | **23.07** | 5.93 | 17.13 |
82
- | FLORES+ uz→en | COMET | **0.8314** | 0.6056 | 0.8091 |
83
- | **Weighted score** | | **0.4388** | 0.4190 | 0.3154 |
84
-
85
- The weighted score combines all eight tasks (UzLiB 0.20, TUMLU 0.20, en→uz 0.15,
86
- news 0.10, MMLU-en 0.10, MMLU-uz 0.10, uz→en 0.05, sentiment 0.05), with BLEU
87
- scaled to a 0–1 range.
88
-
89
- The alloma models are deliberately **not** listed in this second table. They were
90
- measured on it (alloma-1B 0.2242, alloma-3B 0.2666), but those runs fail the
91
- suite's own output-validity gate: alloma-3B produced unparseable answers on 44.1%
92
- of sentiment items and 28.7% of TUMLU items under our prompt formats, versus
93
- 0.0% invalid for this model. Those scores measure compliance with our prompt
94
- templates, not model capability, so quoting them as a head-to-head result would
95
- overstate this model. The alloma-protocol table above is the fair comparison.
96
-
97
- Notes on reading these numbers honestly:
98
-
99
- - **Translation is where the gain over the previous release is largest** (en→uz
100
- BLEU 4.05 → 9.90, uz→en 5.93 → 23.07). Much of that is the terminator fix: the
101
- previous checkpoint ran past the end of its answer, which BLEU punishes
102
- severely.
103
- - **TUMLU-Uzbek regressed** (0.3686 → 0.3214) and is this model's weakest task.
104
- It is also near the 0.25 random baseline for 4-choice questions, so treat
105
- Uzbek multi-subject knowledge as unreliable.
106
- - Invalid-output rate was 0.0000 on all format-scored tasks.
107
- - The checkpoint published here is the one that scored best on this suite
108
- (1.5 epochs), selected across all 12 training checkpoints. It is not the final
109
- epoch-3 weights, which scored 0.4310.
110
 
111
  ## Training summary
112
 
113
- - Framework: Axolotl / Transformers
114
- - Method: full-parameter supervised fine-tuning
115
- - Data: 169,919 conversational examples (Uzbek-first, with task-format and
116
- English retention data)
117
- - Sequence length: 2,048, one sample per sequence (no packing)
118
- - Epochs: 3, best checkpoint by benchmark score taken at 1.5 epochs
 
 
 
 
 
119
  - Effective batch size: 32
120
- - Learning rate: 1e-5, cosine schedule, 3% warmup
121
- - Optimizer: AdamW, β₂ = 0.95, gradient clipping 1.0
122
- - Precision: bf16
123
- - Loss on assistant turns only; `<|im_end|>` trained as the turn terminator
124
 
125
- The training data is not included in this repository.
 
 
 
126
 
127
  ## Usage
128
 
@@ -136,7 +102,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
136
  model = AutoModelForCausalLM.from_pretrained(
137
  model_id,
138
  dtype=torch.bfloat16,
139
- device_map="cuda:0", # keep this hybrid model on a single device
140
  )
141
 
142
  messages = [
@@ -147,6 +113,7 @@ messages = [
147
  inputs = tokenizer.apply_chat_template(
148
  messages,
149
  add_generation_prompt=True,
 
150
  return_tensors="pt",
151
  return_dict=True,
152
  ).to(model.device)
@@ -155,73 +122,39 @@ with torch.inference_mode():
155
  output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
156
 
157
  reply = tokenizer.decode(
158
- output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True
 
159
  ).strip()
160
  print(reply)
161
  ```
162
 
163
- No stopping criteria, repetition penalty, or `no_repeat_ngram_size` are needed
164
- the model emits `<|im_end|>`, and `generation_config.json` already registers it
165
- as an end-of-sequence token.
166
-
167
- ### Multi-turn chat
168
-
169
- ```python
170
- messages = [{"role": "system", "content": "Siz foydali AI yordamchisiz."}]
171
-
172
- while True:
173
- user = input("> ").strip()
174
- if user in {"", "exit", "quit"}:
175
- break
176
- messages.append({"role": "user", "content": user})
177
-
178
- inputs = tokenizer.apply_chat_template(
179
- messages,
180
- add_generation_prompt=True,
181
- return_tensors="pt",
182
- return_dict=True,
183
- ).to(model.device)
184
-
185
- with torch.inference_mode():
186
- output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
187
-
188
- reply = tokenizer.decode(
189
- output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True
190
- ).strip()
191
- print(reply)
192
- messages.append({"role": "assistant", "content": reply})
193
- ```
194
 
195
  ### vLLM
196
 
197
  ```python
198
  from vllm import LLM, SamplingParams
199
 
200
- llm = LLM(model="NeuronUz/qwen3.5-2b-fine-tuned", max_model_len=4096)
 
 
 
201
  params = SamplingParams(temperature=0.0, max_tokens=512)
202
 
203
  messages = [
204
  {"role": "system", "content": "Siz foydali AI yordamchisiz."},
205
- {"role": "user", "content": "Bugungi ob-havo haqida nima deya olasiz?"},
206
  ]
207
  print(llm.chat(messages, params)[0].outputs[0].text)
208
  ```
209
 
210
- ### Notes
211
-
212
- - Requires a Transformers release with Qwen3.5 support.
213
- - Greedy decoding (`do_sample=False`) was used for all benchmark numbers above.
214
- For sampling, a reasonable starting point is `temperature=0.7`, `top_p=0.8`,
215
- `top_k=20`.
216
- - Avoid `device_map="auto"` when several GPUs are visible: current
217
- Accelerate/Transformers releases may split the Qwen3.5 hybrid layers across
218
- devices and produce invalid text. Pin the model to one device as shown.
219
-
220
- ## Limitations
221
 
222
- The model may produce inaccurate, biased, or fabricated information. Uzbek
223
- multi-subject knowledge (TUMLU) is close to the random baseline, so factual
224
- answers in specialist domains should not be trusted. It has not been
225
- comprehensively evaluated for safety or high-stakes use. Verify outputs
226
- independently before relying on them in medical, legal, financial, or other
227
- consequential settings.
 
 
12
  - text-generation
13
  - conversational
14
  - axolotl
15
+ - peft
16
+ - lora
17
  ---
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
 
25
+ This release updates the repository to the best overall checkpoint from the
26
+ 2026-08-18 LoRA r64 checkpoint sweep (`checkpoint-4749`, one SFT epoch). It
27
+ replaces the previous full-parameter SFT checkpoint.
 
 
28
 
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
36
+ 6. LoRA merged into the base weights for deployment
37
+
38
+ The model is called **NeuronAI 2B** in its identity training examples.
39
+
40
+ ## Evaluation
41
+
42
+ The four retained checkpoints were evaluated on the same strict eight-task
43
+ public suite using full test splits, greedy vLLM decoding, and COMET-primary
44
+ translation scoring. Checkpoint 4749 achieved the best normalized weighted
45
+ score. All format-scored tasks had a 0% invalid-output rate.
46
+
47
+ | Benchmark | Metric | Checkpoint 4749 |
48
+ | --- | --- | ---: |
49
+ | UzLiB | accuracy | 0.49597 |
50
+ | TUMLU-Uzbek | accuracy | 0.32571 |
51
+ | FLORES+ en→uz | COMET | 0.87615 |
52
+ | FLORES+ en→uz | BLEU | 12.00 |
53
+ | Uzbek news classification | accuracy | 0.78549 |
54
+ | MMLU (English) | accuracy | 0.54066 |
55
+ | MMLU (Uzbek) | accuracy | 0.46852 |
56
+ | FLORES+ uz→en | COMET | 0.85347 |
57
+ | FLORES+ uz→en | BLEU | 27.21 |
58
+ | Uzbek sentiment (binary) | accuracy | 0.95500 |
59
+ | **Normalized weighted score** | COMET-primary | **0.59542** |
60
+
61
+ Suite weights were UzLiB 0.20, TUMLU 0.20, en→uz COMET 0.15, news 0.10,
62
+ MMLU-en 0.10, MMLU-uz 0.10, uz→en COMET 0.05, and sentiment 0.05, normalized
63
+ over their total weight of 0.95.
64
+
65
+ 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
72
+ - Method: LoRA, merged for release
73
+ - LoRA rank/alpha/dropout: 64 / 128 / 0.05
74
+ - LoRA targets: all linear layers
75
+ - Trainable adapter parameters: 67,276,800
76
+ - Training data: 152,152 grouped and globally deduplicated examples
77
+ - Validation data: 1,537 grouped examples
78
+ - Train/dev prompt-group overlap: 0
79
+ - Sequence length: 2,048
80
+ - Packing: disabled
81
+ - Epochs: 1
82
  - Effective batch size: 32
83
+ - Learning rate: 1e-4, cosine schedule, 3% warmup
84
+ - Optimizer: AdamW, beta2 0.95, weight decay 0.01
85
+ - Precision: bf16 with selected recurrent parameters retained in fp32
86
+ - Loss: assistant turns only; `<|im_end|>` explicitly supervised
87
 
88
+ The training mixture is Uzbek-first and includes clean general assistant data,
89
+ translation, Uzbek language and literature, spelling and orthography, MMLU-style
90
+ tasks, classification, math, and English-retention examples. Training data is
91
+ not distributed in this model repository.
92
 
93
  ## Usage
94
 
 
102
  model = AutoModelForCausalLM.from_pretrained(
103
  model_id,
104
  dtype=torch.bfloat16,
105
+ device_map="cuda:0",
106
  )
107
 
108
  messages = [
 
113
  inputs = tokenizer.apply_chat_template(
114
  messages,
115
  add_generation_prompt=True,
116
+ enable_thinking=False,
117
  return_tensors="pt",
118
  return_dict=True,
119
  ).to(model.device)
 
122
  output = model.generate(**inputs, max_new_tokens=512, do_sample=False)
123
 
124
  reply = tokenizer.decode(
125
+ output[0][inputs["input_ids"].shape[-1]:],
126
+ skip_special_tokens=True,
127
  ).strip()
128
  print(reply)
129
  ```
130
 
131
+ The model emits `<|im_end|>` and the generation metadata registers both
132
+ `<|im_end|>` and `<|endoftext|>` as end-of-sequence tokens.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
  ### vLLM
135
 
136
  ```python
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)
144
 
145
  messages = [
146
  {"role": "system", "content": "Siz foydali AI yordamchisiz."},
147
+ {"role": "user", "content": "O'zbekiston haqida qisqacha ma'lumot bering."},
148
  ]
149
  print(llm.chat(messages, params)[0].outputs[0].text)
150
  ```
151
 
152
+ ## Notes and limitations
 
 
 
 
 
 
 
 
 
 
153
 
154
+ - Use a Transformers/vLLM release with Qwen3.5 support.
155
+ - Keep the hybrid Qwen3.5 model on one device unless the serving stack has been
156
+ validated for multi-device Gated-DeltaNet inference.
157
+ - TUMLU-Uzbek remains close to the 0.25 random baseline, so specialist factual
158
+ knowledge should be independently verified.
159
+ - The model may produce inaccurate, biased, or fabricated information and has
160
+ not been comprehensively evaluated for safety or high-stakes use.
config.json CHANGED
@@ -7,7 +7,10 @@
7
  "attn_output_gate": true,
8
  "bos_token_id": null,
9
  "dtype": "float32",
10
- "eos_token_id": 248044,
 
 
 
11
  "full_attention_interval": 4,
12
  "head_dim": 256,
13
  "hidden_act": "silu",
 
7
  "attn_output_gate": true,
8
  "bos_token_id": null,
9
  "dtype": "float32",
10
+ "eos_token_id": [
11
+ 248046,
12
+ 248044
13
+ ],
14
  "full_attention_interval": 4,
15
  "head_dim": 256,
16
  "hidden_act": "silu",
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d39d981c03f63bb711d44ab9a7fb963dc118f57eef0cc00bff9d39543e086f03
3
  size 4781022144
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b3667d6eb7841e22ebf2c8290e8fdf02c6cafdb9cb913c73d944abf31b2161a
3
  size 4781022144
tokenizer_config.json CHANGED
@@ -10,7 +10,7 @@
10
  "errors": "replace",
11
  "image_token": "<|image_pad|>",
12
  "is_local": true,
13
- "local_files_only": true,
14
  "model_max_length": 262144,
15
  "model_specific_special_tokens": {
16
  "audio_bos_token": "<|audio_start|>",
 
10
  "errors": "replace",
11
  "image_token": "<|image_pad|>",
12
  "is_local": true,
13
+ "local_files_only": false,
14
  "model_max_length": 262144,
15
  "model_specific_special_tokens": {
16
  "audio_bos_token": "<|audio_start|>",