跳转至

文章背景与核心概要

在大语言模型 (Large Language Model, LLM) 处理超长文本的场景下,传统全注意力机制 (FullAttn) 会让每一个注意力头都重复扫描完整的因果历史 Token ,带来了庞大的冗余计算和显存带宽瓶颈。为攻克这一难题,本文研究团队创新性地提出了 CoWindow Attention (CoWA) 架构,将全因果历史的访问权限巧妙分散到不同的键值头 (KV-head) 中,变“单头重复全扫描”为“多头协同全覆盖”。在 CoWA 架构下,所有注意力头共同共享近邻对角窗口与前缀注意力汇聚点 (Prefix-Sink) ,而将剩余的长程历史切分为互补的滑动窗口;每个单独的注意力头虽只进行稀疏采样,但所有头聚合后的并集却能完整覆盖 100% 的因果上下文。这种基于确定性位置规则的设计无需复杂的动态路由模块,能天然契合张量并行加速;实测表明,在 128K 超长序列下,CoWA 训练反向传播延迟降低为原来的 \(\frac{1}{8.6}\) ,解码显存开销降低为原来的 \(\frac{1}{7.6}\) ,并在 14B 与 32B 规模下保持了完全媲美 FullAttn 的卓越性能。


CoWindow 注意力:全因果覆盖是一种群体协同特性

CoWindow Attention: Full Causal Coverage Is a Collective Property

作者: Jingze Shi, Zhangyang Peng, Xianduo Li, Yanlin Qi, Xiaotian Lin, Haoxian Chen, Liangdong Wang, Guang Liu, Yuyu Luo
arXiv ID: arXiv:2609.32704 [cs.AI]
提交时间: 2026年9月26日
许可协议: Creative Commons Attribution 4.0 (查看 协议图示)

Authors: Jingze Shi, Zhangyang Peng, Xianduo Li, Yanlin Qi, Xiaotian Lin, Haoxian Chen, Liangdong Wang, Guang Liu, Yuyu Luo
ArXiv ID: arXiv:2609.32704 [cs.AI]
Submitted: 26 September 2026
License: Creative Commons Attribution 4.0 (View License Image)


📋 内容概要

📋 Summary

传统的注意力机制 (如 FullAttn ) 会让每一个注意力头都重复扫描完整的因果历史 Token ,这在底层硬件上引发了极其庞大的冗余计算和显存带宽开销。

Traditional attention mechanisms (such as FullAttn) repeatedly expose the complete causal history to every single attention head, creating substantial redundant computation and memory traffic.

为了解决这个问题,作者团队推出了 CoWindow Attention (CoWA) 架构。这是一种结构化的注意力设计,它将因果历史的访问权限合理分摊到各个键值头 (KV-head) 上,而不是在每个头中进行机械复制:

To solve this, the authors introduce CoWindow Attention (CoWA), a structured attention architecture that distributes access to the causal history across Key-Value (KV) heads rather than duplicating it:

  • 共享窗口 (Shared Windows) : 所有注意力头共同共享主对角线附近的近邻窗口以及前缀注意力汇 (prefix-sink) 窗口。
  • 分片长程窗口 (Partitioned Long-Range Windows) : 剩余的历史上下文则被互补的长程窗口切分与分配。
  • 协同全覆盖 (Collective Coverage) : 尽管每个独立的注意力头仅稀疏地关注远端 Token ,但它们组合并集后即可实现 100% 的全因果覆盖。
  • Shared Windows: All heads share near-diagonal and prefix-sink windows.
  • Partitioned Long-Range Windows: Complementary long-range windows partition the remaining history.
  • Collective Coverage: While each individual head attends sparsely to distant tokens, their union provides full causal coverage.

这种由位置规则直接决定的固定稀疏模式,既不需要额外训练路由器或动态索引器,在模型预训练与推理阶段也始终保持严格一致,同时能够天然无缝地契合 KV-head 的张量并行计算。

This position-defined pattern requires no learned router or indexer, remains consistent across training and inference, and naturally aligns with KV-head tensor parallelism.


📊 核心发现与性能亮点

📊 Key Findings & Performance Highlights

  • 模型精度 (Accuracy) : 在 8K 上下文 Token 的同窗口消融实验中,具备 100% 协同覆盖特性的 CoWA 取得了 89.73% 的准确率 ,与 FullAttn 的 89.97% 几乎完全持平,并且大幅超越了采用重复长程窗口的基线方案。
  • 计算效率与运行提速 (Efficiency & Speed) : 在结合张量并行的 128K 超长序列注意力算子基准测试中,CoWA 相比 FullAttn 实现了显著的性能跃升:
  • 训练阶段前向传播延迟降低为原来的 \(\frac{1}{7.4}\) (加速 7.4 倍) ;
  • 训练阶段反向传播延迟降低为原来的 \(\frac{1}{8.6}\) (加速 8.6 倍) ;
  • 推理阶段解码延迟降低为原来的 \(\frac{1}{3.0}\) (加速 3.0 倍) 。
  • 显存深度优化 (Memory Optimization) : 在训练期间,各计算卡 (Rank) 的峰值算子显存占用与 FullAttn 基本一致;而在推理自回归解码期间,峰值显存消耗大幅降低至原来的 \(\frac{1}{7.6}\) 。
  • 缩放定律 (Scaling Laws) : 在覆盖 0.6B 到 14B 参数规模的缩放定律训练实验中,CoWA 在显著降低全流程训练计算量 (FLOPs) 的同时,其困惑度表现与 FullAttn 紧密契合。基于此训练出的 14B 与 32B 最终模型,在知识储备、逻辑推理以及长上下文检索等核心基准测试中的得分均与 FullAttn 模型不相上下。
  • Accuracy: In a window-matched ablation at 8K context tokens, CoWA achieves 89.73% accuracy (with 100% collective coverage), compared to 89.97% for FullAttn, significantly outperforming duplicated long-range window baselines.
  • Efficiency & Speed: In a 128K-token attention-operator benchmark with tensor parallelism, CoWA improves performance over FullAttn by:
  • 7.4× reduction in training forward latency.
  • 8.6× reduction in training backward latency.
  • 3.0× reduction in inference decoding latency.
  • Memory Optimization: Per-rank peak operator memory matches FullAttn during training and is 7.6× lower during decoding.
  • Scaling Laws: Across scaling-law training runs from 0.6B to 14B parameters, CoWA closely tracks FullAttn in perplexity while reducing total training FLOPs. Resulting 14B and 32B models achieve comparable knowledge, reasoning, and long-context retrieval scores to FullAttn models.

🔗 相关链接与学术资源