Grouped-query attention (GQA) is a technique that significantly improves the efficiency of large language models during inference by reducing the memory bottleneck caused by the KV cache. Unlike traditional Multi-Head Attention (MHA) which uses a separate KV head for each query head, or Multi-Query Attention (MQA) which shares a single KV head across all query heads, GQA strikes a balance. It groups query heads and shares KV heads among these groups, drastically reducing the cache size and memory bandwidth requirements without a substantial loss in model quality. This approach, particularly with 8 KV heads, has been adopted by models like Llama and Mistral to make long-context LLMs more practical. AI
IMPACT Reduces memory bandwidth and cache size for LLMs, enabling more practical long-context generation.
RANK_REASON The item details a technical optimization for LLM inference related to attention mechanisms and KV cache efficiency. [lever_c_demoted from research: ic=1 ai=1.0]
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →