Vibeleaderboard
← All Intel
Intel / article

How Xiaomi serves hybrid sliding-window attention at scale

Source
mimo.xiaomi.com
Publisher
Xiaomi
Author
Xiaomi MiMo
Date

Context

Xiaomi's inference write-up for the MiMo-V2.5 series is about the gap between an efficient architecture and efficient serving. MiMo-V2.5-Pro has 70 layers. Ten use full over the whole , and 60 use sliding-window attention (SWA), which looks back only 128 tokens. The is the stored per-token memory a model reuses while generating, and windowed layers only need to keep it for the last 128 tokens. On that basis Xiaomi calculates that both compute and KV cache fall to roughly one-seventh of what full attention needs. Its argument is that serving software built for full attention does not deliver that saving automatically.

When Xiaomi launched its API on SGLang v0.5.5, the framework's tiered cache handled SWA by storing the full KV cache anyway. Xiaomi split cache memory into two pools: a full-length pool for the 10 global layers and a window-sized pool for the 60 SWA layers. It says this improved KV cache capacity efficiency about sevenfold. The harder problem was prefix caching, where a request that starts with the same tokens as an earlier one reuses that request's stored cache. The usual rule assumes identical tokens mean the cached data is still present. With SWA, the window-sized entries may already have been evicted while the prefix tree still lists the sequence, and reusing them would read invalid memory and degrade answers. Xiaomi changed the rule so that a match counts only as far as the last 128 tokens still have valid SWA entries, and it tied eviction to how far each request has progressed.

Xiaomi credits this work with several production results: server-side KV cache hit rates averaging 93 percent, and 95 percent or more for heavy users. It also reports about 25 percent more L2 cache hits and 30 percent higher per-node input from routing requests to instances that already hold their prefix. A third gain was roughly 40 percent better end-to-end performance, after the smaller SWA footprint let it halve expert parallelism in the prefill stage. These are Xiaomi's own measurements. The blog says the savings were passed to users as API price cuts. That links it to Xiaomi's earlier announcement cutting MiMo-V2.5 API prices by up to 99 percent, which credited inference optimization and promised a detailed technical blog on those optimizations.

Terms in this piece · Glossary
  • attention — The mechanism that lets a model weigh which earlier words matter for the word it's currently processing — the core operation of a transformer.
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
  • 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.
  • throughput — How much model output a provider can generate over time, commonly measured in output tokens per second.

Get the Brief

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

Read the source mimo.xiaomi.com
More from Xiaomi MiMo
Recommended reads