Labs

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

Model
Qwen3.5-0.8B
Hardware
RTX 4090, RTX 5090, RTX PRO 6000 or H100
Start lab

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

OriginalEdited
93%
33.1%
7.9%
48.1%
13.8%
67.1%
21%
62.3%

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

TODO 4 · Edit the weights
@torch.no_grad()def subtract_direction(W0, u, columns, alpha=6.0):    writes = u @ W0    mask = torch.zeros_like(writes)    mask[columns] = 1.0    return 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

  1. 1Measure the loops
  2. 2Write a loop detector
  3. 3Find the loop direction
  4. 4Edit the weights
  5. 5Measure again