# MoBA: Mixture of Block Attention for Long-Context LLMs

- **ID:** 707
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2502.13189
- **Authors:** 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
- **Venue:** arXiv (cs.LG)
- **Published:** 2025
- **Source:** arxiv
- **Language:** en
- **Access:** public
- **Tags:** attention, long-context, mixture-of-experts, efficient-inference, kimi
- **Topics:** attention, long context, mixture of experts, efficient inference, Kimi
- **Added:** 2026-09-29
- **Verified:** 2026-09-29
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/707

## Summary

Proposes Mixture of Block Attention (MoBA), which applies mixture-of-experts principles to the attention mechanism: the model learns where to attend across blocks rather than using predefined sparse patterns like sink or window attention. It claims superior long-context performance with seamless switching between full and sparse attention, and has been deployed for Kimi's long-context serving.

## From the source (fetched 2026-10-03)

- **Published:** Feb 18, 2025 (arXiv)
- **arXiv categories:** cs.LG, cs.AI, cs.CL (arXiv)
- **Author comment:** 15 pages (arXiv)
- **Citations:** 215 (23 influential) (Semantic Scholar)
- **References:** 68 (Semantic Scholar)
- **Published in:** Neural Information Processing Systems (Semantic Scholar)

## 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 https://github.com/MoonshotAI/MoBA.

## Research notes

- Method: Block-wise sparse attention with learned MoE-style routing over blocks, following a 'less structure' principle so the model determines attention targets autonomously instead of using predefined sparse patterns.
- Key findings: Deployed to support Kimi's long-context requests; Claims superior long-context performance with seamless switching between full and sparse attention
- Limitations: License CC-BY-NC-ND 4.0; code link on the arXiv page was generic/unverified.
- arXiv:2502.13189, cs.LG, submitted 2025-02-18.

## Cites, within this collection

- [Eagle and Finch: RWKV with Matrix-Valued States and Dynamic Recurrence](https://papers.projxon.ai/entries/560) (paper 2024, #560)

## Cited by, within this collection

- [LongCat Sparse Attention: Taming the Lightning via Streaming-aware Hierarchical Cross-Layer Indexing](https://papers.projxon.ai/entries/452) (paper 2026, #452)
- [Memory Caching: RNNs with Growing Memory](https://papers.projxon.ai/entries/461) (paper 2026, #461)
- [PithTrain: A Compact and Agent-Native MoE Training System](https://papers.projxon.ai/entries/481) (paper 2026, #481)
- [Parallax: Parameterized Local Linear Attention for Language Modeling](https://papers.projxon.ai/entries/497) (model 2026, #497)
- [Block Sparse Attention with Log-Linear Complexity](https://papers.projxon.ai/entries/1086) (paper 2026, #1086)

## Related entries

- Discussed in: [Long context: three bets and a weak spot in evaluation (overview)](https://papers.projxon.ai/entries/1208) (note, #1208)

## Similar entries

- [No More Free Lunch: Corpus Task Complexity Matters as Corpora Grow](https://papers.projxon.ai/entries/737) (paper, #737)
- [Screening Is Enough](https://papers.projxon.ai/entries/529) (paper, #529)
- [xattn](https://papers.projxon.ai/entries/782) (code, #782)
- [Let's (not) just put things in Context: Test-Time Training for Long-Context LLMs](https://papers.projxon.ai/entries/533) (paper, #533)
- [LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning](https://papers.projxon.ai/entries/821) (paper, #821)
- [Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling](https://papers.projxon.ai/entries/1244) (paper, #1244)
