arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.11761cs.CLcs.AIcs.LG
收藏

MiniCPM-SALA: 融合稀疏与线性注意力以实现高效长上下文建模

MiniCPM-SALA: Hybridizing Sparse and Linear Attention for Efficient Long-Context Modeling

MiniCPM Team(MiniCPM 团队)
MiniCPM Team, Wenhao An, Yingfa Chen, Yewei Fang, Jiayi Li, Xin Li, Yaohui Li, Yishan Li, Yuxuan Li, Biyuan Lin, Chuan Liu, Hezi Liu, Siyuan Liu, Hongya Lyu, Yi… 展开作者

MiniCPM Team, Wenhao An, Yingfa Chen, Yewei Fang, Jiayi Li, Xin Li, Yaohui Li, Yishan Li, Yuxuan Li, Biyuan Lin, Chuan Liu, Hezi Liu, Siyuan Liu, Hongya Lyu, Yinxu Pan, Shixin Ren, Xingyu Shen, Zhou Su, Haojun Sun, Yangang Sun, Zhen Leng Thai, Xin Tian, Rui Wang, Xiaorong Wang, Yudong Wang, Bo Wu, Xiaoyue Xu, Dong Xu, Shuaikang Xue, Jiawei Yang, Bowen Zhang, Jinqian Zhang, Letian Zhang, Shengnan Zhang, Xinyu Zhang, Xinyuan Zhang, Zhu Zhang, Hengyu Zhao, Jiacheng Zhao, Zhi Zheng, Jie Zhou, Zihan Zhou, Shuo Wang, Chaojun Xiao, Xu Han, Zhiyuan Liu, Maosong Sun

AI总结:

MiniCPM-SALA通过融合稀疏与线性注意力机制,实现高效长上下文建模,显著降低训练成本并提升推理效率。

摘要:

大语言模型(LLMs)向超长上下文应用的发展面临Transformer架构高计算和内存成本的挑战。尽管现有的稀疏和线性注意力机制试图缓解这些问题,但通常在内存效率和模型性能之间存在权衡。本文介绍了MiniCPM-SALA,一种9B参数的混合架构,该架构整合了稀疏注意力(InfLLM-V2)的高保真长上下文建模能力与线性注意力(Lightning Attention)的全局效率。通过采用分层选择算法将这些机制以1:3的比例整合,并利用混合位置编码(HyPE),模型在长上下文任务中保持了效率和性能。此外,我们引入了一种成本有效的持续训练框架,将预训练的Transformer模型转换为混合模型,相比从头开始训练,训练成本降低了约75%。广泛的实验表明,MiniCPM-SALA在保持与全注意力模型相当的通用能力的同时,提供了改进的效率。在单块NVIDIA A6000D GPU上,该模型在256K token序列长度下,推理速度达到全注意力模型的3.5倍,并支持高达1M token的上下文长度,而在传统全注意力8B模型中,由于内存限制,这一规模无法实现。

英文摘要:

The evolution of large language models (LLMs) towards applications with ultra-long contexts faces challenges posed by the high computational and memory costs of the Transformer architecture. While existing sparse and linear attention mechanisms attempt to mitigate these issues, they typically involve a trade-off between memory efficiency and model performance. This paper introduces MiniCPM-SALA, a 9B-parameter hybrid architecture that integrates the high-fidelity long-context modeling of sparse attention (InfLLM-V2) with the global efficiency of linear attention (Lightning Attention). By employing a layer selection algorithm to integrate these mechanisms in a 1:3 ratio and utilizing a hybrid positional encoding (HyPE), the model maintains efficiency and performance for long-context tasks. Furthermore, we introduce a cost-effective continual training framework that transforms pre-trained Transformer-based models into hybrid models, which reduces training costs by approximately 75% compared to training from scratch. Extensive experiments show that MiniCPM-SALA maintains general capabilities comparable to full-attention models while offering improved efficiency. On a single NVIDIA A6000D GPU, the model achieves up to 3.5x the inference speed of the full-attention model at the sequence length of 256K tokens and supports context lengths of up to 1M tokens, a scale where traditional full-attention 8B models fail because of memory constraints.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