Attention Residuals

Kimi Team, Guangyu Chen, Yu Zhang, Jianlin Su, Weixin Xu, Siyuan Pan, Yaoyu Wang, Yucheng Wang, Guanduo Chen, Bohong Yin, Yutian Chen, Junjie Yan, Ming Wei, Fanqing Meng, Chao Hong, Xiaotong Xie, Shaowei Liu, Enzhe Lu, Yunpeng Tai, Yanru Chen, Xin Men, Haiqing Guo, Y. Charles, Haoyu Lu, Lin Sui, Jinguo Zhu, Zaida Zhou, Weiran He, Weixiao Huang, Xinran Xu, Yuzhi Wang, Guokun Lai, Yulun Du, Yuxin Wu, Zhilin Yang, Xinyu ZhouarXiv 2026

TL;DR

Modern Large Language Models (LLMs) rely on standard residual connections that aggregate layer outputs uniformly, which progressively dilutes the contributions of earlier layers as networks grow deeper. This paper introduces Attention Residuals (AttnRes), replacing fixed addition with learned, input-dependent softmax attention over preceding layers to allow dynamic feature selection. By partitioning layers into blocks (Block AttnRes) and introducing clever pipeline caching, the authors deliver a practical drop-in replacement that yields a 1.25× compute advantage and broad downstream improvements with negligible overhead.

What Problem Does This Paper Address?

In standard Transformer architectures, residual connections with PreNorm accumulate all layer outputs with fixed, uniform weights. As the network gets deeper, this unweighted accumulation causes the magnitude of the hidden states to grow monotonically ($O(L)$ growth).

This creates a phenomenon known as PreNorm dilution: the relative contribution of early layers shrinks, effectively burying crucial low-level information. Consequently, deeper layers must learn increasingly massive outputs to exert any influence, which destabilizes training. The authors note that this depth-wise bottleneck strongly parallels the sequential recurrence limitations that Recurrent Neural Networks (RNNs) faced before the invention of token-based self-attention.

Methods

The authors propose a formal framework that treats depth-wise accumulation as an attention mechanism, upgrading standard residual paths from linear attention to softmax attention.

  1. Full Attention Residuals (Full AttnRes): Instead of simply adding the previous layer's output, each layer uses a learned, layer-specific pseudo-query vector ($w_l$) to compute softmax attention weights over all preceding layer outputs.
  2. Block Attention Residuals (Block AttnRes): To mitigate the $O(Ld)$ memory and communication overhead of attending to every single past layer during large-scale distributed training, the authors group layers into $N$ blocks. Within each block, outputs are aggregated via standard residuals, but the model performs full softmax attention across these block-level summaries. This reduces the cross-stage footprint to $O(Nd)$.
Figure 1: Overview of Attention Residuals. (a) Standard Residuals: standard residual connections with uniform additive accumulation. (b) Full AttnRes: each layer selectively aggregates all previous layer outputs via learned attention weights. (c) Block AttnRes: layers are grouped into blocks, reducing memory from O(Ld) to O(Nd).

Infrastructure Optimizations

To make Block AttnRes practical at scale, the team introduced two key system optimizations:

  • Cross-Stage Caching: Under pipeline parallelism, physical ranks cache previously received blocks locally. Instead of re-transmitting the entire history at every stage transition, they only pass incremental updates, significantly reducing communication bottlenecks.
  • Two-Phase Computation: During inference, inter-block attention queries are batched simultaneously (Phase 1), while intra-block lookbacks are computed sequentially and merged via online softmax (Phase 2), preserving low memory I/O.
Figure 3: Cache-based pipeline communication example with 4 physical ranks and 2 virtual stages per rank, where hatched boxes denote end of AttnRes blocks. Numbers indicate micro-batch indices. Each rank caches previously received blocks; stage transitions only transmit incremental blocks (+[b1, b2]) instead of the full history.

Datasets

