| Depth mix | |
|---|---|
| sublayer index, ; attention and feed-forward count separately | |
| model width | |
| token embedding | |
| output of sublayer in Full AttnRes; a block sum or partial sum in Block AttnRes | |
| input of sublayer under the residual, | |
| input of sublayer under AttnRes, | |
| , | |
| learned pseudo-query of sublayer | |
| weight of source in sublayer 's mix | |
| number of sources of sublayer | |
| common output size in the dilution estimate | |
| Blocks | |
| number of blocks, about 8 | |
| sublayers per block, | |
| Scaling fit | |
| validation loss | |
| training compute, PFLOP/s-days | |
| coefficient and exponent of the fit | |
| compute factor the baseline needs to lower its loss by | |
| Paper symbols | |
| the paper writes for (and for ) | |
| the paper writes for | |
| the paper writes these for the sources : one output, a block sum | |
| the paper also writes for loss and for the exponent | |
Context. In a transformer with PreNormthe residual layout : each sublayer reads a normalized copy of the running sum and adds its output to the unnormalized sum; the standard layout of current LLMs residual connections, each attention or feed-forward sublayer reads a normalized copy of a running sum and adds its output back into it. Unrolled, every sublayer sees the unweighted sum of the token embedding and all earlier outputs. Sequence attention and expert routing weight inputs with learned, input-dependent scores, while depth mixing gives every earlier layer weight 1. Kimi Team (2026) at Moonshot AI replace that fixed sum with a softmax over earlier outputs. The block variant of their method supplies the depth mix inside Inkling 2 Minithe Thinking Machines model whose looped core holds the block depth mix. Reading note: Inkling 2 Mini's looped core.
A running sum grows with depth, so each sublayer's output shrinks as a share of what later layers read. Deep sublayers respond by producing larger outputs. Attention Residuals (AttnRes) give each sublayer a learned query that takes a softmax-weighted average of earlier outputs. Softmax weights sum to 1, so the input never exceeds its largest source at any depth. Because normalized keys set the scores, scaling a source up buys it no extra weight. Block AttnRes sums sublayers inside each block and mixes roughly eight block sums, keeping memory and communication overhead low. Initialized with zero queries, it computes the exact PreNorm model (computed here). On a five-size scaling ladder tuned for the baseline, Block AttnRes matches a baseline given 1.25 times the compute. In a 48B-parameter model trained on 1.4T tokens, it ties the baseline on one of 15 benchmarks and beats it on the other 14.
Setting. Count attention and feed-forward sublayers separately, the index of a sublayer, attention and feed-forward each counted as one; sublayers in all, twice the number of transformer blocks. Write for the token embedding, for sublayer 's output, and for the input that sublayer normalizes and reads, so . Standard PreNorm residuals (first line) and Full AttnRes (second and third) differ only in how they weight those earlier outputs:Here the pseudo-query of sublayer , a learned vector in with the model width; it is a parameter, so it is the same for every token (Kimi Team write ) is sublayer 's learned pseudo-query, and with : the vector rescaled to root-mean-square 1, its direction without its size rescales to root-mean-square 1. The weights vary across tokens only through the normalized keys , while the mixed values stay the raw outputs . The paper casts the standard residual as linear attention over depth with every score fixed at 1. AttnRes turns that sum into softmax attention over depth, the step transformers took over the sequencesoftmax weights replacing a fixed sum over earlier tokens. Reading note: Softmax attention as a sum of RNNs.
PreNorm dilution. In a standard residual stream, the growing sum dilutes every earlier output. Ignoring RMSNorm's learned gain, which scales all terms alike, sublayer readsso each output enters divided by . For terms of common size a common root-mean-square size of the outputs , assumed equal for this estimate, grows as when the outputs are uncorrelated and when they align (computed here; the paper writes growth). Any single output's share shrinks like to . Because RMSNorm normalizes each sublayer's input, the sublayer's weights set its output scale. Deep sublayers must learn larger weights to keep their influence. In Kimi Team's trained 48B baseline, block output magnitudes climb from under 0.1 at the first transformer block to about 12 at the last. Those numbers come from their Fig. 5b, in a magnitude the paper does not define. Kimi Team note that this output growth can destabilize training. Because a fixed sum also prevents layers from selectively retrieving an earlier output, they replace the residual.
Softmax weights bound the input norm. Replacing the unweighted sum with a softmax average stops depth dilution. Because the weights are nonnegative and sum to 1, and RMS is a norm, the triangle inequality bounds the mixed input directly:At any depth, a sublayer's input is never larger than its largest source, no matter how many sources enter the mix.
Normalized keys decouple weight from output size. Because depends on only through its normalized direction , multiplying a source by any leaves its attention weight unchanged. To gain weight, a source must align with a later sublayer's query ; inflating its norm no longer helps. Kimi Team also credit competition inside the softmax with smoother gradients across depth. In their Fig. 5c, gradients in the 48B baseline are about 30 times larger at the first transformer block than at the last. Block AttnRes cuts that spread to about 8 times.
Block AttnRes cuts memory and communication at scale. Full AttnRes must retain all sublayer outputs per token. Plain training stores them anyway for backpropagation. Under activation recomputationdiscarding activations in the forward pass and recomputing them in the backward pass to save memory, however, Full AttnRes must keep them in memory, and under pipeline parallelismsplitting the layers across devices in stages, so that activations are sent from one stage to the next, devices must ship them across stages. Block AttnRes splits the sublayers into the number of blocks; each holds consecutive sublayers blocks of sublayers and keeps an ordinary running sum inside each block. Each sublayer mixes the embedding, the finished block sums, and, after a block's first sublayer, the current block's partial sum. Those vectors serve as the sources in the same softmax rule. Setting recovers the standard residual with a separate embedding, while recovers Full AttnRes. Roughly eight blocks capture most of the gain at every tested scale. Because every query is a fixed parameter, inference scores all queries of a block against stored block sums in one batched pass. Latency rises by under 2%. During training, each pipeline stage caches the block sums it has already received, holding pipeline-parallel overhead under 4%.
Block boundaries reset dilution into a sawtooth. Inside any block, the partial sum still accumulates like a standard residual stream, so dilution returns across that block's sublayers. At the next block boundary, the finished sum becomes one source among others and a fresh partial sum starts at zero. The 48B Block AttnRes model packs six sublayers, or three transformer blocks, into each AttnRes block. Its output magnitudes trace a sawtooth with a period of three transformer blocks and stay below 2.
Zero queries initialize AttnRes as the exact PreNorm model. Kimi Team initialize every pseudo-query at zero and report that starting from a plain average prevents unstable early training. With , each of sublayer 's the number of sources sublayer mixes: in Full AttnRes; the embedding, the finished block sums and, after a block's first sublayer, the partial sum in Block AttnRes sources gets equal weight . Those sources sum to , the embedding plus all earlier outputs, so their average rescales by a positive constant that RMSNorm cancels:Every sublayer reads the exact PreNorm input, so Full and Block AttnRes both start by computing the PreNorm function up to RMSNorm's small . That equivalence is computed here and checked numerically on a small random stack. Training leaves this point immediately, because is nonzero at unless all sources point the same way. Inkling 2 Mini applies the same zero-impact startup to its loop. Its release post reports that the loop gate starts closed, so the looped model begins as the plain one.
Scaling ladder across five sizes. Kimi Team compare a PreNorm baseline, Full AttnRes, and Block AttnRes (about eight blocks) across five Kimi LinearMoonshot AI's mixture-of-experts architecture that interleaves three linear-attention layers (Kimi Delta Attention) with one latent-attention layer (MLA) models from 194M to 528M activated parametersthe parameters used per token in a mixture-of-experts model, embeddings excluded. Models train on 38.7B to 119B tokens using the baseline's hyperparameters. Block AttnRes beats the baseline by 0.020 to 0.026 in validation loss at every size. At 528M, it differs from Full AttnRes by only 0.001. Power laws in compute training compute in PFLOP/s-days, one PFLOP/s-day being floating-point operations fit all three variants with nearly the same exponent, for the baseline. To turn a loss gap into an equivalent compute multiplier for the baseline, solveOn the fitted curves at 5.6 PFLOP/s-days, about the largest model's compute, Block AttnRes reaches 1.692 against 1.714 for the baseline, giving . For scale in the ablations below, the same formula puts a 0.01 loss gap near 1.74 at roughly 1.1 times the compute (computed here).
Ablations isolate weighting and long-range access. Ablations on the 436M model (32 sublayers, matched data and compute) test which parts of AttnRes drive the gain. DenseFormera transformer in which each layer reads a weighted sum of all earlier outputs with learned scalar weights that are fixed after training (Pagliardini et al., 2024) reads all earlier outputs with fixed weights and gains nothing, landing at 1.767 against the 1.766 baseline. Replacing AttnRes's input-dependent scores with learned per-source constants reaches 1.749, against 1.737 for Full AttnRes. Those static weights recover a bit more than half the 0.029 gain, and input-dependent weights supply the rest. A sliding window over the 8 most recent outputs plus the embedding reaches only 1.764. Selective access to distant layers matters more than broad local access. Dropping RMSNorm from the keys costs 0.006 for Full AttnRes and 0.004 for Block AttnRes. Against mHCmanifold-constrained hyper-connections: parallel residual streams mixed between layers by learned, input-dependent matrices constrained to be doubly stochastic (Xie et al., 2025) at 1.747, Full AttnRes wins and Block AttnRes ties at 1.746. At the paper's typical sizes, Block AttnRes moves far less memory per sublayer and token at inference, against for 4-stream mHC.
Downstream gains at 48B. At full Kimi Linear scale, both 48B models activate 3B parameters per token across 27 transformer blocks (54 sublayers), using 8 of 256 experts plus a shared expert. Each trained on 1T pretraining tokens plus about 400B mid-training tokens. Block AttnRes's final mix combines ten sources (the embedding and nine block sums). Its validation loss stays lower throughout pretraining, and the gap widens during learning-rate decay. Across 15 benchmarks, Block AttnRes ties on MMLU-Pro (52.2) and leads on the other 14. Its largest gain is on GPQA-Diamond, from 36.9 to 44.4, alongside 3 to 4 points on Minerva Math and HumanEval. The authors credit those larger gains on multi-step benchmarks to better cross-depth access, a hypothesis the paper does not test directly.
Learned weight patterns and deeper model shapes. In the 436M model, learned depth weights stay mostly local, with each sublayer placing its largest weight on its immediate predecessor. The embedding keeps weight throughout, more before attention than before feed-forward sublayers, and a few sublayers form long skips. To test which shapes benefit most, the authors swept 25 architectures crossing five width-to-depth and five heads-to-depth ratios. Every run shared a budget of about FLOPs and activated parameters. AttnRes lowers loss in all 25 shapes by 0.019 to 0.063. It also shifts the optimal shape deeper, from a width of 60 per transformer block for the baseline to 45. Because deeper stacks add inference latency, the authors offer the sweep as a diagnostic of where AttnRes helps most.
Strength of the evidence. The comparisons are well controlled. Every AttnRes run changes only the residual, keeping the baseline's data, compute, and baseline-tuned hyperparameters. The loss gap holds across all five sizes, all 25 shapes, and the 48B pair. Several limits remain. The dilution explanation rests on output and gradient norms measured across depth in trained models rather than an intervention isolating output growth. The paper also states that zero-query initialization was validated empirically, but shows no run. No seeds or error bars appear anywhere in the paper. Gaps of a few thousandths, such as Block AttnRes against mHC or block sizes 2 to 8, cannot be ranked, while the repeated 0.02 gap across all five sizes is solid. Table 2 also tests mHC-lite, a cheaper variant of mHC (Yang and Gao, 2026), at all five sizes. It stays within 0.006 of Block AttnRes throughout and sits slightly ahead at the three smallest, leaving the two effectively tied. The scaling ladder stops at 528M activated parameters, every model uses the Kimi Linear MoE architecture, and the 48B comparison is one author-evaluated pair. Outside the paper, Thinking Machines built Inkling 2 Minithe Thinking Machines model with a looped core. Reading note: Inkling 2 Mini on Block AttnRes without publishing an ablation.
Terms
- PreNorm dilution
- the residual input grows with depth, so each output's share of a later sublayer's normalized input shrinks
- Attention Residuals
- , , one learned query per sublayer
- Why the input stays bounded
- softmax weights sum to 1, so
- Normalized keys
- a source's weight depends on , so its size does not set its weight
- Block AttnRes
- sum within blocks, mix the embedding, the finished block sums and the partial sum; about 8 blocks
- Zero queries
- equal weights give the residual sum over the number of sources, which RMSNorm undoes, leaving the PreNorm model
- Scaling result
- Block AttnRes matches a baseline given 1.25 times the compute; 0.020 to 0.026 lower loss at all five sizes
- Ablations
- DenseFormer's fixed weights gain nothing; static weights inside AttnRes recover more than half the gain, input-dependent ones the rest; distant access and normalized keys matter
- 48B result
- ahead on 14 of 15 benchmarks, tied on MMLU-Pro; largest gain GPQA-Diamond, 36.9 to 44.4
Sources
- Kimi Team. Attention Residuals. arXiv preprint (technical report), 2026.
- Kimi Team. MoonshotAI/Attention-Residuals (code). GitHub, 2026.
- Pagliardini et al. DenseFormer: Enhancing Information Flow in Transformers via Depth Weighted Averaging. arXiv preprint, 2024.
- Xie et al. mHC: Manifold-Constrained Hyper-Connections. arXiv preprint, 2025.
- Yang and Gao. mHC-lite: You Don't Need 20 Sinkhorn-Knopp Iterations. arXiv preprint, 2026.
Connected notes
- MuonNanoGPT speedrun · Fixed scales for stable training
Measuring a weight change by how far it moves a unit-RMS input gives the update , which, when and the gradient has full rank, moves the output of every unit-RMS input by exactly whatever the width, which is the P property, here derived from a choice of norm.
- Parametrization across width and depthDeep Learning Alchemy · Additive paths carry signal through depth and time
In five-step stress tests at width 64, the branch outputs of standard P add up to a residual stream with RMS about 33 at depth 1,000 at initialization, while Depth-P's branch multiplier holds it near 1.3 and gives the lowest loss at large depth after five updates. CompleteP's holds it at 1.0 but overcorrects, since independently initialized blocks add like independent terms.
- Maximal update parametrizationLazy training and feature learning · Predicting large runs from small ones
Under P the optimal learning rate, initialization scale and multipliers are nearly stable in width, so they can be tuned on a small proxy and copied, and a 40M proxy beat the published 6.7B GPT-3 at a tuning cost of 7% of its pretraining cost.
- PPO and RLOO for language modelsReinforcement learning for reasoning · Fixed scales for stable training
The reproduction draws the reward head's weights with standard deviation , shifts the reward so reference summaries score 0 on average, and whitens advantages to mean 0 and variance 1 in each batch, so the signal reaching the policy has a fixed size.