Weight-Space Programming
Fix Qwen3.5-0.8B's reasoning loops by editing 0.016% of its weights, with no training.
0.016%
of weights edited
93% → 33%
MATH-500 answers cut off
7.9% → 48.1%
MATH-500
0
training steps
What the researchers did
Researchers at MIT CSAIL gave a frontier model the raw weights of a small language model and asked it to make the model better at math. Nothing was trained. The model read the weights, worked out what was going wrong, and changed a small number of them directly.
The small model was Qwen3.5-0.8B. With thinking turned on, it usually gets stuck repeating itself, so 93% of its MATH-500 answers ran into the 32,768-token limit. The edit found the direction the loops push the hidden state in, after layers 15 and 19. In each of those layers it took the 64 MLP output columns that write most along that direction and subtracted six times their part along it, 131,072 weights in all.
What changed after the edit
Before and after the edit
Cut off (MATH-500)
MATH-500
GSM8K
IFEval
Reported by the authors on the full benchmarks, after 50 test runs of the model during the edit. The lab runs a smaller version on fewer problems.
A look inside the notebook
@torch.no_grad()def subtract_direction(W0, u, columns, alpha=6.0):writes = u @ W0mask = torch.zeros_like(writes)mask[columns] = 1.0return W0 - alpha * torch.outer(u, writes * mask)for layer in (15, 19):W0 = layers[layer].mlp.down_proj.weight.float()W = subtract_direction(W0, u[layer], top64[layer])print(f"{changed:,} weights changed ({changed / 0.8e9:.3%})")# 131,072 weights changed (0.016%)
What you will do
- 1Measure the loops
- 2Write a loop detector
- 3Find the loop direction
- 4Edit the weights
- 5Measure again
