[2502.13189] MoBA: Mixture of Block Attention for Long-Context LLMs
Abstract: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 this https URL.
Abstract: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 adher
Explore this link on the map →related reading
- Subquadratic — How SSA Makes Long Context Practicalsubq.ai
- Recursive Language Models | Alex L. Zhangalexzhang13.github.io
- 2502.11089arxiv.org
- A short note on some aspects of long context attention | nor's blognor-blog.pages.dev
- Extending Context is Hard | kaiokendevkaiokendev.github.io
- Understanding Attention in LLMs | Bartosz Milewski's Programming Cafebartoszmilewski.com
- Mamba: The Easy Wayjackcook.com
- LLM Resourcesforrestbicker.com
- Reimagining LLM Memory: Using Context as Training Data Unlocks Models That Learn at Test-Time | NVIDIA Technical Blogdeveloper.nvidia.com
- Generalizing an LLM from 8k to 1M Context using Qwen-Agent | Qwenqwenlm.github.io
- Transformers Inference Optimization Toolset | AstraBlogastralord.github.io
- Mediumblog.gopenai.com