mlsanityData to 7 Oct 2026

One Pass Streaming Algorithm for Super Long Token Attention Approximation in Sublinear Space

arXiv 2311.14652 ↗First posted 24 Nov 2023cs.LG cs.CL stat.MLcited by 6

Not on the map. Why?

Abstract (arXiv)

Attention computation takes both the time complexity of O(n2) and the space complexity of O(n2) simultaneously, which makes deploying Large Language Models (LLMs) in streaming applications that involve long contexts requiring substantial computational resources. In recent OpenAI DevDay (Nov 6, 2023), OpenAI released a new model that is able to support a 128K-long document, in our paper, we focus on the memory-efficient issue when context length n is much greater than 128K (n gg 2d). Considering a single-layer self-attention with Query, Key, and Value matrices Q, K, V ∈ ℝn × d, the polynomial method approximates the attention output T ∈ ℝn × d. It accomplishes this by constructing U1, U2 ∈ ℝn × t to expedite attention sf Attn(Q, K, V) computation within n1+o(1) time executions. Despite this, computing the approximated attention matrix U1U2^top ∈ ℝn × n still necessitates O(n2) space, leading to significant memory usage. In response to these challenges, we introduce a new algorithm that only reads one pass of the data in a streaming fashion. This method employs sublinear space o(n) to store three sketch matrices, alleviating the need for exact K, V storage. Notably, our algorithm exhibits exceptional memory-efficient performance with super-long tokens. As the token length n increases, our error guarantee diminishes while the memory usage remains nearly constant. This unique attribute underscores the potential of our technique in efficiently handling LLMs in streaming applications.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 65 of its 92 references that are in the map. First posted on arXiv 24 Nov 2023.

Builds on

65 of 92 references.

References · 65

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  8. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  9. 2020Longformer: The Long-Document Transformercited by 3,362
  10. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
  11. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  12. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
38 more
  1. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  3. 2023PaLM 2 Technical Reportcited by 1,154
  4. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  5. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  6. 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 696
  7. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  8. 2023Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruningcited by 408
  9. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
  10. 2023Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Timecited by 247
  11. 2020Synthesizer: Rethinking Self-Attention in Transformer Modelscited by 204
  12. 2023SantaCoder: don't reach for the stars!cited by 169
  13. 2023Representational Strengths and Limitations of Transformerscited by 132
  14. 2021Recent Advances in Deep Learning Based Dialogue Systems: A Systematic Surveycited by 130
  15. 2023A Theory for Emergence of Complex Skills in Language Modelscited by 111
  16. 2023Fast Attention Requires Bounded Entriescited by 102
  17. 2023LongEval: Guidelines for Human Evaluation of Faithfulness in Long-form Summarizationcited by 96
  18. 2021QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehensioncited by 91
  19. 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
  20. 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
  21. 2023Transformers as Support Vector Machinescited by 67
  22. 2023A Survey on Proactive Dialogue Systems: Problems, Methods, and Prospectscited by 66
  23. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  24. 2023Extractive Summarization via ChatGPT for Faithful Summary Generationcited by 58
  25. 2023Attention Scheme Inspired Softmax Regressioncited by 49
  26. 2023An Over-parameterized Exponential Regressioncited by 45
  27. 2023Embrace Divergence for Richer Insights: A Multi-document Summarization Benchmark and a Case Study on Summarizing Diverse Information from News Articlescited by 45
  28. 2023Solving Regularized Exp, Cosh and Sinh Regression Problemscited by 44
  29. 2023How to Capture Higher-order Correlations? Generalizing Matrix Softmax Attention to Kronecker Computationcited by 44
  30. 2023Algorithm and Hardness for Dynamic Attention Maintenance in Large Language Modelscited by 37
  31. 2023Randomized and Deterministic Attention Sparsification Algorithms for Over-parameterized Feature Dimensioncited by 37
  32. 2023On the Optimization and Generalization of Multi-head Attentioncited by 37
  33. 2023In-Context Learning for Attention Scheme: from Single Softmax Regression to Multiple Softmax Regression via a Tensor Trickcited by 32
  34. 2023A Fast Optimization View: Reformulating Single Layer Attention in LLM Based on Tensor and SVM Trick, and Solving It in Matrix Multiplication Timecited by 30
  35. 2023A Mathematical Abstraction for Balancing the Trade-off Between Creativity and Reality in Large Language Modelscited by 29
  36. 2023How to Protect Copyright Data in Optimization of Large Language Models?cited by 26
  37. 2023Trainable Transformer in Transformercited by 17
  38. 2020Space-Efficient Interior Point Method, with applications to Linear Programming and Maximum Weight Bipartite Matchingcited by 14

50 most cited of 65 All 65 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 2; 2026: 1.

6 papers.