mlsanityData to 7 Oct 2026

Extending LLMs' Context Window with 100 Samples

arXiv 2401.07004 ↗First posted 13 Jan 2024cs.CLcited by 20

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) are known to have limited extrapolation ability beyond their pre-trained context window, constraining their application in downstream tasks with lengthy inputs. Recent studies have sought to extend LLMs' context window by modifying rotary position embedding (RoPE), a popular position encoding method adopted by well-known LLMs such as LLaMA, PaLM, and GPT-NeoX. However, prior works like Position Interpolation (PI) and YaRN are resource-intensive and lack comparative experiments to assess their applicability. In this work, we identify the inherent need for LLMs' attention entropy (i.e. the information entropy of attention scores) to maintain stability and introduce a novel extension to RoPE which combines adjusting RoPE's base frequency and scaling the attention logits to help LLMs efficiently adapt to a larger context window. We validate the superiority of our method in both fine-tuning performance and robustness across different context window sizes on various context-demanding tasks. Notably, our method extends the context window of LLaMA-2-7B-Chat to 16,384 with only 100 samples and 6 training steps, showcasing extraordinary efficiency. Finally, we also explore how data compositions and training curricula affect context window extension for specific downstream tasks, suggesting fine-tuning LLMs with lengthy conversations as a good starting point. We release our code and SFT data at https://github.com/GAIR-NLP/Entropy-ABF.

Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Builds on 38 of its 52 references that are in the map. First posted on arXiv 13 Jan 2024.

Builds on

38 of 52 references.

References · 38

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  7. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  8. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  9. 2020Longformer: The Long-Document Transformercited by 3,362
  10. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  11. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  12. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
26 more
  1. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  2. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  3. 2020Reformer: The Efficient Transformercited by 1,658
  4. 2020Rethinking Attention with Performerscited by 1,584
  5. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  6. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  7. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  8. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
  9. 2018Self-Attention with Relative Position Representationscited by 1,112
  10. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  11. 2016Training Deep Nets with Sublinear Memory Costcited by 825
  12. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  13. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
  14. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
  15. 2017Convolutional Sequence to Sequence Learningcited by 550
  16. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  17. 2021Efficient Attentions for Long Document Summarizationcited by 342
  18. 2021ZeRO-Offload: Democratizing Billion-Scale Model Trainingcited by 339
  19. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  20. 2023How Abilities in Large Language Models are Affected by Supervised Fine-tuning Data Compositioncited by 222
  21. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 206
  22. 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 110
  23. 2023Scaling Transformer to 1M tokens and beyond with RMTcited by 97
  24. 2021Do Long-Range Language Models Actually Use Long-Range Context?cited by 92
  25. 2019BP-Transformer: Modelling Long-Range Context via Binary Partitioningcited by 38
  26. 2023Giraffe: Adventures in Expanding Context Lengths in LLMscited by 32

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 10; 2025: 6; 2026: 4.

20 papers.

Sort:

By area:

  1. 2024How to Train Long-Context Language Models (Effectively)cited by 141
  2. 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 68
  3. 2024LongEmbed: Extending Embedding Models for Long Context Retrievalcited by 47
  4. 2024V2PE: Improving Multimodal Long-Context Capability of Vision-Language Models with Variable Visual Position Encodingcited by 28
  5. 2024T-RAG: Lessons from the LLM Trenchescited by 23
  6. 2024LoCoCo: Dropping In Convolutions for Long Context Compressioncited by 18
  7. 2025Long-Context Generalization with Sparse Attentioncited by 18
  8. 2024An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encodingcited by 16
  9. 2024What are the Essential Factors in Crafting Effective Long Context Multi-Hop Instruction Datasets? Insights and Best Practicescited by 14
  10. 2024Understanding the RoPE Extensions of Long-Context LLMs: An Attention Perspectivecited by 13
  11. 2025Revisiting Long-context Modeling from Context Denoising Perspectivecited by 5
  12. 2024AIDBench: A benchmark for evaluating the authorship identification capability of large language modelscited by 4
8 more
  1. 2025Beyond Length: Quantifying Long-Range Information for Long-Context LLM Pretraining Datacited by 4
  2. 2025Evaluating LLaMA 3.2 for Software Vulnerability Detectioncited by 3
  3. 2025Long-Short Alignment for Effective Long-Context Modeling in LLMscited by 3
  4. 2026AdaSplash-2: Faster Differentiable Sparse Attentioncited by 3
  5. 2025Can LLMs Replace Humans During Code Chunking?cited by 2
  6. 2026Training Long-Context Vision-Language Models Effectively with Generalization Beyond 128K Contextcited by 1
  7. 2026ExtraVAR: Stage-Aware RoPE Remapping for Resolution Extrapolation in Visual Autoregressive Modelscited by 0
  8. 2026LLMs for Academic Workflows: An Evaluation of Literature Reviews Generated with Short and Long Context Windows of LLMscited by 0