Vibeleaderboard
← All Intel
Intel / article

HySparse: sparse attention that reuses the full layer's picks and KV cache

Source
arxiv.org
Author
Xiaomi MiMo
Date

Context

Sparse attention speeds up long- models by letting a layer attend to only a chosen subset of earlier tokens. The HySparse paper from Xiaomi's -Core team argues that most such methods still carry two costs. First, they need an extra predictor to guess which tokens matter. Second, token importance can shift as generation goes on, so dynamic methods usually keep the full key-value (KV) cache, the per-layer memory of past tokens. The result is that they save computation but not memory.

HySparse pairs each full-attention layer with several sparse layers that borrow from it. The full layer computes ordinary attention, and a small change to the FlashAttention kernel makes it also output block-level importance scores, which are used to pick the top blocks (by default 1,024 tokens in blocks of 64). The sparse layers that follow attend only to those blocks and read them from the full layer's instead of storing their own. Each sparse layer also has a second branch: a 128-token sliding window with its own small cache. The authors found that keeping this local cache separate was essential. Their explanation is that the shared cache is tuned for global retrieval and may lack the features needed for short-range detail.

The authors trained a 7B dense model with one full layer for every three sparse layers, and an 80B model with a 1:11 ratio. They compared each against an all-full-attention version and against a hybrid sliding-window baseline with the same layer ratio. In the 80B model only 5 of 49 layers use full attention, which the paper says cuts KV cache storage by nearly 10x relative to full attention and adds nothing relative to the hybrid baseline. At that scale HySparse beat both baselines on nearly all general benchmarks, trailing full attention slightly on MMLU-Pro, DROP and ARC-Challenge. On the RULER long-context test it scored 87.4 against 82.1 for full attention at 32K tokens, but 90.6 against 93.6 at 16K. The sliding-window baseline fell to 72.7 and 69.5.

The comparison with that baseline matters most. Xiaomi's production models already mix a few full-attention layers with many sliding-window layers: its serving write-up for MiMo-V2.5 describes 10 full and 60 windowed layers. The paper's 80B results suggest that sliding windows alone lose accuracy as that ratio becomes more aggressive, and that the borrowed sparse branch recovers it. These are the developers' own experiments, on models trained for this study (the 80B model on 500 billion tokens), not an independent replication.

Terms in this piece · Glossary
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
  • Large language model — A model trained on large amounts of data to process and generate language.
  • KV cache — The memory a model keeps about text it has already read, so generating each new token doesn't require reprocessing the whole conversation.
  • mixture-of-experts — A model built from many specialist sub-networks where only a few activate per token, giving big-model capability at small-model running cost.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from Xiaomi MiMo
Recommended reads