Skip to content

Efficiency & sharing · KV sharing

Cross-Layer KV Sharing

Later layers reuse key/value states produced by earlier layers.

GQA shares KV heads across query heads within a layer; cross-layer sharing goes further and lets whole layers reuse another layer's keys and values, so fewer layers add to the cache.

Gemma 4 E2B and E4B are prominent examples of the idea from cross-layer attention research.

Cross-layer KV sharing in Gemma 4. Figure from Sebastian Raschka’s explainer.

Adoption over time

Models in the atlas using KV sharing, per half-year of release.

Loading

Used by

4

models in the atlas

Earliest: Gemma 4 (E4B) (Apr 2, 2026)

Models using KV sharing

  • Architecture diagram of Mistral Large 4 (1T)

    Mistral AI, released 2026-10-29. Sparse MoE decoder, 1T total, 52B active, 1M context. Attention: MLA with modified DeepSeek Sparse Attention, index reuse, and KV sharing.

  • Architecture diagram of DeepSeek V4.1-Flash (552B)

    DeepSeek, released 2026-09-10. Sparse MoE decoder, 552B total, 8B active, 1M context. Attention: MLA-style CSA2 + SWA with cross-layer KV and sparse-index reuse.

  • Architecture diagram of Gemma 4 (E2B)

    Google, released 2026-04-02. Dense decoder, 5.1B parameters, 128K context. Attention: Multi-query attention with QK-Norm, unified K/V on global layers, p-RoPE on global layers, and 4:1 sliding-window/global attention.

  • Architecture diagram of Gemma 4 (E4B)

    Google, released 2026-04-02. Dense decoder, 8B parameters, 128K context. Attention: GQA with QK-Norm, unified K/V on global layers, p-RoPE on global layers, and 5:1 sliding-window/global attention.

Search the atlas

Jump to a model, concept or page