Attention heads learn different ways to match a query with earlier tokens. Multi-head attention, or MHA, gives each query head its own key and value projections. Grouped-query attention, or GQA, shares a key/value projection among several query heads. That sharing saves cached state but changes the model’s parameterization.

If we had 32 query heads and moved to 8 K/V heads, the cache for those heads becomes roughly one quarter as large, holding sequence length, head dimension, layers and dtype fixed. But 32 learned K/V functions have just been compressed into 8. Loading tensors with the right shapes does not preserve the old function.

An arbitrary reshape is especially suspect. Even averaging the K/V projections within each intended group, as in the GQA uptraining paper, is an initialization for further training, not a promise that the converted model answers identically. Check exactly which query heads map to which K/V heads, the weight layout in the checkpoint and the serving kernel, and whether tensor parallel ranks agree on that mapping. A transpose error can be different from the expected quality loss caused by sharing.

I would separate those two with a small forward-pass comparison. Run the original model against a reference MHA implementation, then the converted checkpoint against a simple, independently checked GQA implementation. Compare per-layer K/V projections and logits on short prompts before touching cache behavior. If the reference GQA and production GQA agree, but both diverge from MHA, we probably have a real compression and adaptation problem. If the two GQA implementations disagree, debug the conversion or kernel first. Then uptrain and evaluate the converted model on long context, tool use and rare slices, not only average perplexity.

Would I automatically use the fewest K/V heads? No. The serving win depends on whether KV bandwidth or capacity was actually the limit. Fewer heads can save cache bytes while taking an unacceptable hit in quality. Choose the head count from a measured quality, memory and latency curve, and keep the old checkpoint as a rollback path. Grouped query attention cuts KV memory. Why might prefill still be expensive? asks why GQA does not remove prefill cost. Here the question is what happens to a trained model when its attention parameterization changes.

Consider a hypothetical group whose four original key projections respond to different features. Averaging them creates one shared projection. It cannot in general reproduce four distinct dot products for arbitrary queries and inputs. This is why the conversion is a lossy initialization even if averaging is implemented perfectly. Uptraining adapts the remaining parameters to the new sharing constraint, and does not guarantee every original behavior returns.

Record the group map and any permutation of query heads before comparing weights. A valid grouping in a reference implementation can become invalid if the serving kernel assumes contiguous groups in a different order. Tensor-parallel partitioning can add head replication or divisibility constraints, so calculate per-device cache use from the actual layout. The ideal fourfold reduction concerns K/V tensor storage with the stated dimensions. It does not promise fourfold total-device memory savings or fourfold speedup.

For a release, set quality tolerances for the tasks that justify the conversion, measure supported concurrency and latency at those tolerances, and test an actual checkpoint rollback. Compare under the same prompt lengths and output policy. A memory win measured on long chats may be valuable even if short single-request latency barely changes.