[KongchangAI]
Concept多查询注意力 / Multi-Query Attention

MQA

An attention mechanism optimization technique in which all query heads share a single set of key-value heads. Compared to Grouped Query Attention (GQA), MQA has smaller KV cache overhead but incurs relatively greater model quality loss, making it a more extreme variant of GQA.

Core Facts

Timeline (last 90 days)

Oct 26

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.

Unverified50%
Oct 26

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.

Unverified50%
Oct 18

The architecture uses a single shared KV head (num_key_value_heads=1, i.e. MQA form), with head_dim of 512 to compensate for expressiveness.

Unverified50%
Oct 16

MQA (multi-query attention) has all heads share a single set of KVs; compared with GQA, GQA achieves a better balance between quality and efficiency.

Unverified50%
Sep 15

The compressed KV sharing strategy is in the same spirit as Multi-Query Attention (MQA) and Grouped-Query Attention (GQA), but with a coarser sharing granularity.

Unverified50%
Sep 12

In MQA (Multi-Query Attention), all query heads share a single set of KVs, resulting in a smaller cache but with relatively greater quality degradation.

Unverified50%
Sep 12

GQA can reduce KV Cache memory during inference to 1/4 of MHA while retaining stronger modeling capability than MQA

Unverified50%
Sep 11

MQA has all Query heads share the same set of KV, while GQA groups several Query heads together to share one set of KV, serving as a compromise between MHA and MQA.

Unverified50%
Sep 6

Flash models typically use GQA or MQA technology to compress the KV Cache by 4–8×, thereby supporting higher concurrency on the same hardware.

Unverified50%
Sep 5

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.

Verified65%

2 more timeline events

All Facts (14)

Verified

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.

75%
Verified

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.

65%
Verified

Flash Attention reduces the number of memory accesses through block-wise computation, while MQA and GQA reduce computational overhead by sharing key-value heads.

65%
Unverified

Flash系列模型通常采用更小的参数规模、多查询注意力(MQA)或分组查询注意力(GQA)等高效注意力机制,以及模型蒸馏技术

70%
Unverified

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.

50%
Unverified

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.

50%
Unverified

The architecture uses a single shared KV head (num_key_value_heads=1, i.e. MQA form), with head_dim of 512 to compensate for expressiveness.

50%
Unverified

MQA (multi-query attention) has all heads share a single set of KVs; compared with GQA, GQA achieves a better balance between quality and efficiency.

50%
Unverified

The compressed KV sharing strategy is in the same spirit as Multi-Query Attention (MQA) and Grouped-Query Attention (GQA), but with a coarser sharing granularity.

50%
Unverified

In MQA (Multi-Query Attention), all query heads share a single set of KVs, resulting in a smaller cache but with relatively greater quality degradation.

50%
Unverified

GQA can reduce KV Cache memory during inference to 1/4 of MHA while retaining stronger modeling capability than MQA

50%
Unverified

MQA has all Query heads share the same set of KV, while GQA groups several Query heads together to share one set of KV, serving as a compromise between MHA and MQA.

50%
Unverified

Flash models typically use GQA or MQA technology to compress the KV Cache by 4–8×, thereby supporting higher concurrency on the same hardware.

50%
Unverified

GQA 通过让多个 Query 头共享同一组 Key-Value 头,在保持模型表达力的同时降低了 KV Cache 的显存占用

50%

Source Articles