SurgeFF commited on
Commit
932e6b2
·
verified ·
1 Parent(s): e00dabc

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +225 -0
README.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/gemma-4-12b-it
3
+ library_name: transformers
4
+ license: gemma
5
+ language:
6
+ - en
7
+ tags:
8
+ - gemma4
9
+ - gemma4_unified
10
+ - multimodal
11
+ - tool-use
12
+ - personal-assistant
13
+ - qlora
14
+ - merged
15
+ - star
16
+ - rejection-sampling
17
+ pipeline_tag: image-text-to-text
18
+ ---
19
+
20
+ # Aria V9.2
21
+
22
+ **`google/gemma-4-12b-it`** fine-tuned into **Aria** — a personal assistant tuned for
23
+ **tool calling**, **memory-aware behaviour**, a **stable unprompted identity**, and now
24
+ **measurably better math** — with vision intact.
25
+
26
+ Merged standalone weights at the repo root (`from_pretrained` just works), the LoRA under
27
+ `adapter/`, GGUF quants under `gguf/`. Trained on a single RTX 3090 (24 GB); every teacher used
28
+ to generate training data was open-weight, so the corpus is legally clean.
29
+
30
+ ---
31
+
32
+ ## What's new: math actually moved
33
+
34
+ Math had been **stuck at 89/100 across five consecutive checkpoints**. Two attempts to shift it
35
+ failed. V9.2 moves it — and the gain was **replicated on a second, disjoint held-out sample**
36
+ before this model was released.
37
+
38
+ | Capability | Aria V9.1 | **Aria V9.2** |
39
+ |---|---|---|
40
+ | Math — fixed 100-item held-out set | 89 / 100 | **91 / 100** |
41
+ | Math — **fresh disjoint 150-item set** | 87.3 % | **92.0 %** |
42
+ | Math — pooled over all 250 held-out problems | 88.0 % | **91.6 %** |
43
+ | Tool calling | 10 / 10 | **10 / 10** |
44
+ | Identity (system-prompted) | 10 / 10 | **10 / 10** |
45
+ | Identity (unprompted) | 4 / 8 | **4 / 8** |
46
+ | Memory behaviour | 17 / 20 | **18 / 20** |
47
+ | Multimodal (vision) | pass | **pass** |
48
+
49
+ Nothing regressed.
50
+
51
+ > **On that memory 17→18.** One case on a 20-item suite is noise and is **not** part of the claim.
52
+ > It is reported because it happened, not because it means anything.
53
+
54
+ ## Why the +2 wasn't trusted, and what was done about it
55
+
56
+ The first number was 91 vs 89 — a 2-point delta on 100 items, which is exactly the size of swing
57
+ this project has already been fooled by (a mid-run partial read of an earlier eval showed 91 % and
58
+ the final number landed on 89). Re-running the same eval would have proved nothing: the eval
59
+ serving path is **greedy** (`do_sample=False`), so identical inputs return byte-identical outputs.
60
+ A re-run is theatre, not evidence.
61
+
62
+ So a **confirmation set** was drawn: 150 GSM8K *test* problems, **disjoint from the 100-item eval
63
+ set** (disjointness asserted in code, not assumed), scored on both adapters back-to-back over the
64
+ same items. V9.2 led by **4.7 points — a larger gap than the original, in the same direction**.
65
+ Two independent samples agreeing is what turns a result into a finding.
66
+
67
+ ## How: STaR (rejection-sampling SFT)
68
+
69
+ The corpus is **the model's own correct reasoning**:
70
+
71
+ 1. Sample k=3 solutions at temperature 0.9 for 800 GSM8K **train** problems, from the V9.1 weights.
72
+ 2. Keep a trace **only if its final answer matches gold**.
73
+ 3. Fold the survivors into a single Stage-A training mix and train from base.
74
+
75
+ Result: **1,732 traces over 759 problems**, averaging 2.28 distinct solutions each.
76
+ Sampled pass@3 was **94.9 %** against greedy **88.6 %** — that ~6-point gap is the headroom STaR
77
+ is designed to harvest: problems the model *can* solve but doesn't do reliably in one shot.
78
+
79
+ **Data hygiene, verified programmatically before training:** zero overlap with the 100-item
80
+ held-out eval set, zero overlap with the *entire* GSM8K test split, every problem sourced from
81
+ train. If test had leaked, math would have jumped, the result would have looked like a triumph,
82
+ and every downstream number would have been worthless.
83
+
84
+ ### Why this worked when DPO didn't
85
+
86
+ An earlier attempt used DPO on preference pairs mined from GSM8K train. It **trained correctly** —
87
+ held-out preference accuracy 0.875, reward margins +0.72; it genuinely learned to rank the right
88
+ answer above its own wrong one — and produced a **clean null**: every capability score came back
89
+ identical.
90
+
91
+ The likely reason is a **style confound**. "Chosen" was terse human gold rationale, stylistically
92
+ nothing like the model's own verbose reasoning, so what was rewarded and what was produced were
93
+ different objects; it plausibly learned *"prefer terse gold-style text"* rather than *"reason
94
+ correctly."* STaR removes that confound entirely — same voice, same format, correct reasoning.
95
+ **The mechanism was the difference, not the effort.**
96
+
97
+ ### Data mix (single stage)
98
+
99
+ | Source | Rows | Purpose |
100
+ |---|---|---|
101
+ | `tools.jsonl` | 4,000 | tool-calling behaviour |
102
+ | `memory.jsonl` | 1,915 | memory-aware behaviour |
103
+ | `identity.jsonl` ×2 | 2,000 | unprompted identity — trained jointly, never as a repair pass |
104
+ | `curiosity.jsonl` | 800 | disposition |
105
+ | **`star_math.jsonl`** | **1,804** | **her own verified-correct GSM8K solutions** |
106
+ | multimodal floor | 3,000 | prevents vision degradation |
107
+ | replay pool | 1,600 | general-capability retention |
108
+ | **Total** | **14,664 train / 453 eval** | |
109
+
110
+ ```python
111
+ r = 32, lora_alpha = 32, lora_dropout = 0.0, bias = "none"
112
+ target_modules = ["q_proj","k_proj","v_proj","o_proj",
113
+ "gate_proj","up_proj","down_proj",
114
+ "lm_head","embed_tokens"]
115
+ finetune_vision_layers = True # encoder-free: shared weights must stay trainable
116
+ epochs 2 · effective batch 16 · lr 1e-4 cosine · 1,834 steps · train_loss 0.5679
117
+ ```
118
+
119
+ Train loss came out at **0.5679 against V9.1's 0.572** — near-identical, which matters: it means
120
+ the model was *not* simply memorising its own easy output.
121
+
122
+ `gemma-4` is `gemma4_unified`, an **encoder-free multimodal** model where vision, audio and text
123
+ share weights. There is no vision tower to freeze, so the multimodal floor is load-bearing.
124
+
125
+ ## Identity, and a rule worth stating
126
+
127
+ V8 shipped unable to name itself unprompted — asked "who made you?" with no system prompt it said
128
+ *"I am Gemma 4, developed by Google DeepMind."* Its identity eval scored 9/10 because that eval
129
+ supplied the answer in the system prompt. **An identity eval that tells the model the answer
130
+ measures nothing.**
131
+
132
+ Two attempts to repair this on the finished adapter both failed, costing 6–8 points of math each
133
+ time. The fix was to train identity **jointly in the first pass** (V9.1), which cost nothing.
134
+ A separate composable identity adapter was also built and **rejected** — it halved unprompted
135
+ identity, because the `lm_head`/`embed_tokens` exclusion that made it safe also made it unable to
136
+ change what the model says it is.
137
+
138
+ **The rule: identity goes in the first pass, or not at all.**
139
+
140
+ ## Usage
141
+
142
+ > **Requires `transformers` 5.15.0.dev0 (from source).** Stock `transformers` <= 5.5.0 cannot load
143
+ > `gemma4_unified`.
144
+
145
+ ```python
146
+ import transformers.integrations.heterogeneity.configuration_utils as het
147
+
148
+ # gemma4_unified has a HETEROGENEOUS per-layer config; reading a global attr that
149
+ # varies per layer raises AmbiguousGlobalPerLayerAttributeError. Install this shim
150
+ # BEFORE loading, or most loaders will fail.
151
+ _HCM, _Err = het.HeterogeneousConfigMixin, het.AmbiguousGlobalPerLayerAttributeError
152
+ _orig = _HCM.__getattribute__
153
+ def _permissive(self, key):
154
+ try:
155
+ return _orig(self, key)
156
+ except _Err:
157
+ self.__dict__["allow_global_per_layer_attribute_access"] = True
158
+ return _orig(self, key)
159
+ _HCM.__getattribute__ = _permissive
160
+
161
+ from transformers import AutoProcessor, AutoModelForCausalLM
162
+
163
+ model = AutoModelForCausalLM.from_pretrained("SurgeFF/AriaV9.2", device_map="auto")
164
+ processor = AutoProcessor.from_pretrained("SurgeFF/AriaV9.2")
165
+ ```
166
+
167
+ GGUF: `gguf/` holds `Q8_0`, `Q6_K`, `Q5_K_M`, `Q4_K_M`, `Q4_0` plus **`AriaV92-mmproj-F16.gguf`,
168
+ which is required for vision** — without it the GGUF is text-only. The full-precision F16 text
169
+ GGUF is deliberately not shipped (same precision as the root safetensors; it would double the repo
170
+ for no benefit).
171
+
172
+ Tool calls use the trained convention:
173
+
174
+ ```
175
+ <tool_call>{"name": "recall", "arguments": {"query": "..."}}</tool_call>
176
+ ```
177
+
178
+ ## Limitations
179
+
180
+ - **Unprompted identity is 4/8.** Asked cold, with no system prompt and no memory, she still fails
181
+ to name herself about half the time. A system prompt or memory layer covers this in practice —
182
+ but those *mask* the gap rather than close it.
183
+ - **Math is ~92 % on GSM8K-style problems.** Not evaluated on MATH, competition problems, or long
184
+ symbolic derivation. The remaining errors are decode-time reliability, not missing knowledge:
185
+ sampled pass@3 (94.9 %) still exceeds greedy accuracy.
186
+ - **Not a general-purpose assistant release.** Tuned for one person's fleet, tools and conventions.
187
+ - **Memory behaviour is not a memory system.** The model is trained to *behave* correctly around
188
+ memory; it has none of its own. You supply the tools and the store.
189
+ - **Tool schema is specific** to five tools (`remember`, `recall`, `exec`, `web_search`,
190
+ `send_message`). Generalisation to arbitrary schemas is untested.
191
+ - **Vision is verified, not optimised.** The multimodal floor prevents regression; the eval is a
192
+ smoke test, not a VQA benchmark.
193
+
194
+ ## Things that did not work
195
+
196
+ Recorded because negative results are the useful part. All were fully trained, evaluated, and
197
+ declined under a promotion rule fixed *before* the numbers were seen.
198
+
199
+ | Experiment | Result | Decision |
200
+ |---|---|---|
201
+ | Stage B (integration) | memory +1, **math 89→84** | rejected |
202
+ | Memory top-up | memory 17→18 (noise), **math 89→85** | rejected |
203
+ | Math DPO | **identical on every capability** despite pref-acc 0.875 | rejected — null |
204
+ | Identity repair pass ×2 | identity_bare 0→5/8 and 0→4/8, but **math 89→83 / 89→81** | rejected |
205
+ | Layer-2 identity adapter | **identity_bare 4/8→2/8** | rejected |
206
+ | **STaR math (this release)** | **math 89→91, replicated 87.3 %→92.0 % on fresh data** | **promoted** |
207
+
208
+ Six rejections, one promotion. The rejections are why the promotion means something.
209
+
210
+ ## License
211
+
212
+ Derived from `google/gemma-4-12b-it`, governed by the
213
+ **[Gemma Terms of Use](https://ai.google.dev/gemma/terms)**. Training data was generated
214
+ exclusively with open-weight teacher models.
215
+
216
+ ## Citation
217
+
218
+ ```bibtex
219
+ @misc{aria-v92,
220
+ title = {Aria V9.2: STaR-improved math on a tool-using, memory-aware Gemma-4-12B assistant},
221
+ author = {Williams, Sergio},
222
+ year = {2026},
223
+ url = {https://huggingface.co/SurgeFF/AriaV9.2}
224
+ }
225
+ ```