从 MHA 到 GQA:为什么现代 LLM 不再为每个 Query Head 分配独立的 KV?2026-11-05·5342 字·11 分钟Deep-Learning Attention LLM KV-Cache Inference Ml-Infra写完 Multi-Head Attention 和 Causal Attention 之后,我一直觉得 Attention 这条线已经差不多了——公式拆过了,routing space 的 factorization 也想明白了,Causal Mask 的因果约束也理清了。 直到最近看 Llama 2 的模型配置,发现一行让我停下来的参数: