Attention Residuals

TL;DR

Introduces Attention Residuals using softmax attention to replace fixed accumulation, enhancing model performance.

cs.CL 🔴 Advanced 2026-03-16 3 views
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 Y. Zhang 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 Zhou
deep learning residual connections attention mechanism model optimization large-scale training

Key Findings

Methodology

This paper introduces Attention Residuals (AttnRes), replacing traditional fixed accumulation in residual connections with a softmax attention mechanism. Each layer selectively aggregates previous layer representations using learned, input-dependent weights. To address memory and communication overhead in large-scale model training, Block AttnRes is proposed, partitioning layers into blocks and attending over block-level representations, reducing memory usage while retaining most benefits of full AttnRes.

Key Results

  • Integrating AttnRes into the Kimi Linear architecture and pre-training on 1.4T tokens, AttnRes effectively mitigates PreNorm dilution, resulting in more uniform output magnitudes and gradient distribution across depth, improving downstream performance across all evaluated tasks.
  • Block AttnRes reduces memory usage while maintaining performance comparable to full AttnRes, with training overhead increasing by less than 4%.
  • Scaling experiments show consistent improvements across model sizes, with Block AttnRes matching the baseline's performance using 1.25x compute.

Significance

This research addresses the issue of uneven information accumulation in traditional residual connections by introducing Attention Residuals, significantly enhancing the training stability and performance of deep learning models. AttnRes not only provides a new theoretical approach to depth-wise information aggregation but also demonstrates its effectiveness and scalability in large-scale model training.

Technical Contribution

Technical contributions include proposing a new residual connection method that uses a softmax attention mechanism for selective depth-wise aggregation. Block AttnRes significantly reduces memory and communication overhead through block-level attention operations, providing a scalable solution.

Novelty

AttnRes is the first to apply softmax attention to depth-wise information aggregation, offering a more flexible and efficient selective aggregation strategy compared to traditional linear accumulation methods.

Limitations

  • In extremely large-scale models, although Block AttnRes reduces memory usage, there is still some communication overhead.
  • In certain specific tasks, further parameter optimization may be required to achieve optimal performance.

Future Work

Future research could explore the effects of applying AttnRes in different architectures and further optimize Block AttnRes to reduce communication overhead.

AI Executive Summary

In modern large language models, residual connections are standard components, but their fixed accumulation method leads to depth-wise information dilution. This paper introduces Attention Residuals (AttnRes), replacing traditional fixed accumulation with a softmax attention mechanism, allowing each layer to selectively aggregate previous layer representations, thus alleviating information dilution.

To address memory and communication overhead in large-scale model training, Block AttnRes is introduced, partitioning layers into blocks and attending over block-level representations. This approach not only reduces memory usage but also retains most of the performance gains of full AttnRes. Experiments show consistent improvements across model sizes, with Block AttnRes matching the baseline's performance using 1.25x compute.

By integrating AttnRes into the Kimi Linear architecture and conducting large-scale pre-training, the study demonstrates significant performance improvements in downstream tasks. AttnRes effectively mitigates PreNorm dilution, resulting in more uniform output magnitudes and gradient distribution across depth. This innovation provides new insights and methods for training and optimizing deep learning models.

Deep Analysis

Background

Residual connections in deep learning models significantly improve training stability by allowing gradients to bypass transformations. However, traditional residual connections use fixed accumulation, leading to depth-wise information dilution and uncontrolled growth of hidden states. Recent attempts to optimize information aggregation through learnable input-dependent weights have struggled to scale in large models.

Core Problem

The fixed accumulation method of traditional residual connections leads to depth-wise information dilution, weakening each layer's contribution. As depth increases, hidden state magnitudes grow as O(L), burying early-layer information and preventing selective retrieval. This problem is particularly pronounced in large-scale models, affecting training efficiency and performance.

Innovation

The paper introduces Attention Residuals (AttnRes), replacing fixed accumulation with a softmax attention mechanism, allowing each layer to selectively aggregate previous layer representations. Block AttnRes uses block-level attention operations to significantly reduce memory and communication overhead, providing a scalable solution.

Methodology

  • �� Replace fixed accumulation with a softmax attention mechanism for selective depth-wise aggregation.
  • �� Introduce Block AttnRes, partitioning layers into blocks and attending over block-level representations to reduce memory usage.
  • �� Combine cache-based pipeline communication and a two-phase computation strategy to optimize efficiency in large-scale model training.

Experiments

AttnRes is integrated into the Kimi Linear architecture and pre-trained on 1.4T tokens. The experimental design includes scaling experiments, component ablation studies, and downstream task evaluations. Results show consistent improvements across model sizes, with Block AttnRes matching the baseline's performance using 1.25x compute.

Results

AttnRes effectively mitigates PreNorm dilution, resulting in more uniform output magnitudes and gradient distribution across depth. Block AttnRes reduces memory usage while maintaining performance comparable to full AttnRes, with training overhead increasing by less than 4%.

Applications

AttnRes can be directly applied in the training of large language models, enhancing model performance and stability. Its block-level attention operations are suitable for large-scale model training where memory and communication overhead need to be minimized.

Limitations & Outlook

Although Block AttnRes reduces memory usage, there is still some communication overhead in extremely large-scale models. Additionally, further parameter optimization may be required in certain specific tasks to achieve optimal performance.

Plain Language Accessible to non-experts

Imagine traditional residual connections as an assembly line where each worker does the same job for a fixed time, leading to some workers' contributions being diluted. Attention Residuals are like a smart assembly line manager who adjusts each worker's time based on their performance, improving overall efficiency. Block AttnRes groups workers into teams, each with its own management system, reducing management costs while maintaining efficient workflows.

ELI14 Explained like you're 14

Hey, imagine you're in a school group project where everyone has to do the same amount of work, but some people are better at certain tasks. The traditional way is like making everyone do the same thing, wasting some people's efforts. Attention Residuals are like a smart team leader who assigns tasks based on each person's strengths, making the whole team perform better. Block AttnRes divides everyone into smaller teams, each with its own leader, saving time and being super efficient!

Glossary

Attention Residuals

A method replacing traditional residual connections with a softmax attention mechanism for selective depth-wise aggregation.

Used to address depth-wise information dilution.

Block AttnRes

Partitions layers into blocks and performs attention at the block level to reduce memory and communication overhead.

Used for memory optimization in large-scale model training.

PreNorm

A normalization technique commonly used in deep learning models to improve training stability.

AttnRes mitigates PreNorm dilution in this paper.

Softmax Attention

A method of calculating attention weights using the softmax function, allowing selective information aggregation.

Used to replace traditional fixed accumulation.

Kimi Linear

A large-scale Mixture-of-Experts Transformer architecture used for efficient deep learning model training.

Used to validate the effectiveness of AttnRes in this paper.

Open Questions Unanswered questions from this research

  • 1 How can communication overhead be further reduced in extremely large-scale models?
  • 2 How can AttnRes parameters be optimized for optimal performance in different tasks?

Applications

Immediate Applications

Large Language Model Training

By introducing AttnRes, improve model performance and stability, suitable for efficiently training large language models.

Long-term Vision

General Deep Learning Optimization

The introduction of AttnRes could influence overall optimization strategies in deep learning, driving more efficient model designs.

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.

cs.CL