The authors integrated Block AttnRes into the Kimi Linear architecture—a Mixture-of-Experts (MoE) model featuring 48B total and 3B activated parameters. They pre-trained the model from scratch on 1.4 Trillion tokens using a Warmup-Stable-Decay (WSD) learning rate schedule.

Downstream evaluation spanned a comprehensive suite of standard benchmarks:

  • General Knowledge & Reasoning: MMLU, MMLU-Pro, GPQA-Diamond, BBH, ARC-Challenge, HellaSwag, TriviaQA.
  • Math & Code: GSM8K, MGSM, MATH, CMath, HumanEval, MBPP.
  • Chinese Language Understanding: CMMLU, C-Eval.

Key Insights and Ideas

  • The Depth-Time Duality: The paper formalizes a beautiful mathematical link showing that standard residuals, Highway networks, and multi-stream recurrences are all forms of depth-wise linear attention. AttnRes completes the transition to depth-wise softmax attention, mirroring the historic RNN-to-Transformer evolution.
  • Curing PreNorm Dilution: Tracking the training dynamics revealed that AttnRes successfully bounds hidden-state magnitudes into a stable, periodic pattern rather than an uncontrolled monotonic climb. It also flattens gradient distribution, ensuring early layers receive healthy gradient signals.
  • Preserved Locality & Specialization: Visualizing the learned attention weights showed that while layers still rely heavily on their immediate predecessors (diagonal dominance), they selectively form long-range skip connections and consistently maintain a strong dependency on the initial token embedding.

Key Results

  • Compute Efficiency: Scaling law experiments demonstrate that Block AttnRes consistently outperforms the baseline across all compute budgets, matching the validation loss of a standard PreNorm baseline trained with 1.25× more compute.
  • Downstream Superiority: The AttnRes model achieved gains across all evaluated tasks. The improvements were most pronounced in multi-step reasoning and coding, such as GPQA-Diamond (+7.5), MATH (+3.6), and HumanEval (+3.1).
  • Minimal Overhead: Thanks to the two-phase inference schedule, the total per-layer memory access overhead is drastically lower than alternative multi-stream methods. The end-to-end inference latency overhead is less than 2% on typical workloads, and training wall-clock overhead is under 4%.
Table 1: Memory access cost per token per layer incurred by the residual mechanism under each scheme. The internal I/O of the layer function fl is excluded. For AttnRes, both Full and Block variants use the two-phase inference schedule described in Appendix B; amortized costs are averaged over N layers within a block. Typical values: L=128, N=8, S=L/N=16, m=4.

Limitations and Future Work

While Block AttnRes solves the scaling bottleneck, Full AttnRes remains communication-prohibitive for massive models due to its $O(Ld)$ cross-stage transfer requirements. The authors anticipate that future hardware interconnect improvements (e.g., faster GPU-to-GPU fabrics) will eventually make Full AttnRes viable.

Additionally, exploring more expressive yet memory-efficient sub-quadratic or linear-complexity attention mechanisms specifically tailored for the depth dimension represents a promising frontier for future architectures.

Summary updated

BibTeX
@misc{team2026attention,
  author = {Kimi Team and Guangyu Chen and Yu Zhang and Jianlin Su and Weixin Xu and Siyuan Pan and Yaoyu Wang and Yucheng Wang and Guanduo Chen and Bohong Yin and Yutian Chen and Junjie Yan and Ming Wei and Y. Zhang and Fanqing Meng and Chao Hong and Xiaotong Xie and Shaowei Liu and Enzhe Lu and Yunpeng Tai and Yanru Chen and Xin Men and Haiqing Guo and Y. Charles and Haoyu Lu and Lin Sui and Jinguo Zhu and Zaida Zhou and Weiran He and Weixiao Huang and Xinran Xu and Yuzhi Wang and Guokun Lai and Yulun Du and Yuxin Wu and Zhilin Yang and Xinyu Zhou},
  title = {{Attention Residuals}},
  year = {2026},
  eprint = {2603.15031},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.15031},
}
Figure