CoWindow Attention: Full Causal Coverage Is a Collective Property
Organizations: The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China. · Beijing Academy of Artificial Intelligence, Beijing, China. · Université Paris Cité, Paris, France.
Abstract
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.
Figures & tables
| Layout | Window Assignment | Long-Range Coverage | 1K | 2K | 4K | 8K |
| FullAttn | Full history per head | 100% | 100 | 100 | 100 | 89.97 |
| SWA | No long-range window | 0% | 100 | 17.48 | 14.12 | 5.34 |
| 1 unique window | window heads | 12.5% | 100 | 53.53 | 32.99 | 21.32 |
| 2 unique windows | windows heads | 25% | 100 | 62.74 | 40.37 | 32.92 |
| 4 unique windows | windows heads | 50% | 100 | 83.91 | 61.75 | 52.32 |
| CoWA | windows head | 100% | 100 | 100 | 100 | 89.73 |
| Model Scale | Method | Knowledge | Reasoning | RULER 32K | RULER 128K |
|---|---|---|---|---|---|
| 14B | FullAttn | 72.32 | 64.46 | 89.42 | 65.84 |
| 14B | MoBA | 70.58 | 59.71 | 87.17 | 61.52 |
| 14B | DSA | 70.23 | 63.28 | 87.67 | 64.05 |
| 14B | CoWA (ours) | 72.70 | 64.87 | 89.13 | 66.60 |
| 32B | FullAttn | 75.62 | 75.67 | 92.70 | 82.03 |
| 32B | CoWA (ours) | 76.07 | 75.53 | 92.58 | 81.78 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Mechanism | Selected Attention | Selection Overhead | Auxiliary State |
|---|---|---|---|
| FullAttn | - | - | |
| MoBA | |||
| DSA | |||
| CoWA | per QO block |
| Algo | warmups | runs | batch | selector | precision | ||||
|---|---|---|---|---|---|---|---|---|---|
| FullAttn 1 1 1 The FullAttn implementation is available at github.com/Dao-AILab/flash-attention . | 25 | 100 | 1 | 64 | 8 | 128 | 128 | - | BF16 |
| MoBA 2 2 2 The MoBA implementation is available at https://github.com/MoonshotAI/MoBA . | 25 | 100 | 1 | 64 | 64 | 128 | 128 | BF16 | |
| DSA 3 3 3 The DSA indexer implementation is available at github.com/deepseek-ai/DeepGEMM . , 4 4 4 The DSA implementation is available at github.com/Dao-AILab/flash-attention/flash_attn/cute . | 25 | 100 | 1 | 64 | 1 | 576 | 512 | FP8 indexer | BF16/FP8 |
| CoWA | 25 | 100 | 1 | 64 | 8 | 128 | 128 | fused window | BF16 |
| Algo | PST FLOPs | 1K | 2K | 4K | 8K | 16K | 32K | 64K | 128K |
|---|---|---|---|---|---|---|---|---|---|
| FullAttn | 32768 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536 | 131072 |
| MoBA | 32768 | 1024 | 1024 | 1536 | 2048 | 3072 | 5120 | 9216 | 17408 |
| DSA | 139264 | 256 | 288 | 352 | 480 | 736 | 1248 | 2272 | 4320 |
| CoWA | 32768 | 1024 | 1152 | 1408 | 1920 | 2944 | 4992 | 9088 | 17280 |
| Algo | SeqLen | Fwd Lat. | Bwd Lat. | Dec Lat. | Fwd Mem. | Bwd Mem. | Dec Mem. |
|---|---|---|---|---|---|---|---|
| FullAttn | 1,024 | 0.015 | 0.055 | 0.003 | 4.531 | 14.094 | 0.504 |
| FullAttn | 2,048 | 0.043 | 0.149 | 0.004 | 9.063 | 28.188 | 1.004 |
| FullAttn | 4,096 | 0.153 | 0.468 | 0.007 | 18.125 | 56.375 | 2.004 |
| FullAttn | 8,192 | 0.572 | 1.699 | 0.009 | 36.250 | 112.750 | 4.004 |
| FullAttn | 16,384 | 2.179 | 6.455 | 0.012 | 72.500 | 225.500 | 8.004 |
| FullAttn | 32,768 | 8.570 | 24.449 | 0.018 | 145.000 | 451.000 | 16.004 |
| Algos | Params | PT/LCT Tok | Batch | PT/LCT LR | PST FLOPs | PT Bgt | LCT Bgt | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FullAttn | 0.6B | 12B,1.5B | 0.256M | 1e-3,1e-4 | 28 | 1024 | 16 | 8 | 128 | 128 | 8192 | 4096 | 32768 |
| MoBA | 0.6B | 12B,1.5B | 0.256M | 1e-3,1e-4 | 28 | 1024 | 16 | 16 | 128 | 128 | 8192 | 1536 | 5120 |
| DSA | 0.6B | 12B,1.5B | 0.256M | 1e-3,1e-4 | 28 | 1024 | 16 | 1 | 576 | 512 | 34816 | 352 | 1248 |
| CoWA | 0.6B | 12B,1.5B | 0.256M | 1e-3,1e-4 | 28 | 1024 | 16 | 8 | 128 | 128 | 8192 | 1408 | 4992 |
| FullAttn | 1.7B | 34B,4B | 0.512M | 8e-4,8e-5 | 28 | 2048 | 16 | 8 | 128 | 128 | 8192 | 4096 | 32768 |
| MoBA | 1.7B | 34B,4B | 0.512M | 8e-4,8e-5 | 28 | 2048 | 16 | 16 | 128 | 128 | 8192 | 1536 | 5120 |
| Model | MMLU | MMLU-Pro | BBH | HellaSwag | OBQA | WinoGrande | Avg |
|---|---|---|---|---|---|---|---|
| Gen|5-shot | 5-shot | CoT|3-shot | 5-shot | 5-shot | 5-shot | ||
| 14B-Non-Thinking, temperature=0.6, top_k=20, top_p=0.95, max_gen_toks=32768, seed=[0, 42, 233, 666, 1234] | |||||||
| FullAttn | 78.21 0.31 | 64.96 0.46 | 82.59 0.48 | 80.64 0.38 | 49.4 | 78.16 1.14 | 72.32 |
| MoBA | 76.34 0.46 | 58.73 0.83 | 82.3 0.41 | 80.2 0.34 | 49.7 2.05 | 76.24 1.45 | 70.58 |
| DSA | 72.72 0.53 | 59.92 0.62 | 81.62 0.63 | 80.01 0.33 | 49.53 2.24 | 77.63 1.17 | 70.23 |
| CoWA (ours) | 79.04 0.28 | 64.89 0.43 | 83.64 0.51 | 80.3 0.31 | 49.9 2.01 | 78.48 1.23 | 72.7 |
| Model | PIQA | GSM8K | Hendrycks-Math | ARC-C | AGIEval | GPQA-Diamond | Avg |
|---|---|---|---|---|---|---|---|
| 5-shot | CoT|4-shot | CoT|4-shot | 0-shot | 0-shot | CoT|3-shot | ||
| 14B-Non-Thinking, temperature=0.6, top_k=20, top_p=0.95, max_gen_toks=32768, seed=[0, 42, 233, 666, 1234] | |||||||
| FullAttn | 81.63 0.86 | 90.32 0.93 | 62.46 0.65 | 61.95 1.44 | 50.56 0.71 | 39.87 3.47 | 64.46 |
| MoBA | 77.73 0.93 | 91.29 0.97 | 39.0 1.38 | 62.45 1.7 | 48.96 0.87 | 38.88 3.81 | 59.71 |
| DSA | 80.42 0.77 | 90.52 0.99 | 55.99 0.82 | 62.04 1.29 | 47.6 0.63 | 43.11 4.52 | 63.28 |
| CoWA (ours) | 81.5 0.72 | 90.58 0.83 | 62.31 0.62 | 62.1 1.62 | 50.44 0.76 | 42.33 3.17 | 64.87 |
| Model | NIAH-S | NIAH-MK | NIAH-MQ | NIAH-MV | RULER-VT | RULER-CWE | RULER-FWE | RULER-QA | Avg |
|---|---|---|---|---|---|---|---|---|---|
| 14B Native 32K Sequence Length, seed=[0, 42, 233, 666, 1234] | |||||||||
| FullAttn | 100 0 | 98.0 0.65 | 98.8 0.68 | 95.5 0.72 | 99.44 0.2 | 75.7 0.69 | 91.67 0.71 | 56.28 1.2 | 89.42 |
| MoBA | 99.8 0.004 | 94.4 0.63 | 98.2 0.73 | 95.1 0.7 | 99.0 0.32 | 67.35 0.96 | 91.44 0.69 | 52.12 1.64 | 87.17 |
| DSA | 100 0 | 95.6 0.68 | 98.0 0.77 | 96.1 0.76 | 99.24 0.26 | 69.25 0.87 | 91.74 0.67 | 51.42 1.43 | 87.67 |
| CoWA (ours) | 100 0 | 96.96 0.71 | 98.7 0.69 | 95.2 0.73 | 99.28 0.21 | 72.6 0.8 | 92.53 0.66 | 57.74 1.14 | 89.13 |
| 32B Native 32K Sequence Length, seed=[0, 42, 233, 666, 1234] | |||||||||
Efficient Attention
Efficient attention reduces the compute, memory traffic, and cache costs of Transformer attention while preserving useful long-range interactions.
See all 134 papers