Back to blog
ResearchModels

Simple Attention Networks: What a Transformer Loses Without Feed-Forward Layers

We deleted the feed-forward network from a transformer and measured what was actually lost, under controls for parameters, compute and depth. At matched parameters the answer is 0.006 nats, and all of it lives on tokens with nothing to look up.

HN

Henry Ndubuaku

||11 min read

The feed-forward network holds two thirds of a transformer's non-embedding parameters. A decade of interpretability work says those layers are the model's memory: key-value stores over training facts, the place where editable associations live. Nobody had run the converse experiment, delete them and measure what is lost, with the confounds controlled. We did, and Needle 2 and Needle 3 are built on the answer. The paper is A Controlled Study of Attention-Only Transformers; this post is the intuition.

The block

A Simple Attention Network, SAN, is a decoder transformer with the feed-forward sublayer removed from every block. Everything else is standard: pre-norm, grouped-query attention, rotary positions, a scalar gate on the residual write, tied embeddings. The control arm is the same code with a SwiGLU feed-forward network put back after attention.

Standard transformer20L · 87M paramsresidual streamAttentionZCN · GQA 8q/4kv · QK-norm · RoPEσ(g) · Wogated write into the streamFeed-forwardSwiGLU · 4d wide · 2/3 of parametersσ(g₂) · Wdownsecond write path× L layers · tied embeddings · final ZCNSimple Attention Network20L · 24M params · same depthresidual streamAttentionZCN · GQA 8q/4kv · QK-norm · RoPEσ(g) · Wogated write into the streamno feed-forwardthe whole manipulation× L layers · tied embeddings · final ZCN
A SAN block is a pre-norm attention block with the feed-forward sublayer deleted, nothing else. The only per-position nonlinearities left are the softmax and the normalisations.

Removing the feed-forward layer removes the only learned per-position feature map. What remains nonlinear is the attention softmax and the normalisations, and that has a consequence you can state exactly: for a fixed attention pattern, a SAN layer is linear in its inputs, and each head's update at a position lies inside the convex hull of the value vectors of the positions it attends to. A SAN layer selects and transports content that is present in context. It cannot synthesise a representation the context does not support. That is the precise sense in which the model is context-grounded, and every result below is a measurement of what that restriction costs.

Three ways to ask the question

Deleting the FFN perturbs three things at once: parameter count, compute per token, and the number of nonlinear composition steps. Fix any one axis and the comparison is confounded on the other two, so we ran it three times.

ArmConfigurationTotal paramsNon-embeddingGFLOPs / token
SAN20 layers, d=512, no FFN24.13M15.74M~0.40
FFN, matched parameters4 layers, d=512, FFN 204824.12M15.73M~0.20
FFN, matched FLOPs9 layers, d=512, FFN 204843M35M~0.39
FFN, matched depth20 layers, d=512, FFN 204887.06M78.67M~0.72

Every arm got its own learning-rate sweep, with a boundary rule that extends the sweep whenever the edge wins, so no architecture competes at another's preferred rate. That mattered: the optimal Muon rate differs by 2x between the arms, and a shared rate silently biases the whole comparison. We also trained a pair of models that differ only by a mathematically optimizer-equivalent normalisation parameterisation, to calibrate the noise floor of the pipeline: 0.0015 nats. Models were pretrained on SYNTH, a reasoning-dense corpus with query, trace and answer regions, for up to 105B tokens, and eight predictions were registered before the measurements were made.

What the FFN costs, in nats

0.00.10.20.30.40.5FFN model's lead in validation loss (nats, 105B tokens)Delete the FFN in placeiso-depth · 20L vs 20L · 87M vs 24M0.470 natsMatch training FLOPsiso-FLOP · 9L FFN model · 43M vs 24M0.263 natsMatch parametersiso-param · 4L FFN model · 24M vs 24M0.006 nats · 0.27% of loss
The same question, three controls. Deleting feed-forward layers costs 0.47 nats at matched depth and 0.26 at matched compute; hand the freed parameters back to attention as depth and 0.006 nats remain, reproducible across seed pairs to one part in ten thousand.

The three numbers order exactly by how much of the parameter budget the control lets attention reclaim. Delete the layers in place and you delete 72% of the model, which costs 0.47 nats. Match compute and the standard transformer still leads by 0.26, because attention spends part of its budget on the parameter-free quadratic term and so carries fewer weights at equal cost. Match parameters, reallocating the freed budget into attention depth, and the gap is 0.0055 and 0.0054 nats on two clean seed pairs, 0.27% of loss, agreeing to one part in ten thousand.

The FFN's parameters matter. Its functional form, on this distribution, largely does not.

More training closes the gapiso-param gap (nats) · tokens0.000.030.050.0465B0.01930B0.0055105BSize does not open itiso-param gap (nats) · non-embedding params-0.050.000.05-0.0452M0.0126M0.02116M32M0.01957M
Left: the matched-parameter gap falls from 0.046 nats at 5B tokens to 0.019 at 30B and 0.0055 at 105B. Right: at a fixed 31.5B-token budget the attention-only model wins at the smallest size, then the gap sits near 0.02 nats across a 29x range of non-embedding parameters.

Two more axes say the same thing. The matched-parameter gap shrinks with training: 0.046 nats at 5B tokens, 0.019 at 30B, 0.0055 at 105B, each budget trained and tuned separately rather than one curve read at three points. And it does not grow with scale: at a fixed 31.5B-token budget across five matched size pairs the attention-only model wins at the smallest size, then the gap plateaus near 0.02 nats from 16M to 57M non-embedding parameters. Constraining both arms to 2M, 8M or 32M unique documents, up to 18 epochs, costs at most 0.010 nats and shows no interaction with architecture.

