GQA
An attention mechanism optimization technique in which multiple query heads share a single set of key and value heads. This approach significantly reduces the GPU memory footprint of the KV Cache while preserving model performance close to that of standard multi-head attention.
Core Facts
Paged Attention (PagedAttention) is the core technology of vLLM, managing KV cache in blocks, while Flash Attention optimizes the memory access pattern of attention computation.
GQA (Grouped-Query Attention) and MQA (Multi-Query Attention) were the industry's solutions prior to MLA for alleviating the KV cache problem by sharing Key/Value heads.
GQA (Grouped Query Attention) is an attention mechanism between Multi-Head Attention (MHA) and Multi-Query Attention (MQA), which reduces KV Cache memory usage by grouping multiple Query heads to share Key-Value projections.
Timeline (last 90 days)
The official claims state that at 256K context, MBSA limits the main attention computation to within 4,096 tokens per KV group, and its kernel is 6.7 times faster than dense GQA.
PagedAttention and MQA/GQA are compression and scheduling techniques for addressing the KV Cache memory bottleneck.
On dense models and MoE models, covering both GQA and MLA attention mechanisms, with NVFP4 the accuracy gap between BitDecoding-FP4 and BF16 KV stays within 0.5 percentage points; with MXFP4 the gap is 1 percentage point.
DepthGraft is verified to be effective under both GQA and MLA attention mechanisms, indicating that its hierarchical reconstruction regularization effect does not depend on a specific attention implementation.
DepthGraft was experimented on dense models and MoE models ranging from 0.5B to 16B parameters, covering both GQA and MLA attention mechanisms.
Grouped-query attention (GQA) and head pruning can be used to strike a balance between the efficiency and performance of multi-head attention.
The developer manually implemented four core LLaMa architecture components—RoPE, GQA, RMSNorm, and SwiGLU—without relying on an existing training framework.
GQA and MQA save the most in long-context, large-batch, high-concurrency inference scenarios, but the compression benefit weakens in short-sequence or small-batch scenarios, and they carry the risk of reduced expressiveness.
The core difference among MHA, GQA, and MQA lies in how key-value heads are shared: MHA has an independent key-value head for each query head, GQA has a group of query heads sharing one set of key-value heads, and MQA has all query heads sharing one set of key-value heads.
The industry commonly uses architectural approaches such as GQA and MLA to compress the KV cache.
40 more timeline events
All Facts (20)
Paged Attention (PagedAttention) is the core technology of vLLM, managing KV cache in blocks, while Flash Attention optimizes the memory access pattern of attention computation.
80%VerifiedGQA (Grouped-Query Attention) and MQA (Multi-Query Attention) were the industry's solutions prior to MLA for alleviating the KV cache problem by sharing Key/Value heads.
75%VerifiedGQA (Grouped Query Attention) is an attention mechanism between Multi-Head Attention (MHA) and Multi-Query Attention (MQA), which reduces KV Cache memory usage by grouping multiple Query heads to share Key-Value projections.
65%VerifiedFlash Attention reduces the number of memory accesses through block-wise computation, while MQA and GQA reduce computational overhead by sharing key-value heads.
65%VerifiedLlama 3 8B has 32 layers, 8 KV heads (GQA architecture with 32 query heads), a head dimension of 128, and a KV cache of approximately 1.07 GB for a single sequence under FP16 with an 8192 context length.
65%UnverifiedGrouped-query attention (GQA) and head pruning can be used to strike a balance between the efficiency and performance of multi-head attention.
70%UnverifiedGQA reduces the size of the KV Cache by having multiple Query heads share the same set of Key-Value heads.
70%UnverifiedGrouped Query Attention (GQA) strikes a balance between inference efficiency and model quality.
70%UnverifiedFlash系列模型通常采用更小的参数规模、多查询注意力(MQA)或分组查询注意力(GQA)等高效注意力机制,以及模型蒸馏技术
70%Partially VerifiedGPT-OSS adopts a MoE (Mixture of Experts) architecture combined with Grouped Multi-Query Attention (GQA).
65%UnverifiedOn-device deployment often comes with mechanisms such as KV cache quantization (e.g., compressing to 4 or 8 bits), grouped-query attention (GQA), and sliding-window or sparse attention.
60%UnverifiedLFM2.5-24B-A2B uses a 40-layer architecture: 30 double-gated short convolution blocks + 10 GQA attention layers, 64 experts per MoE block, top-4 routing, a 131,072 token context, and a 128K vocabulary.
60%UnverifiedGrouped-query attention (GQA) was proposed by Ainslie et al. in 2023 and is a compromise between multi-head attention (MHA) and multi-query attention (MQA); Llama 3.1 8B uses 32 query heads divided into 8 groups, with each group of 4 query heads sharing 1 KV head, shrinking the KV cache by 4x compared to MHA.
60%UnverifiedAfter adopting GQA, Llama 3.3 70B has a KV Cache of approximately 320 KB per token.
60%UnverifiedMainstream open-source models such as Llama 3 and Qwen2/3 have already adopted GQA.
60%UnverifiedGQA allows multiple query heads to share the same set of KV heads; LLaMA-3 70B uses 8 KV heads corresponding to 64 query heads, making the KV Cache only 1/8 that of standard MHA.
60%UnverifiedKV Cache memory usage is proportional to the number of layers × number of attention heads × context length × precision; GQA reduces cache size by having multiple query heads share the same set of Key-Value heads, and this design has been adopted by the Llama 2/3 and Qwen series.
60%UnverifiedGQA reduces the GPU memory occupied by the KV Cache while maintaining the model's expressiveness by having multiple Query heads share the same set of Key-Value heads.
60%UnverifiedDeepSeek 8B adopts the GQA (Grouped Query Attention) attention mechanism to reduce VRAM usage during inference.
60%UnverifiedThe official claims state that at 256K context, MBSA limits the main attention computation to within 4,096 tokens per KV group, and its kernel is 6.7 times faster than dense GQA.
50%