mlsanityData to 7 Oct 2026

An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encoding

arXiv 2406.07138 ↗First posted 11 Jun 2024cs.CLcited by 16

Not on the map. Why?

Abstract (arXiv)

Recently, many methods have been developed to extend the context length of pre-trained large language models (LLMs), but they often require fine-tuning at the target length (gg4K) and struggle to effectively utilize information from the middle part of the context. To address these issues, we propose Continuity-Relativity indExing with gAussian Middle (textttCREAM), which interpolates positional encodings by manipulating position indices. Apart from being simple, textttCREAM is training-efficient: it only requires fine-tuning at the pre-trained context window (e.g., Llama 2-4K) and can extend LLMs to a much longer target context length (e.g., 256K). To ensure that the model focuses more on the information in the middle, we introduce a truncated Gaussian to encourage sampling from the middle part of the context during fine-tuning, thus alleviating the "Lost-in-the-Middle" problem faced by long-context LLMs. Experimental results show that textttCREAM successfully extends LLMs to the target length for both Base and Chat versions of textttLlama2-7B with "Never Miss A Beat". Our code is publicly available at https://github.com/bigai-nlco/cream.

Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 33 of its 42 references that are in the map. First posted on arXiv 11 Jun 2024.

Builds on

33 of 42 references.

References · 33

  1. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  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. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  7. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  8. 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
  9. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  10. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  11. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  12. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
21 more
  1. 2018Self-Attention with Relative Position Representationscited by 1,112
  2. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  3. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
  4. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  5. 2021Efficient Attentions for Long Document Summarizationcited by 342
  6. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  7. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 302
  8. 2023Effective Long-Context Scaling of Foundation Modelscited by 301
  9. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 206
  10. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 200
  11. 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 194
  12. 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
  13. 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
  14. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
  15. 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
  16. 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 104
  17. 2024Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding?cited by 45
  18. 2023Giraffe: Adventures in Expanding Context Lengths in LLMscited by 32
  19. 2024Long Context Alignment with Short Instructions and Synthesized Positionscited by 22
  20. 2024Extending LLMs' Context Window with 100 Samplescited by 20
  21. 2024LLoCO: Learning Long Contexts Offlinecited by 16

Built on by

Cited by year (2026 to 7 Oct)

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

16 papers.

Sort:

By area:

  1. 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 23
  2. 2025LongReD: Mitigating Short-Text Degradation of Long-Context Large Language Models via Restoration Distillationcited by 14
  3. 2025Native Parallel Reasoner: Reasoning in Parallelism via Self-Distilled Reinforcement Learningcited by 12
  4. 2025ReflectEvo: Improving Meta Introspection of Small LLMs by Learning Self-Reflectioncited by 11
  5. 2025SoLoPO: Unlocking Long-Context Capabilities in LLMs via Short-to-Long Preference Optimizationcited by 10
  6. 2025TokenSwift: Lossless Acceleration of Ultra Long Sequence Generationcited by 4
  7. 2025Lost-in-the-Middle in Long-Text Generation: Synthetic Dataset, Evaluation Framework, and Mitigationcited by 3
  8. 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answeringcited by 3
  9. 2025Context-aware Biases for Length Extrapolationcited by 2
  10. 2025CCF: A Context Compression Framework for Efficient Long-Sequence Language Modelingcited by 1
  11. 2026RRAttention: Dynamic Block Sparse Attention via Per-Head Round-Robin Shifts for Long-Context Inferencecited by 1
  12. 2026Randomized YaRN Improves Length Generalization for Long-Context Reasoningcited by 1
4 more
  1. 2026Shuffle the Context: RoPE-Perturbed Self-Distillation for Long-Context Adaptationcited by 0
  2. 2026AgentGR: Semantic-aware Agentic Group Decision-Making Simulator for Group Recommendationcited by 0
  3. 2026GeoRoPE: Ground-Aware Rotary Adaptation for Remote Sensing Foundation Modelscited by 0
  4. 2026Learning how to Forget: Fine-tuning for Long-Context Sparse Attentioncited by 0