Qwen3.5-0.8B-WSP-repro (data-driven direction patch, Astra-style)
Independent, method-level reproduction of the direction-subtraction weight-space patch described in "Sparks of Weight-Space Programming" (MIT CSAIL blog, 2026-11-02, https://rikiyat.github.io/blog/weight-space-programming/), applied to Qwen3.5-0.8B and its thinking-mode repetition-loop pathology.
No gradients, no training. Total edited weights: 131,072 (0.016% of the model).
Method (3 stages, all data-driven)
- Localize. Generate 14 diagnostic solutions (6 GSM8K + 8 held-out MATH-500),
capture every layer's MLP
down_projoutput per token, label tokens inside cyclic tails / >=3x-repeated 12-grams as repeated (16,725 tokens) vs normal, and rank layers by the signal ratio||mean(rep) - mean(nor)|| / typical ||out||. Top-2 on this model: layers 15 and 19 — the same layers the blog's GPT-6 Astra optimizer picked. (Next: L10 0.421, L11 0.384, ... L15/L19 carry the largest||d||of all 24 layers.) - Select. Per patched layer, score each of the 3,584 columns by attribution
|Δa_i · (W[:,i]·u)|(activation shift × write alignment) and keep the top-64. - Edit. Measure the data polarity, then apply a rank-1, loop-gated corrective
write on the selected columns:
W[:,j] <- W[:,j] - beta * da_j * u, beta=0.3, whereuis the unit repetition direction (meandown_projoutput diff, repeated minus normal) anddathe matching input-activation diff. The gated write fires ~2-4x stronger on repeated-token states than on normal states (measured selectivity), pushing loop states back toward the normal regime.
The blog-literal operator (W[:,j] -= beta*(u.W[:,j])*u, i.e. subtracting each
column's u-component) was also swept — beta in {0.3, 0.5, 0.7, 1.0, 1.5}, on both
the data-driven layers (10, 11) and (15, 19): it never broke a dev loop. Sweep
records are in results/sweep2_*.json; the operator line above is the one that
produced the shipped weights.
Results
24 held-out MATH-500 problems (seed 42, levels 1-3 x 8), greedy, thinking mode. Paired fresh-box runs on the same GPU (fp16):
| metric | base @4096 | patched @4096 | base @32768 | patched @32768 |
|---|---|---|---|---|
| repetition-loop rate | 95.8% | 91.7% | 95.8% | 87.5% |
| closed think block | 4.2% | 4.2% | 4.2% | 8.3% |
| accuracy | 4.2% | 4.2% | 4.2% | 8.3% |
| truncation @ budget | - | - | 95.8% | 91.7% |
Numerical-path sensitivity (bf16 / HF eager, same 24 problems @4096): base loop 95.8%, closed 0%, accuracy 0% -> patched loop 91.7%, closed 8.3%, accuracy 8.3%. The two patched conversions (m04, m07) close and grade correct under both fp16 (vLLM @32k, HF @4k) and bf16 — the effect is not a numerical-path artifact, unlike the base model's own fragile closer (m01), which only closes on the fp16 path and flips back under the patch.
At the 32,768-token budget (vLLM fp16) the patch doubles accuracy (2/24 vs 1/24) and converts two chronic loopers into fast, correct solvers:
- m04: base loops the full 32,768 tokens -> patched closes at 1,308 tokens, correct.
- m07: base loops the full 32,768 tokens -> patched closes at 1,385 tokens, correct (the same closed + correct conversion already visible at the 4,096 budget).
- m03: base loops -> patched stops cycling (meanders arithmetically, no closure).
- The base model's single fragile closer (m01, 1,114 tokens) flips back to looping under the patch — consistent with its known numerical-path fragility.
This is the same qualitative effect the original reports (fewer generations stuck at the token cap; conversions, not inheritances), at much smaller scale: we did not reproduce the original's 6x MATH-500 jump (48.1% vs our 8.3%). The differences we can enumerate: (a) our optimizer is a fixed statistical pipeline, theirs an interactive frontier LLM with 50 forward-call iterations; (b) different base model family; (c) 24-problem eval vs their 96/500-problem suites. We release the negative space as well — all sweeps, the operator study, and both eval budgets.
Files
- model weights (patched, fp16 safetensors) — usable directly with transformers/vLLM
wsp_weight_patch_subda_b0.3.npz— the patch recipe: repetition directionsu_L15/u_L19, column indicesindices_L15/L19, gate vectorsda_L15/L19, beta. Applying it to the official checkpoint reproduces the shipped weights exactly:W[:, indices] -= beta * da[indices] * uper layer.results/— paired eval JSONs (4,096 + 32,768 budgets), all-layer direction scan, attribution extraction, 8 operator/beta sweepscode/— the full pipeline (wsp2.py: fetch -> diagall -> extract -> sweep -> eval -> export -> publish) and the 32k vLLM evaluator
Caveats
- Research artifact reproducing a method, not the original model. Not affiliated with MIT CSAIL, OpenAI or Alibaba/Qwen. Base model (c) Qwen team, Apache-2.0.
- Numbers are our own paired runs; single seed (greedy decoding), one GPU (T4).
- The patch targets the repetition behaviour it was built from; guard generations (chat intro) remain coherent in all sweeps. General capability beyond the eval suite was not audited.