Neuron surgery

Grafting 1.9% of Qwen3.8-27B into a frozen Qwen3.5-4B lifts its exact-math score to 90% of the 27B’s

Qwen3.5-4B solves 40.3% of 320 hard exact-math problems, such as multiplying long numbers or working out a determinant. Qwen3.8-27B, 6.4 times larger, solves 71.9%.

We copied five columns of math neurons out of the 27B: 16,000 MLP neurons that run through all 64 of its layers, with one attention head from each of 32 of its layers and a low-rank slice of its output layer. That is 515,660,896 parameters, 1.9% of the 27B. Both models stay frozen, and only the connections between them are trained. The grafted 4B solves 65.0% of the problems: 161% of its own score and 90% of the 27B’s.

A switch at layer 10 of the 4B sends math through the graft and nothing else. It opened on all 570 math test prompts and on none of 1,164 others, so everything else the 4B says comes from the 4B alone.

Grafting the 27B’s math columns into the 4B (1 min 3 s).

Linking neurons only when the link runs both ways finds columns through the whole model

The Encyclopedia of LLM homologies places every MLP neuron of a model by the neurons it fires with. Its groups were built from each neuron’s 30 most correlated partners. In Qwen3.5-4B most of those links run one way: many neurons list the same few hub neurons, which do not list them back, so groups formed around hubs.

The new grouping keeps a link only when each neuron is among the other’s 30 closest partners, and only between neurons in different layers. Leiden community detection on what remains finds groups that run up through many layers, which we call columns. In the 4B, where the circuit that adds numbers is known, the columns are more than twice as modular as the old groups (0.32 to 0.77), two neurons in one column are 59 times likelier than chance to be wired to each other directly (36 times before), and the three largest columns hold 79% of the addition circuit (68% before). The cost is coverage: 55% of neurons have a partner that lists them back.

In the 27B the same grouping finds 18 columns that span at least 16 layers and put at least 42% of their activity on math text. We took the five with the highest share, 52% to 64%, whole except the last, for 16,000 neurons. All five run through all 64 layers.

Qwen3.8-27B’s neurons with the five math columns lit, and the columns as five upright bundles beside the 4B
Left, Qwen3.8-27B’s MLP neurons, each placed by the neurons it fires with, with the five columns lit in their own colours. Right, the same 16,000 neurons as the graft wires them into the 4B: one upright bundle for each column, each neuron at the height of its layer, layer 0 at the bottom. The last column is taken only in part, from layer 7 up.

The columns beat spending the same budget on the 4B and a graft of shuffled weights

Exact math, 320 problems: share solved. The thin lines mark the 4B alone (40.3%) and the 27B (71.9%).
Qwen3.5-4B alone 40.3%frozen, nothing added
The same trainable budget spent on the 4B itself 45.9%114% of the 4B, 64% of the 27B · 13,236,545 trained
Graft of the previous grouping’s neurons, weights shuffled 60.0%149% of the 4B, 83% of the 27B · 13,287,811 trained
Graft of the previous grouping’s neurons 62.2%154% of the 4B, 87% of the 27B · 13,287,811 trained
Graft of the five columns 65.0%161% of the 4B, 90% of the 27B · 13,287,811 trained
Qwen3.8-27B 71.9%the donor, 178% of the 4B

Spending the same 13,236,545 trainable parameters on the 4B itself, as a low-rank adapter behind the same switch, reaches 45.9%. Most of what a graft gives comes from the added room and from training against the 27B: the previous grouping’s 16,000 neurons (Tube and Ring, from the grafting paper) with their weights shuffled still reach 60.0%.

The real columns reach 65.0%, 5.0 points above the shuffled graft: they solve 35 problems it misses and miss 19 it solves (McNemar p = 0.04). The previous grouping’s real neurons reach 62.2%, which does not beat their own shuffled twin by a significant margin (p = 0.40).

The graft helps most where the 27B is strongest

Exact math by type of problem, 40 problems each
Qwen3.5-4BShuffled graftQwen3.8-27BGraft of the columns
Multiplication
45% → 95%
Multiplication, harder
28% → 78%
Determinants
45% → 90%
Polynomials
65% → 90%
Polynomials, harder
40% → 60%
Linear systems
30% → 38%
Fractions
45% → 45%
Greatest common divisors
25% → 25%
0%50%100%

