CLEX: Continuous Length Extrapolation for Large Language Models
Not on the map. Why?
Abstract (arXiv)
Transformer-based Large Language Models (LLMs) are pioneering advances in many natural language processing tasks, however, their exceptional capabilities are restricted within the preset context window of Transformer. Position Embedding (PE) scaling methods, while effective in extending the context window to a specific length, demonstrate either notable limitations in their extrapolation abilities or sacrificing partial performance within the context window. Length extrapolation methods, although theoretically capable of extending the context window beyond the training sequence length, often underperform in practical long-context applications. To address these challenges, we propose Continuous Length EXtrapolation (CLEX) for LLMs. We generalise the PE scaling approaches to model the continuous dynamics by ordinary differential equations over the length scaling factor, thereby overcoming the constraints of current PE scaling methods designed for specific lengths. Moreover, by extending the dynamics to desired context lengths beyond the training sequence length, CLEX facilitates the length extrapolation with impressive performance in practical tasks. We demonstrate that CLEX can be seamlessly incorporated into LLMs equipped with Rotary Position Embedding, such as LLaMA and GPT-NeoX, with negligible impact on training and inference latency. Experimental results reveal that CLEX can effectively extend the context window to over 4x or almost 8x training length, with no deterioration in performance. Furthermore, when evaluated on the practical LongBench benchmark, our model trained on a 4k length exhibits competitive performance against state-of-the-art open-source models trained on context lengths up to 32k. Our code is available at https://github.com/DAMO-NLP-SG/CLEX.
Key facts. Cited by 44 papers in the map (data through 14 Oct 2026). Builds on 25 of its 30 references that are in the map. First posted on arXiv 25 Oct 2023.
Builds on
25 of 30 references.
References · 25
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2018Neural Ordinary Differential Equationscited by 3,779
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
13 more
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 839
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 601
- 2023LongNet: Scaling Transformers to 1,000,000,000 Tokenscited by 204
- 2022Recurrent Memory Transformercited by 203
- 2022A Length-Extrapolatable Transformercited by 127
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
- 2023Scaling Transformer to 1M tokens and beyond with RMTcited by 98
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
- 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 42
- 2023Giraffe: Adventures in Expanding Context Lengths in LLMscited by 33
Built on by
Citing papers per year: 2023: 2; 2024: 25; 2025: 13; 2026: 4.
44 papers.
Sort:
By area:
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 197
- 2023Efficient Large Language Models: A Surveycited by 186
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
- 2024A Survey of Resource-efficient LLM and Multimodal Foundation Modelscited by 86
- 2025Lifelong Learning of Large Language Model based Agents: A Roadmapcited by 83
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 72
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
- 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 69
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 63
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 62
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
32 more
- 2024Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding?cited by 45
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalizationcited by 39
- 2024With Greater Text Comes Greater Necessity: Inference-Time Training Helps Long Text Generationcited by 37
- 2024MambaLRP: Explaining Selective State Space Sequence Modelscited by 32
- 2024DAPE: Data-Adaptive Positional Encoding for Length Extrapolationcited by 31
- 2024A Controlled Study on Long Context Extension and Generalization in LLMscited by 26
- 2024Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolationcited by 24
- 2025LongPO: Long Context Self-Evolution of Large Language Models through Short-to-Long Preference Optimizationcited by 24
- 2024Quest: Query-centric Data Synthesis Approach for Long-context Scaling of Large Language Modelcited by 16
- 2024When Precision Meets Position: BFloat16 Breaks Down RoPE in Long-Context Trainingcited by 15
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolationcited by 14
- 2024E2LLM: Encoder Elongated Large Language Models for Long-Context Understanding and Reasoningcited by 13
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
- 2024Retrieval Meets Reasoning: Dynamic In-Context Editing for Long-Text Understandingcited by 9
- 2025WildLong: Synthesizing Realistic Long-Context Instruction Data at Scalecited by 9
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2025Deconstructing Positional Information: From Attention Logits to Training Biasescited by 5
- 2024QuickLLaMA: Query-aware Inference Acceleration for Large Language Modelscited by 4
- 2025Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanismscited by 4
- 2025Long-Short Alignment for Effective Long-Context Modeling in LLMscited by 4
- 2025RePo: Language Models with Context Re-Positioningcited by 4
- 2024LongSSM: On the Length Extension of State-space Models in Language Modellingcited by 3
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answeringcited by 3
- 2024TeleOracle: Fine-Tuned Retrieval-Augmented Generation with Long-Context Support for Networkcited by 2
- 2025SeqPE: Transformer with Sequential Position Encodingcited by 2
- 2026LSTM-MAS: A Long Short-Term Memory Inspired Multi-Agent System for Long-Context Understandingcited by 1
- 2024Abstract2Appendix: Academic Reviews Enhance LLM Long-Context Capabilitiescited by 0
- 2025CacheFocus: Dynamic Cache Re-Positioning for Efficient Retrieval-Augmented Generationcited by 0
- 2025Effective Length Extrapolation via Dimension-Wise Positional Embeddings Manipulationcited by 0
- 2026EndPrompt: Efficient Long-Context Extension via Terminal Anchoringcited by 0
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodingscited by 0
- 2026Length Generalization Needs Proper Regularizationcited by 0
- 2026Length Generalization Needs Proper Regularization3 Oct 2026
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026EndPrompt: Efficient Long-Context Extension via Terminal Anchoring14 May 2026
- 2026LSTM-MAS: A Long Short-Term Memory Inspired Multi-Agent System for Long-Context Understanding17 Jan 2026
- 2025RePo: Language Models with Context Re-Positioning16 Dec 2025
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answering14 Oct 2025
- 2025SeqPE: Transformer with Sequential Position Encoding16 Jun 2025
- 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs13 Jun 2025
- 2025Deconstructing Positional Information: From Attention Logits to Training Biases19 May 2025
- 2025Effective Length Extrapolation via Dimension-Wise Positional Embeddings Manipulation26 Apr 2025
- 2025The Role of Sparsity for Length Generalization in Transformers24 Feb 2025
- 2025WildLong: Synthesizing Realistic Long-Context Instruction Data at Scale23 Feb 2025
32 more
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolation20 Feb 2025
- 2025LongPO: Long Context Self-Evolution of Large Language Models through Short-to-Long Preference Optimization19 Feb 2025
- 2025CacheFocus: Dynamic Cache Re-Positioning for Efficient Retrieval-Augmented Generation16 Feb 2025
- 2025Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanisms15 Jan 2025
- 2025Lifelong Learning of Large Language Model based Agents: A Roadmap13 Jan 2025
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalization23 Dec 2024
- 2024When Precision Meets Position: BFloat16 Breaks Down RoPE in Long-Context Training20 Nov 2024
- 2024Abstract2Appendix: Academic Reviews Enhance LLM Long-Context Capabilities7 Nov 2024
- 2024TeleOracle: Fine-Tuned Retrieval-Augmented Generation with Long-Context Support for Network4 Nov 2024
- 2024What is Wrong with Perplexity for Long-context Language Modeling?31 Oct 2024
- 2024Why Does the Effective Context Length of LLMs Fall Short?24 Oct 2024
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolation7 Oct 2024
- 2024A Controlled Study on Long Context Extension and Generalization in LLMs18 Sep 2024
- 2024E2LLM: Encoder Elongated Large Language Models for Long-Context Understanding and Reasoning10 Sep 2024
- 2024Human-inspired Episodic Memory for Infinite Context LLMs12 Jul 2024
- 2024Retrieval Meets Reasoning: Dynamic In-Context Editing for Long-Text Understanding18 Jun 2024
- 2024MambaLRP: Explaining Selective State Space Sequence Models11 Jun 2024
- 2024QuickLLaMA: Query-aware Inference Acceleration for Large Language Models11 Jun 2024
- 2024LongSSM: On the Length Extension of State-space Models in Language Modelling4 Jun 2024
- 2024Quest: Query-centric Data Synthesis Approach for Long-context Scaling of Large Language Model30 May 2024
- 2024DAPE: Data-Adaptive Positional Encoding for Length Extrapolation23 May 2024
- 2024Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding?9 May 2024
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encoding5 Mar 2024
- 2024Training-Free Long-Context Scaling of Large Language Models27 Feb 2024
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memory7 Feb 2024
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models3 Feb 2024
- 2024Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolation29 Jan 2024
- 2024With Greater Text Comes Greater Necessity: Inference-Time Training Helps Long Text Generation21 Jan 2024
- 2024A Survey of Resource-efficient LLM and Multimodal Foundation Models16 Jan 2024
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuning2 Jan 2024
- 2023Efficient Large Language Models: A Survey6 Dec 2023
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Survey21 Nov 2023
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 76
- 2024E2LLM: Encoder Elongated Large Language Models for Long-Context Understanding and Reasoningcited by 13
- 2024Retrieval Meets Reasoning: Dynamic In-Context Editing for Long-Text Understandingcited by 9
- 2024E2LLM: Encoder Elongated Large Language Models for Long-Context Understanding and Reasoning10 Sep 2024
- 2024Retrieval Meets Reasoning: Dynamic In-Context Editing for Long-Text Understanding18 Jun 2024
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models3 Feb 2024
- 2023Efficient Large Language Models: A Surveycited by 186
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 136
- 2024A Survey of Resource-efficient LLM and Multimodal Foundation Modelscited by 86
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 72
- 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72
- 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 69
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 63
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 62
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2024Can Perplexity Reflect Large Language Model's Ability in Long Text Understanding?cited by 45
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalizationcited by 39
- 2024With Greater Text Comes Greater Necessity: Inference-Time Training Helps Long Text Generationcited by 37
12 most cited of 29 All 29 (JSON)
- 2026Length Generalization Needs Proper Regularization3 Oct 2026
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026EndPrompt: Efficient Long-Context Extension via Terminal Anchoring14 May 2026
- 2025RePo: Language Models with Context Re-Positioning16 Dec 2025
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answering14 Oct 2025
- 2025SeqPE: Transformer with Sequential Position Encoding16 Jun 2025
- 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs13 Jun 2025
- 2025Deconstructing Positional Information: From Attention Logits to Training Biases19 May 2025
- 2025Effective Length Extrapolation via Dimension-Wise Positional Embeddings Manipulation26 Apr 2025
- 2025The Role of Sparsity for Length Generalization in Transformers24 Feb 2025
- 2025WildLong: Synthesizing Realistic Long-Context Instruction Data at Scale23 Feb 2025
- 2025Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanisms15 Jan 2025
12 newest of 29 All 29 (JSON)