mlsanityData to 14 Oct 2026

Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modeling

arXiv 2410.01651 ↗First posted 2 Oct 2024cs.CL cs.AIcited by 9

Not on the map. Why?

Abstract (arXiv)

Despite the success of Transformers, handling long contexts remains challenging due to the limited length generalization and quadratic complexity of self-attention. Thus Transformers often require post-training with a larger attention window, significantly increasing computational and memory costs. In this paper, we propose a novel attention mechanism based on dynamic context, Grouped Cross Attention (GCA), which can generalize to 1000 times the pre-training context length while maintaining the ability to access distant information with a constant attention window size. For a given input sequence, we split it into chunks and use each chunk to retrieve top-k relevant past chunks for subsequent text generation. Specifically, unlike most previous works that use an off-the-shelf retriever, our key innovation allows the retriever to learn how to retrieve past chunks that better minimize the auto-regressive loss of subsequent tokens in an end-to-end manner. Such a mechanism accommodates retrieved chunks with a fixed-size attention window to achieve long-range information access, significantly reducing computational and memory costs during training and inference. Experiments show that GCA-based models achieve near-perfect accuracy in passkey retrieval for 16M context lengths, which is 1000 times the training length.

Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 35 of its 45 references that are in the map. First posted on arXiv 2 Oct 2024.

Builds on

35 of 45 references.

References · 35

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2023GPT-4 Technical Reportcited by 18,396
  4. 2024The Llama 3 Herd of Modelscited by 14,715
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  6. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  7. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  8. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  9. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  10. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
  11. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  12. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
23 more
  1. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
  2. 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,317
  3. 2021Improving language models by retrieving from trillions of tokenscited by 1,293
  4. 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
  5. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
  6. 2016Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyondcited by 812
  7. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
  8. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
  9. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
  10. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 457
  11. 2024xLSTM: Extended Long Short-Term Memorycited by 327
  12. 2022Memorizing Transformerscited by 226
  13. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
  14. 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 200
  15. 2022Block-Recurrent Transformerscited by 110
  16. 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
  17. 2020Memory Transformercited by 76
  18. 2024Length Generalization of Causal Transformers without Position Encodingcited by 47
  19. 2023Retrieval-Pretrained Transformer: Long-range Language Modeling with Self-retrievalcited by 20
  20. 2021R2D2: Recursive Transformer based on Differentiable Tree for Interpretable Hierarchical Language Modelingcited by 19
  21. 2022Fast-R2D2: A Pretrained Recursive Neural Network based on Pruned CKY for Grammar Induction and Text Representationcited by 15
  22. 2024Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scalecited by 10
  23. 2023Augmenting Transformers with Recursively Composed Multi-grained Representationscited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 5.

9 papers.