Research
MoBA: Mixture of Block Attention for Long-Context LLMs
This is third-party work — not authored by or affiliated with DarcStar Technologies.
By 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
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.
DarcStar commentary
Our perspective on this work and how it informs our research — not part of the original paper.
MoBA gets the instinct right: stop hand-drawing the attention pattern and let the model decide where to look. The fixed schemes — windows, sinks, strides — all share one flaw: they choose what to attend to before seeing a single token. MoBA routes each query to a handful of relevant key-value blocks through a learned gate, borrowing the Mixture-of-Experts idea and pointing it at attention. Content-adaptive block selection is the fix the fixed patterns were missing, and it's the direction we think this whole line is converging on.
The detail we like most is that it's a strict generalization, not a replacement: MoBA slides between sparse and full attention, with dense attention sitting there as a recoverable special case. That matters — it means the architecture imposes no ceiling. If the sparsity ever costs you, you dial back to full and measure the difference, rather than discovering after training that the pattern quietly threw away something you needed. Keeping the escape hatch is the honest way to ship a sparse method.
Two places we'd lean on it. First, content-adaptive selection is the right half of the answer, but on its own it carries no guarantee of reach — nothing promises every token can still influence every other in a bounded number of hops, so an unlucky gate can strand information the task needed. The gate tells you where the model wants to look; it doesn't tell you the graph stays connected. Pairing learned selection with a small always-on backbone that guarantees reachability is, to us, the missing half — it turns “usually enough” into “provably not cut off.”
Second, the granularity is doing quiet work. Choosing whole blocks is what makes this hardware-friendly — and we like it for exactly that reason — but block-level selection is a softer quadratic, not an escape from one, and it trades away token-level resolution inside each block. At ordinary context that's a great deal; push far enough and the routing itself becomes the cost center. And the selection is non-differentiable at heart, so how well the gate trains — and whether the sparse model matches the dense one it can fall back to — is an empirical question to measure, not a property to assume.
None of that is a knock. MoBA is the block-level, content-adaptive selection we think the field should build on, shipped in a real system serving real long-context traffic. We just read it as the strong first half of a design whose second half is the guarantee that nothing gets structurally left behind.