AI engineering glossary · Transformers LLM architecture

What is GQA (grouped-query attention)?

Grouped-query attention (also called GQA): A compromise between multi-head and multi-query attention: query heads are split into groups and each group shares one key and value head. It keeps most of the quality of full attention while cutting KV cache size, and is common in current open models.

Level: advancedTopic: Transformers LLM architecture

Grouped-query attention: an example

With 32 query heads and 8 key-value heads, each key-value head serves 4 query heads and the cache is 4 times smaller.

Related terms

More Transformers LLM architecture terms

Where you learn it

Grouped-query attention is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.