mlsanityData to 7 Oct 2026

Stream-CQSA: Exact Out-of-Memory Recovery for Attention

arXiv 2604.20819 ↗First posted 22 Apr 2026cs.LG cs.DCcited by 0

Not on the map. Why?

Abstract (arXiv)

Long-context large language models are limited not only by attention cost but also by out-of-memory (OOM) failures. A selected attention call may not fit in available device memory even when the kernel is optimized. Exact and approximate attention methods reduce memory use, but every fixed implementation still has a device-specific capacity boundary. We introduce Stream-CQSA, an attention-level OOM recovery framework based on CQS decomposition, derived from the theory of cyclic quorum sets (CQS). Stream-CQSA recursively partitions an infeasible attention call into independent subsequence tasks, executes each with a compatible inner kernel, and recomposes the local statistics to recover the full attention output. This recovery is exact relative to the wrapped attention kernel, whether that kernel is exact or approximate. Compared with FlashAttention-2, the major baseline, our native Stream-CQSA kernel improves 16-bit forward-output error relative to a dense float64 reference and matches 16-bit backward-gradient error where FlashAttention-2 fits in the GPU memory. At the longest feasible baseline length, it costs 1.5--1.9× the forward runtime and 2.1--2.4× the forward--backward runtime. Beyond that sequence length boundary, our method continues to return an output while FlashAttention-2 OOMs. Stream-CQSA is therefore not a faster attention method. Instead, it converts memory-capacity failure into a recoverable execution path by trading extra compute, host-device transfer, and recomposition for completion.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 23 of its 32 references that are in the map. First posted on arXiv 22 Apr 2026.

Builds on

23 of 32 references.

References · 23

  1. 2017Attention Is All You Needcited by 59,932
  2. 2025Qwen3 Technical Reportcited by 8,195
  3. 2020Scaling Laws for Neural Language Modelscited by 6,411
  4. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
  5. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  6. 2020Longformer: The Long-Document Transformercited by 3,362
  7. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  8. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  9. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  10. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  11. 2020Reformer: The Efficient Transformercited by 1,658
  12. 2020Rethinking Attention with Performerscited by 1,584
11 more
  1. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  2. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 448
  3. 2023LongLoRA: Efficient Fine-tuning of Long-Context Large Language Modelscited by 243
  4. 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 239
  5. 2023LongNet: Scaling Transformers to 1,000,000,000 Tokenscited by 201
  6. 2019Blockwise Self-Attention for Long Document Understandingcited by 158
  7. 2018Online normalizer calculation for softmaxcited by 154
  8. 2021Self-attention Does Not Need O(n2) Memorycited by 152
  9. 2021Sequence Parallelism: Long Sequence Training from System Perspectivecited by 125
  10. 2023Striped Attention: Faster Ring Attention for Causal Transformerscited by 52
  11. 2023DISTFLASHATTN: Distributed Memory-efficient Attention for Long-context LLMs Trainingcited by 28

Built on by

Not cited yet.