mlsanityData to 7 Oct 2026

LongRecipe: Recipe for Efficient Long Context Generalization in Large Language Models

arXiv 2409.00509 ↗First posted 31 Aug 2024cs.CLcited by 23

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) face significant challenges in handling long-context tasks because of their limited effective context window size during pretraining, which restricts their ability to generalize over extended sequences. Meanwhile, extending the context window in LLMs through post-pretraining is highly resource-intensive. To address this, we introduce LongRecipe, an efficient training strategy for extending the context window of LLMs, including impactful token analysis, position index transformation, and training optimization strategies. It simulates long-sequence inputs while maintaining training efficiency and significantly improves the model's understanding of long-range dependencies. Experiments on three types of LLMs show that LongRecipe can utilize long sequences while requiring only 30% of the target context window size, and reduces computational training resource over 85% compared to full sequence training. Furthermore, LongRecipe also preserves the original LLM's capabilities in general tasks. Ultimately, we can extend the effective context window of open-source LLMs from 8k to 128k, achieving performance close to GPT-4 with just one day of dedicated training using a single GPU with 80G memory. Our code is released at https://github.com/zhiyuanhubj/LongRecipe.

Key facts. Cited by 23 papers in the map (data through 7 Oct 2026). Builds on 38 of its 46 references that are in the map. First posted on arXiv 31 Aug 2024.

Builds on

38 of 46 references.

References · 38

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  5. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  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. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
  9. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
  10. 2024Qwen2 Technical Reportcited by 2,076
  11. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  12. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
26 more
  1. 2024ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Toolscited by 1,096
  2. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  3. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  4. 2024Yi: Open Foundation Models by 01.AIcited by 706
  5. 2023WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instructcited by 618
  6. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  7. 2023Ring Attention with Blockwise Transformers for Near-Infinite Contextcited by 448
  8. 2022DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scalecited by 403
  9. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
  10. 2024Model Merging in LLMs, MLLMs, and Beyond: Methods, Theories, Applications and Opportunitiescited by 247
  11. 2023DeepSpeed Ulysses: System Optimizations for Enabling Training of Extreme Long Sequence Transformer Modelscited by 239
  12. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 200
  13. 2024Data Engineering for Scaling Language Models to 128K Contextcited by 183
  14. 2021Hurdles to Progress in Long-form Question Answeringcited by 166
  15. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  16. 2022A Length-Extrapolatable Transformercited by 123
  17. 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 120
  18. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
  19. 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
  20. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
  21. 2022An Empirical Survey on Long Document Summarization: Datasets, Models and Metricscited by 74
  22. 2024Training-Free Long-Context Scaling of Large Language Modelscited by 61
  23. 2024Contextual Position Encoding: Learning to Count What's Importantcited by 53
  24. 2024With Greater Text Comes Greater Necessity: Inference-Time Training Helps Long Text Generationcited by 36
  25. 2024Resonance RoPE: Improving Context Length Generalization of Large Language Modelscited by 25
  26. 2024Long Context is Not Long at All: A Prospector of Long-Dependency Data for Large Language Modelscited by 15

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 6; 2025: 12; 2026: 5.

23 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. 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 60
  4. 2024AIM: Adaptive Inference of Multi-Modal LLMs via Token Merging and Pruningcited by 43
  5. 2024V2PE: Improving Multimodal Long-Context Capability of Vision-Language Models with Variable Visual Position Encodingcited by 28
  6. 2025LongProc: Benchmarking Long-Context Language Models on Long Procedural Generationcited by 28
  7. 2025LongRoPE2: Near-Lossless LLM Context Window Scalingcited by 21
  8. 2025QFFT, Question-Free Fine-Tuning for Adaptive Reasoningcited by 15
  9. 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
  10. 2025WildLong: Synthesizing Realistic Long-Context Instruction Data at Scalecited by 9
  11. 2026FOREVER: Forgetting Curve-Inspired Memory Replay for Language Model Continual Learningcited by 7
  12. 2025Scale-invariant Attentioncited by 5
11 more
  1. 2025AIMMerging: Adaptive Iterative Model Merging Using Training Trajectories for Language Model Continual Learningcited by 4
  2. 2025ConTextual: Improving Clinical Text Summarization in LLMs with Context-preserving Token Filtering and Knowledge Graphscited by 3
  3. 2025Improving Alignment in LVLMs with Debiased Self-Judgmentcited by 3
  4. 2025Spotlight Attention: Towards Efficient LLM Generation via Non-linear Hashing-based KV Cache Retrievalcited by 2
  5. 2026DySCO: Dynamic Attention-Scaling Decoding for Long-Context Language Modelscited by 2
  6. 2025Classic4Children: Adapting Chinese Literary Classics for Children with Large Language Modelcited by 1
  7. 2025CacheFocus: Dynamic Cache Re-Positioning for Efficient Retrieval-Augmented Generationcited by 0
  8. 2025On the Limitations and Capabilities of Position Embeddings for Length Generalizationcited by 0
  9. 2026UT-ACA: Uncertainty-Triggered Adaptive Context Allocation for Long-Context Inferencecited by 0
  10. 2026Shuffle the Context: RoPE-Perturbed Self-Distillation for Long-Context Adaptationcited by 0
  11. 2026Cracks in the Foundation: Seemingly Minor Architectural Choices Impact Long Context Extensioncited by 0