GQA's Core: How it Differs from MHA and MQA

Grouped-Query Attention (GQA) balances Multi-Head Attention (MHA) and Multi-Query Attention (MQA) by grouping query heads to share distinct key/value pairs. MHA uses unique key/value projections per head for high quality but high memory, while MQA shares a single key/value pair for maximum memory savings but potential quality loss. GQA offers a compromise, retaining most of MHA's quality with significant efficiency gains.

Sources

Open the full topic