ManniX-ITA commited on
Commit
9ec0ce0
·
verified ·
1 Parent(s): cc4c7ed

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +187 -0
README.md ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Qwen/Qwen3.5-4B
3
+ license: apache-2.0
4
+ library_name: transformers
5
+ tags:
6
+ - qwen3.5
7
+ - merge
8
+ - omnimerge
9
+ - task-arithmetic
10
+ - code
11
+ ---
12
+
13
+ # Qwen3.5-4B-MicroCoder
14
+
15
+ A 4B-parameter code-leaning merge of Qwen3.5-4B that beats every individual
16
+ source on LCB-medium-55, while preserving full GSM8K parity with the strongest
17
+ reasoning fine-tune in the pool.
18
+
19
+ This card documents `Qwen3.5-4B-MicroCoder` (internally `v2i-jv-base-task-arith`),
20
+ the chosen frontier point of a 19-variant ablation that swept merge methods,
21
+ density, importance signals, AIME-protection masks, and skip-layer surgery.
22
+
23
+ Built with [**OmniMergeKit**](https://github.com/mann1x/omnimergekit) — the
24
+ open-source merge engine developed for this work.
25
+
26
+ ## Headline numbers (Q6_K, greedy)
27
+
28
+ | Benchmark | base Qwen3.5-4B | jackrong-v2 (best source) | **MicroCoder** | Δ vs source |
29
+ |---|---:|---:|---:|---:|
30
+ | HumanEval (164q) | 60.37 | 60.37 | **57.32** | −3.05 |
31
+ | MBPP (500q) | 46.00 | 45.00 | **52.00** | **+7.00** |
32
+ | LiveCodeBench-30 (medium, post-2024-10-01) | 3.33 | 23.33 | **26.67** | **+3.34** |
33
+ | LiveCodeBench-55 (full medium pool) | — | 25.45 | **27.27** | **+1.82** |
34
+ | HumanEvalPlus (164q) | — | 54.88 | 50.00 | −4.88 |
35
+ | GSM8K (100q) | — | 83.00 | **83.00** | 0.00 |
36
+ | MMLU-Pro (200q) | — | 56.81 | 52.46 | −4.35 |
37
+ | AIME (30q) | — | 26.67 | 3.33 | −23.34 |
38
+
39
+ **Net:** +7pp MBPP, +3.3pp LCB-30, +1.8pp LCB-55, GSM8K parity. Trade-offs are
40
+ HumanEval (−3pp), MMLU-Pro (−4.4pp), and the AIME math-reasoning floor
41
+ (see "Why no AIME?" below).
42
+
43
+ ## Recipe
44
+
45
+ ```bash
46
+ python omnimergekit.py \
47
+ --base Jackrong/Qwen3.5-4B-Claude-4.6-Opus-Reasoning-Distilled-v2 \
48
+ --task-base Qwen/Qwen3.5-4B \
49
+ --source coder_eval/continuum-code-forged \
50
+ --source coder_eval/jackrong-python \
51
+ --method omnimerge_v2 --v2-features fisher,darex \
52
+ --weights 0.55,0.45 --density 0.53 --darex-q 0.85 \
53
+ --fisher continuum-forged.safetensors,jackrong-python.safetensors \
54
+ --pr682-turbo \
55
+ --seed 42 --device cuda
56
+ ```
57
+
58
+ This is a **task-arithmetic** merge:
59
+
60
+ ```
61
+ MicroCoder = jackrong-v2 + 0.55·DARE(continuum-code-forged − base) + 0.45·DARE(jackrong-python − base)
62
+ ```
63
+
64
+ - **`jackrong-v2` is the merge base** — its full output style and reasoning
65
+ policy survive intact at zero deltas. The two coding teachers contribute
66
+ only their *delta from the official Qwen3.5-4B base*, not their absolute
67
+ representations. This isolates "what the coder fine-tunes added on top of
68
+ the public base" and grafts that onto the reasoning-distilled model.
69
+ - **DAREx-q 0.85** drops the bottom 85% of cf/jp deltas by magnitude
70
+ (per-tensor quantile) before random pruning, then rescales by 1/density.
71
+ This kills low-magnitude noise while preserving the high-amplitude
72
+ code-skill structure.
73
+ - **Fisher importance** from forward-pass gradient maps over the coder
74
+ fine-tunes' own training-style data weights the EMR election so dominant
75
+ per-element directions win when the two coding teachers disagree.
76
+ - **PR682-turbo** protects critical layers (norms, embeddings, lm_head,
77
+ biases) at density 1.0 and falls back gracefully on shape mismatch.
78
+
79
+ ## Sources
80
+
81
+ | Model | Role | Weight |
82
+ |---|---|---:|
83
+ | [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) | task base (delta reference) | — |
84
+ | [`Jackrong/Qwen3.5-4B-Claude-4.6-Opus-Reasoning-Distilled-v2`](https://huggingface.co/Jackrong/Qwen3.5-4B-Claude-4.6-Opus-Reasoning-Distilled-v2) | merge base | 1.0 (passthrough at δ=0) |
85
+ | `continuum-code-forged` | code teacher (delta) | 0.55 |
86
+ | `jackrong-python` | code teacher (delta) | 0.45 |
87
+
88
+ ## Evaluation methodology
89
+
90
+ All evaluations: [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness),
91
+ llama.cpp `llama-server` with the published Q6_K quantization,
92
+ `/v1/completions` raw endpoint, greedy decoding (`temperature=0.0,
93
+ top_p=1.0`), `max_gen_toks=2048` for HE/MBPP, `max_gen_toks=8192` for LCB,
94
+ `--parallel 2 --cache-type-k q8_0 --cache-type-v q8_0`.
95
+
96
+ LiveCodeBench: medium-difficulty functional problems with
97
+ `min_date=2024-10-01` (post-Qwen3.5 training cutoff to avoid contamination).
98
+ LCB-30 = first 30 problems of that pool, LCB-55 = full pool of 55.
99
+
100
+ ## Experiment trail (why this recipe?)
101
+
102
+ 19 variants were ablated over a multi-week sweep. Summary table for the
103
+ informative subset:
104
+
105
+ | variant | merge form | AIME | HE | MBPP | LCB-30 | verdict |
106
+ |---|---|---:|---:|---:|---:|---|
107
+ | base | Qwen3.5-4B | 0.00 | 60.4 | 46.0 | 3.33 | floor |
108
+ | jackrong-v2 | source | **26.67** | 60.4 | 45.0 | 23.3 | strong reasoning, weak LCB |
109
+ | v2g | 3-src DARE-TIES, fisher+darex | 0.00 | 56.1 | **54.0** | 26.7 | code champion (no AIME) |
110
+ | **v2i = MicroCoder** | task-arith on jv-base | 3.33 | **57.3** | 52.0 | **26.7** | **balanced — picked** |
111
+ | v2j | v2i + skip mlp.gate_proj 18-25, darex 0.92 | 10.00 | — | — | — | first AIME signal |
112
+ | v2k | v2j + wider skip 14-27 | 0.00 | — | — | — | over-blocked, collapsed |
113
+ | v2l | v2j + full MLP skip 18-25 | 3.33 | — | — | — | up/down_proj carry code skill |
114
+ | v2m | v2j + density 0.45 | 3.33 | — | — | — | lower density hits jv harder |
115
+ | v2n | v2j + darex 0.95 | **13.33** | 55.5 | 50.8 | 20.0 | reasoning ceiling |
116
+ | v2o | v2n + darex 0.97 | 13.33 | 56.7 | 51.0 | 16.7 | saturated |
117
+ | v2p | v2n + jv-AIME fisher mask α=1.0 | 13.33 | 55.5 | 50.8 | 20.0 | mask redundant |
118
+ | v2q | v2n + jv-AIME mask α=0.5 | 13.33 | 54.9 | 51.2 | 20.0 | mask redundant |
119
+ | v2r | mask α=1.0 alone, no skip | 3.33 | — | — | — | per-element scaling cannot replace layer skip |
120
+
121
+ ### Key findings (apply to future merge work)
122
+
123
+ 1. **Task-arithmetic with the strong source as merge_base wins over symmetric
124
+ DARE-TIES** when one source is much stronger on the target axis (here:
125
+ reasoning). v2g and v2i tie on LCB-55 (27.27%) but v2i wins HE/HE+/GSM8K
126
+ and retains a small AIME signal that pure DARE-TIES kills.
127
+
128
+ 2. **Skip mlp.gate_proj layers 18-25 is the load-bearing AIME-recovery knob**
129
+ (+6.7pp). This maps from Qwen3.6's think-policy band 27-52/64 → 32-layer
130
+ Qwen3.5 = 14-26 conservative narrow 18-25. Wider bands (v2k 14-27)
131
+ collapse; full-MLP skip (v2l) destroys code skill.
132
+
133
+ 3. **DAREx-q 0.92 → 0.95 adds 3.3pp AIME on top of the skip** by killing more
134
+ low-magnitude cf/jp deltas in the protected reasoning band. **0.95 → 0.97
135
+ saturates** (v2n=v2o on AIME).
136
+
137
+ 4. **The jv-AIME fisher suppression mask is fully redundant with skip-layers**
138
+ (v2n=v2p=v2q at AIME 13.33 *and* code metrics within noise). Per-element
139
+ scaling cannot substitute for layer-level passthrough — jv's reasoning
140
+ lives in the *coherent per-layer behavior* of mlp.gate_proj 18-25, not in
141
+ the highest-importance individual cells. Mask alone (v2r) gives nothing.
142
+
143
+ 5. **The 13.33% AIME ceiling is structural, not a tuning problem.** Three
144
+ different mechanisms (high darex, higher darex, mask) all converge at
145
+ the same number. Closing the remaining 13.34pp gap to jv source requires
146
+ SFT distillation, not more merge tuning.
147
+
148
+ ### Why no AIME on the chosen variant?
149
+
150
+ MicroCoder (v2i) is the **code-leaning frontier point**. The skip-layer
151
+ recipe (v2n) recovers AIME to 13.33% but at a 6.7pp LCB-30 regression.
152
+ v2i preserves the better LCB; the trade is real and structural. A
153
+ reasoning-leaning sibling exists internally (v2n) but is not published —
154
+ LCB regression makes it strictly worse than `jackrong-v2` for math users
155
+ who already have access to the original.
156
+
157
+ ## Files
158
+
159
+ - Full-precision safetensors weights (BF16). Use [`ManniX-ITA/Qwen3.5-4B-MicroCoder-GGUF`](https://huggingface.co/ManniX-ITA/Qwen3.5-4B-MicroCoder) for the Q6_K quantization.
160
+
161
+ ## Use
162
+
163
+ ```bash
164
+ llama-server -m Qwen3.5-4B-MicroCoder-Q6_K.gguf \
165
+ --port 8099 -c 32768 -t 12 -ngl 99 \
166
+ --parallel 2 --cache-type-k q8_0 --cache-type-v q8_0
167
+ ```
168
+
169
+ Greedy `temperature=0.0, top_p=1.0` recommended for code tasks.
170
+
171
+ ## Citation
172
+
173
+ If you use this model or the OmniMergeKit recipes in your work:
174
+
175
+ ```
176
+ @misc{mannix2026microcoder,
177
+ title = {Qwen3.5-4B-MicroCoder: a task-arithmetic merge for code},
178
+ author = {Mannix, F.},
179
+ year = {2026},
180
+ url = {https://huggingface.co/ManniX-ITA/Qwen3.5-4B-MicroCoder},
181
+ note = {Built with OmniMergeKit, https://github.com/mann1x/omnimergekit}
182
+ }
183
+ ```
184
+
185
+ ## License
186
+
187
+ Apache 2.0, inherited from Qwen3.5-4B and the source fine-tunes.