# Fast Transformer Decoding: One Write-Head is All You Need

Preprint · Noam Shazeer

- Archive id: arxiv:1911.02150
- Published: 2019-11-06
- arXiv: https://arxiv.org/abs/1911.02150
- Source URL: https://arxiv.org/abs/1911.02150
- PDF: https://arxiv.org/pdf/1911.02150
- Provenance: arxiv

## Abstract

Multi-head attention layers, as used in the Transformer neural sequence model, are a powerful alternative to RNNs for moving information across and between sequences. While training these layers is generally fast and simple, due to parallelizability across the length of the sequence, incremental inference (where such paralleization is impossible) is often slow, due to the memory-bandwidth cost of repeatedly loading the large "keys" and "values" tensors. We propose a variant called multi-query attention, where the keys and values are shared across all of the different attention "heads", greatly reducing the size of these tensors and hence the memory bandwidth requirements of incremental decoding. We verify experimentally that the resulting models can indeed be much faster to decode, and incur only minor quality degradation from the baseline.

_Abstract reproduced under CC0-1.0 (arXiv descriptive metadata)._

Topics: [LLM Architectures & Pretraining](https://space-kitty.com/topics/llm-architectures)

Cited in dossiers:
- [LLM Architectures & Pretraining: State of the Field (October 2026)](https://space-kitty.com/dossiers/llm-architectures)

---
Space Kitty Archive · https://space-kitty.com · API: https://space-kitty.com/api/v1 · MCP: https://space-kitty.com/mcp · Premium: $0.20/request via x402 (Base Sepolia (testnet)). Metadata: arXiv (CC0), OpenAlex (CC0), Europe PMC (CC BY/CC0 works), ClinicalTrials.gov.
