2025-02-24 · 专家 · 自然语言处理 · 机器学习

MoBA: Mixture of Block Attention for Long-Context LLMs

提出了一种名为MoBA的混合块注意力机制,旨在提高长上下文处理中大型语言模型(LLMs)的效率和可扩展性。

更新于 2025-02-24。作者:Enzhe Lu、Zhejun Jiang、Jingyuan Liu、Yulun Du、Tao Jiang、Chao Hong、Shaowei Liu、Weiran He、Enming Yuan、Yuzhi Wang、Zhiqi Huang、Huan Yuan、Suting Xu、Xinran Xu、Guokun Lai、Yanru Chen、Huabin Zheng、Junjie Yan、Jianlin Su、Yuxin Wu、Neo Y. Zhang、Zhilin Yang、Xinyu Zhou、Mingxing Zhang、Jiezhong Qiu。

中文摘要

扩大有效上下文长度对于推动大型语言模型(LLM)向通用人工智能(AGI)发展至关重要。然而,传统注意力机制中固有的二次增加的计算复杂度带来了难以承受的开销。现有的方法要么引入了强偏好的结构,例如特定任务的汇聚或窗口注意力,要么将注意力机制根本性地修改为线性近似,其在复杂推理任务中的性能尚未得到充分探索。在这项工作中,我们提出了一种遵循“少结构”原则的解决方案,允许模型自主决定关注的位置,而不是引入预定义的偏见。我们引入了混合块注意力(MoBA),这是一种将混合专家(MoE)的原则应用于注意力机制的创新方法。这种新颖的架构在长上下文任务上表现出优异的性能,同时提供了一个关键优势:能够无缝地在全注意力与稀疏注意力之间切换,提高效率而不会牺牲性能。MoBA已被部署以支持Kimi的长上下文请求,并在高效注意力计算方面为LLM取得了显著进步。我们的代码可在https://github.com/MoonshotAI/MoBA获取。

英文摘要

Scaling the effective context length is essential for advancing large language models (LLMs) toward artificial general intelligence (AGI). However, the quadratic increase in computational complexity inherent in traditional attention mechanisms presents a prohibitive overhead. Existing approaches either impose strongly biased structures, such as sink or window attention which are task-specific, or radically modify the attention mechanism into linear approximations, whose performance in complex reasoning tasks remains inadequately explored. In this work, we propose a solution that adheres to the ``less structure'' principle, allowing the model to determine where to attend autonomously, rather than introducing predefined biases. We introduce Mixture of Block Attention (MoBA), an innovative approach that applies the principles of Mixture of Experts (MoE) to the attention mechanism. This novel architecture demonstrates superior performance on long-context tasks while offering a key advantage: the ability to seamlessly transition between full and sparse attention, enhancing efficiency without the risk of compromising performance. MoBA has already been deployed to support Kimi's long-context requests and demonstrates significant advancements in efficient attention computation for LLMs. Our code is available at https://github.com/MoonshotAI/MoBA.

解读

一句话总结

提出了一种名为MoBA的混合块注意力机制,旨在提高长上下文处理中大型语言模型(LLMs)的效率和可扩展性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt