Norms & blocks

Attention residuals (AttnRes)

Blocks don’t just add onto one residual stream. They attend back over earlier depths and pull in a weighted mix of what is useful.

First page of DenseFormer: Enhancing Information Flow in Transformers via Depth Weighted AveragingGoes back toFeb 2024DenseFormer: Enhancing Information Flow in Transformers via Depth Weighted AveragingPagliardini et al. · arXiv 2402.02622 ↗
Earlier layer states are selectively retrieved and mixed for the current blockEarlier layer statesthe current block can retrieve from any depthselect → mix → useembeddingblock n−3block n−2block n−1αcurrentblock nlearned α weights make the residual stream selective—not uniform

A plain residual connection adds each block’s output onto a single running stream, so depth-to-depth information has to travel through that one shared channel. Attention residuals generalize the idea: a set of learned α operators lets a block look back across all of the earlier depths at once and retrieve a weighted combination of their representations. It is attention over depth, the way ordinary attention is over sequence. Moonshot’s Kimi K3 is the first open model to announce it at scale (the α operators in its diagram). The mechanism has roots in DenseFormer’s depth-weighted averaging of past layers, with the newer twist that the mixing weights are computed from the input rather than fixed after training.

First traced in Kimi K3 (released July 27): the AttnRes depth-mixing edges are visible in its live traced graph — the first open model we have traced that uses this.

Adoption over time

Share of new models that have included this block over time.

3%202220232024202520263%20222023202420252026

See it in real models

Open any of these on hfviewer to find this block in the interactive architecture graph.

moonshotai/Kimi-K3 architecture graphmoonshotai/Kimi-K3image-text-to-text · ↓ 1.1M · ♡ 10kOpen in visualizer inference-optimization/Kimi-K3-0.40B architecture graphinference-optimization/Kimi-K3-0.40Bfeature-extraction · ↓ 25k · ♡ 73Open in visualizer unsloth/Kimi-K3 architecture graphunsloth/Kimi-K3image-text-to-text · ↓ 1k · ♡ 242Open in visualizer inference-optimization/Kimi-K3-0.40B-MXFP4 architecture graphinference-optimization/Kimi-K3-0.40B-MXFP4↓ 1k · ♡ 5Open in visualizer GrEarl/Kimi-K3-NVFP4A16-Requantized architecture graphGrEarl/Kimi-K3-NVFP4A16-Requantized↓ 977Open in visualizer inference-optimization/Kimi-K3-0.40B-NVFP4 architecture graphinference-optimization/Kimi-K3-0.40B-NVFP4↓ 172 · ♡ 4Open in visualizer lovedheart/Kimi-K3-Lite architecture graphlovedheart/Kimi-K3-Liteimage-text-to-text · ↓ 125 · ♡ 1Open in visualizer Eraly-ml/Kimi-K3-0.40B-Kazakh-CPT-step200 architecture graphEraly-ml/Kimi-K3-0.40B-Kazakh-CPT-step200text-generation · ↓ 110 · ♡ 1Open in visualizer Qinghao/Kimi-K3-Tiny-L13 architecture graphQinghao/Kimi-K3-Tiny-L13↓ 36 · ♡ 1Open in visualizer

Related concepts

hfviewer renders the full architecture of 3,100+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.

Browse all model graphs →