CoWindow 注意力:全因果覆盖是一种集体属性

·

研究论文 · 2026/09/29

FullAttn 将完整的因果历史重复暴露给每个注意力头,即使使用 IO 高效的密集核,也会造成大量冗余计算和内存流量。我们提出 CoWA,一种结构化注意力架构,将因果历史的访问权分配到各 KV 头之间。所有头共享近对角窗口和前缀汇窗口,而互补的长程窗口划分剩余历史。它们的并集提供完整的因果覆盖,尽管每个头对远距离 token 的注意力是稀疏的。这种位置定义的注意力模式无需学习路由器或索引器,在训练和推理中一致使用,并与 KV 头张量并行对齐。在 8K 下的窗口匹配消融实验分离了互补长程分配的效果:CoWA 在 100% 集体覆盖下达到 89.73% 准确率,而 FullAttn 为 89.97%,重复长程窗口的表现则显著更差。在更广泛的匹配 token 预算的受控联想回忆比较中,随着上下文增长,CoWA 紧密跟随 FullAttn,而其他稀疏模式丢失了相当一部分联想。在 128K token 下使用张量并行的注意力算子基准测试中,CoWA 相比 FullAttn 将训练中的前向和反向延迟分别降低 7.4 倍和 8.6 倍,推理中的解码延迟降低 3.0 倍。其每 rank 峰值算子内存在训练中与 FullAttn 相当,在解码中低 7.6 倍。在从 0.6B 到 14B 参数的缩放律训练中,CoWA 在困惑度上紧密跟随 FullAttn,同时减少总训练 FLOPs。由此得到的 14B 模型和来自单独继续训练的 32B 模型在知识、推理和长上下文检索分数上与 FullAttn 相当。这些结果表明,完整的因果覆盖可以是头集合的集体属性,而不是每个头的重复属性。

该研究提出了一种创新的注意力架构,通过集体覆盖而非重复覆盖来提升效率,在保持模型性能的同时显著降低计算和内存开销,对大规模语言模型训练和推理有重要实用价值。

FullAttn repeatedly exposes the complete causal history to every attention head, creating substantial redundant computation and memory traffic even with IO-efficient dense kernels. We introduce CoWA, a structured attention architecture that distributes access to the causal history across KV heads. All heads share near-diagonal and prefix-sink windows, while complementary long-range windows partition the remaining history. Their union provides full causal coverage although each head attends sparsely to distant tokens. This position-defined attention pattern requires no learned router or indexer, is used consistently during training and inference, and aligns with KV-head tensor parallelism. A window-matched ablation at 8K isolates the effect of complementary long-range allocation: CoWA with 100% collective coverage reaches 89.73% accuracy, compared with 89.97% for FullAttn, while duplicated long-range windows perform substantially worse. Across a broader controlled associative-recall comparison with matched token budgets, CoWA closely tracks FullAttn as the context grows, whereas other sparse patterns lose a substantial fraction of the associations. In an attention-operator benchmark at 128K tokens with tensor parallelism, CoWA reduces forward and backward latency during training by 7.4x and 8.6x and decoding latency during inference by 3.0x over FullAttn. Its per-rank peak operator memory matches FullAttn during training and is 7.6x lower during decoding. Across scaling-law training from 0.6B to 14B parameters, CoWA closely tracks FullAttn in perplexity while reducing total training FLOPs. The resulting 14B models and 32B models from separate continued training achieve comparable knowledge, reasoning, and long-context retrieval scores to FullAttn. These results show that full causal coverage can be a collective property of the head ensemble rather than a duplicated property of every head.

阅读原文

参与讨论