arXiv:2510.04476cs.CLcs.AI2025-10被引 5

通过压缩潜在空间实现高效注意力,显著降低计算与内存开销。

Compressed Convolutional Attention: Efficient Attention in a Compressed Latent Space

  • 将查询、键、值压缩到共享潜在空间内进行注意力计算
  • 在16k序列下预填充延迟降低1.7倍,反向传播加速1.3倍
  • 支持灵活压缩,8倍缓存压缩仍保持原MHA性能,适合长文本场景

多头注意力(MHA)的二次计算复杂度和线性增长的键值缓存使其在训练与推理时成本高昂。已有方法如分组查询注意力(GQA)和多潜在注意力(MLA)虽缩减了缓存,但未显著降低计算量,而计算量决定预填充与训练速度。本文提出压缩卷积注意力(CCA),将查询、键、值降维后在共享潜在空间中完成全部注意力操作,一次性减少参数、缓存与浮点运算量,压缩因子可调。由于与头共享正交,进一步结合形成压缩卷积分组查询注意力(CCGQA),在计算-带宽权衡曲线上实现更优性能,用户可按需调节压缩程度而不牺牲质量。实验表明,在相同缓存压缩率下,CCGQA在密集模型与混合专家(MoE)模型上均优于GQA与MLA;在缓存仅为GQA与MLA一半的条件下,仍以8倍缓存压缩保持与标准MHA相当性能,且注意力计算量大幅下降,训练与预填充速度明显提升。在H100 GPU上,16k序列下预填充延迟降低约1.7倍,反向传播加速约1.3倍。

原文摘要 · Abstract (English)

Multi-headed Attention's (MHA) quadratic compute and linearly growing KV-cache make long-context transformers expensive to train and serve. Prior works such as Grouped Query Attention (GQA) and Multi-Latent Attention (MLA) shrink the cache, speeding decode, but leave compute, which determines prefill and training speed, largely unchanged. We introduce Compressed Convolutional Attention (CCA), a novel attention method which down-projects queries, keys, and values and performs the entire attention operation inside the shared latent space. This simple design dramatically cuts parameters, KV-cache, and FLOPs all at once by the desired compression factor. Because CCA is orthogonal to head-sharing, we combine the two to form Compressed Convolutional Grouped Query Attention (CCGQA), which further tightens the compute-bandwidth Pareto frontier so that users can tune compression toward either FLOP or memory limits without sacrificing quality. Experiments show that CCGQA consistently outperforms both GQA and MLA at equal KV-cache compression on dense and MoE models. Additionally, we show that CCGQA outperforms all other attention methods on MoE models with half the KV-cache of GQA and MLA, achieving an 8x KV-cache compression with no drop in performance compared to standard MHA. CCA and CCGQA also dramatically reduce the FLOP cost of attention which leads to substantially faster training and prefill than existing methods. On H100 GPUs, our fused CCA/CCGQA kernel reduces prefill latency by about 1.7x at a sequence length of 16k relative to MHA, and accelerates backward by about 1.3x.

注意力机制模型压缩长序列高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。