Where the gap lives

A small aggregate gap could be a small deficit everywhere or a large deficit somewhere. Every SYNTH document has three regions, a query, a reasoning trace and an answer, delimited by marker tokens, so the loss can be decomposed exactly. The token-weighted sum of region gaps reproduces the aggregate to within 2%, so nothing is hiding between the rows.

-0.020.00+0.02+0.04+0.06SAN loss minus FFN loss (nats) · right of zero favours the FFN model31B tokens105Bquery5.8% of tokens+0.052+0.0380trace57.2% of tokens+0.008-0.0040answer35.9% of tokens+0.011-0.0070allsample aggregate+0.011-0.0025
The gap is concentrated, not diffuse. Every document has a query, a reasoning trace and an answer. By 105B tokens the attention-only model is ahead on traces and on every answer region, including memorisation exercises, and behind only on query tokens, where the context offers nothing to route.

The deficit sits on query tokens. These are the positions with the least context to route from, where only knowledge stored in weights can help, and at 31B tokens the per-token gap there is five times the sample aggregate while those tokens carry 8% of the loss. By 105B the localisation is complete on this sample: the SAN leads on traces and on every answer region, including memorisation exercises, and trails only on queries. Across the size ladder the query deficit is the one invariant, positive at every size and budget, while every other region changes sign.

Benchmarks split the same way. Lambada asks for a specific content word and, for models trained on SYNTH, is an out-of-distribution recall task; it favours the FFN model at every budget. Sciq puts the answer in a support passage; it favours the SAN, and the margin grows with training in the direction we registered in advance, 0.725 to 0.742 for the SAN while the FFN model slides from 0.702 to 0.661.

That account makes a prediction about text we had not trained on. Natural web text is mostly low-context prediction, so we registered, before launching the run, that a matched-parameter pair trained on fineweb-edu would show a gap between 0.02 and 0.05 nats. It measured 0.040. The same pair reverses on lambada, 0.203 against 0.181 in the SAN's favour: trained on distribution-matched text, the passage is enough to infer the final word and lambada becomes a routing task. Whether a task is storage or routing is not a property of the task. It is a property of the match between the task and the training distribution.

The mechanism, in the weights

first quarter of traininghighlowstable ranktraining steps · stable phase, then the learning-rate decay tailrouting · Q and Kcrystallises early, then holdscontent · Wo (or the FFN down-projection)accumulates rank for as long as the stable phase lasts
Schematic of the measured weight-spectrum dynamics. In every model trained, the routing matrices freeze within the first quarter of training while the matrices that write content into the residual stream keep gaining rank; remove the feed-forward layer and that accumulation moves to the attention output projection.

Tracking the stable rank of every weight matrix over training gives the same picture in every architecture, size and budget we trained. The routing matrices, Q and K, crystallise within the first quarter of training and do not move again; the optimiser sets the level, with Muon holding them two to three times flatter than AdamW, but the schedule is universal. The matrices that write content into the residual stream keep accumulating rank for as long as the stable phase lasts: the down-projection in FFN models, and in attention-only models the output projection, which inherits the role because it is the SAN's only write path. Selection structure is learned early and frozen; content capacity accrues indefinitely, in whichever matrices can hold it. Representation rank stays high throughout, a minimum layer rank of 173 of 512 at 20 layers, so the classical rank-collapse regime for pure attention is never approached once residuals and normalisation are in place.

What keeps a deep attention-only stack trainable

Component ablations at 20 layers isolate three facts. QK-normalisation is load-bearing: removing it diverges outright at the tuned learning rate, the only divergence in the study and the one finding none of our predictions anticipated. Scalar residual gates are performance-neutral at every depth from 20 to 48 layers and in both architectures; their value was diagnostic, since their trajectories showed the FFN model self-pruning toward attention-only form under learning-rate stress. And post-attention sandwich normalisation is the only variant that beats the baseline, by 0.009 nats. Depth at matched parameters is U-shaped with a 20-layer optimum, and 48-layer attention-only stacks train without incident. Every instability in the study happened in the FFN arm; none in the SAN arm.

When to use one

At matched parameters a SAN pays roughly twice the FLOPs per token at 2048 context, and at matched FLOPs the FFN model is ahead. The trade favours attention-only models where parameters, not FLOPs, are the binding constraint, which is exactly the on-device regime: memory limits set the model size, and a token costs bandwidth before it costs arithmetic. It favours them where a single repeated, interpretable primitive has analysis value, and on trace-rich distributions where the answer can be routed from context. We claim a regime, not superiority.

That regime is Needle's. Tool calling and structured extraction are routing problems: the function names, the argument values and the schema are all in the prompt, and the model's job is to select and transport them into a call. Needle 2 was a Simple Attention Network with an engram memory bolted on for the facts that are not in context; Needle 3 keeps the attention-only stack and adds a ladder so that every depth from 2 to 20 layers is a deployable model. The 0.006 nats above is the price of that design, and the query-token deficit is the part of it we buy back with engrams.

All results are at or below 87M parameters and 105B tokens, on one reasoning-dense corpus plus one knowledge-dense control pair, and MMLU-class benchmarks are at chance at these scales. The storage account itself predicts a wider gap on storage-heavy mixtures at larger scale, which is the natural next experiment. Code, training curves, evaluation reports and every checkpoint accompany the paper.