Multiplication goes from 45% to 95%, level with the 27B, and determinants from 45% to 90%. Fractions and greatest common divisors do not move, and the 27B is weak at them too. On GSM8K word problems the graft changes nothing: 88.0% against the 4B’s 88.4%, where the 27B scores 95.2%.

How the graft is built

Replacing a group shows that neurons carry a skill

A graft adds parts beside a working model. The cleaner test of whether a group of neurons carries a skill is to remove it and put another model’s group in its place. Lesioning Qwen3.5-4B’s calculation group, 6,857 neurons, takes its GSM8K accuracy from 89.6% to 4.8%. Qwen3.5-9B’s matching group of 8,713 neurons in its place, with 445,490 parameters trained (0.011% of the 4B), brings it back to 84.0%: 94% of the 4B’s own score and 89% of the 9B’s.

Here the donor’s own weights matter far more than in the graft. With the 9B’s weights shuffled, the same surgery with almost twice as many trained parameters reaches 37.6% (119 problems gained against 3 lost, p = 0.0 × 100). Between Qwen3.5-4B and Qwen3.5-2B, trained separately, the 4B’s group restores the lesioned 2B to 41.2% of an intact 70.0%, against 15.6% shuffled.

Replacing calculation neurons in Qwen3.5-4B and Qwen3.5-2B (1 min 31 s). Original post on X.
The 4B’s own group
GSM8K 89.6%The 4B’s own group
The group lesioned
GSM8K 4.8%The group lesioned
The 9B’s group in its place, nothing trained
GSM8K 53.6%The 9B’s group in its place, nothing trained
The connections out of it trained (the light rim)
GSM8K 84.0%The connections out of it trained (the light rim)
9B’s calculation group in Qwen3.5-4B: GSM8K, 250 problems
Intact modelno surgery
89.6%
Group lesionednothing trained
4.8%
Donor’s group, fitted maps onlynothing trained
53.6%
+ a gain and a threshold per neuron17,458 trained
70.8%
+ rank-16 correction to the write map124,466 trained
80.8%
+ rank-64 correction to the write map445,490 trained
84.0%
+ rank-64 correction to the read map873,522 trained
82.4%
Control: the donor’s weights shuffled873,522 trained
37.6%
Control: a prose group of the donor873,522 trained
33.6%
4B’s calculation group in Qwen3.5-2B: GSM8K, 250 problems
Intact modelno surgery
70.0%
Group lesionednothing trained
1.6%
Donor’s group, fitted maps onlynothing trained
2.0%
+ a gain and a threshold per neuron13,746 trained
10.0%
+ rank-16 correction to the write map87,986 trained
34.4%
+ rank-64 correction to the write map310,706 trained
36.0%
+ rank-64 correction to the read map607,666 trained
41.2%
Control: the donor’s weights shuffled607,666 trained
15.6%
Control: a prose group of the donor607,666 trained
15.6%

In the replacement the donor’s group runs inside the host with its own weights. At each layer a fitted linear map takes the host’s residual stream into the donor’s coordinates, the donor’s neurons fire, and a second map writes their output back; what the group writes for itself stays in a private stream, so its internal wiring is exactly the donor’s. Only the way out is trained, against the intact host’s next-token distribution.

What the result covers

Closest published work

Model stitching joins the early layers of one network to the late layers of another through a fitted map (Lenc and Vedaldi, 2015; Bansal, Nakkiran and Barak, 2021). Chen, Merullo, Stolfo and Pavlick (2025) fit affine maps between the residual streams of language models of one family and carry sparse autoencoders, probes and steering vectors across them. CALM (Bansal et al., 2024) joins two whole models with trained cross-attention. Neuron transplantation (Öz et al., 2024) fuses models of one architecture by moving their largest neurons and fine-tuning the result.

The graft here copies a set of neurons and heads that runs through every layer of a model 6.4 times larger, runs it beside a frozen smaller model, and keeps it out of everything but math.

GPU time

The graft, its preparation and its four arms took 2.7 H100-hours and 1.0 B200-hours. The replacement runs took 3.6 H100-hours.