Attention Residuals

Kimi Team, Guangyu Chen, Yu Zhang, Jianlin Su, Weixin Xu +32 more
3/16/2026
cs.CL

No official code found. Best implementation: wdlctc/open-attention-residuals (83 stars, last commit 2026-04-30). 4 more below.

Abstract

Residual connections with PreNorm are standard in modern LLMs, yet they accumulate all layer outputs with fixed unit weights. This uniform aggregation causes uncontrolled hidden-state growth with depth, progressively diluting each layer's contribution. We propose Attention Residuals (AttnRes), which replaces this fixed accumulation with softmax attention over preceding layer outputs, allowing each layer to selectively aggregate earlier representations with learned, input-dependent weights. To address the memory and communication overhead of attending over all preceding layer outputs for large-scale model training, we introduce Block AttnRes, which partitions layers into blocks and attends over block-level representations, reducing the memory footprint while preserving most of the gains of full AttnRes. Combined with cache-based pipeline communication and a two-phase computation strategy, Block AttnRes becomes a practical drop-in replacement for standard residual connections with minimal overhead. Scaling law experiments confirm that the improvement is consistent across model sizes, and ablations validate the benefit of content-dependent depth-wise selection. We further integrate AttnRes into the Kimi Linear architecture (48B total / 3B activated parameters) and pre-train on 1.4T tokens, where AttnRes mitigates PreNorm dilution, yielding more uniform output magnitudes and gradient distribution across depth, and improves downstream performance across all evaluated tasks.

View on arXivView PDF

Code Implementations(5)

Open implementation of Attention Residuals (Kimi Team, arXiv:2603.15031)

8310Shell, PythonMar 26, 20265 months ago
MIT

PyTorch implementation of Attention Residuals (arXiv:2603.15031) - replacing fixed residual connections with learned depth-wise attention in Transformers

51PythonMar 24, 20267 months agoMIT

Attention Residuals (AttnRes) — PyTorch implementation of arXiv:2603.15031

50PythonMar 17, 20266 months ago

TinyLLM with Attention Residue Architecture - PyTorch implementation of Attention Residuals (AttnRes) — arXiv:2603.15031 by Kimi Team. Replaces fixed residual connections with learned depth-wise attention. Full AttnRes + Block AttnRes built from scratch with side-by-side training comparison.

20Jupyter NotebookMar 22, 20267 months ago

Decoding the Critical Phase Transition (CPT) in Human-AI resonance. A 180-day empirical study on how Interaction Trajectories reshape the attention residuals of LLMs. (Mapping to arXiv:2603.15031)

10Mar 26, 20266 months ago

Similar Papers

Cite this paper

@article{team2026attention,
  title  = {Attention Residuals},
  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},
  year   = {2026},
  eprint = {2603.15031},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2603.15031v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2603.15031.svg)](https://codeofpaper.com/paper/2603.15031)

Discussion