InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memory
Chaojun Xiao, Pengle Zhang, Xu Han, Guangxuan Xiao, Yankai Lin, Zhengyan Zhang, Zhiyuan Liu, Maosong Sun
摘要
Large language models (LLMs) have emerged as a cornerstone in real-world applications with lengthy streaming inputs (e.g., LLM-driven agents). However, existing LLMs, pre-trained on sequences with a restricted maximum length, cannot process longer sequences due to the out-of-domain and distraction issues. Common solutions often involve continual pre-training on longer sequences, which will introduce expensive computational overhead and uncontrollable change in model capabilities. In this paper, we unveil the intrinsic capacity of LLMs for understanding extremely long sequences without any fine-tuning. To this end, we introduce a training-free memory-based method, InfLLM. Specifically, InfLLM stores distant contexts into additional memory units and employs an efficient mechanism to lookup token-relevant units for attention computation. Thereby, InfLLM allows LLMs to efficiently process long sequences with a limited context window and well capture long-distance dependencies. Without any training, InfLLM enables LLMs that are pre-trained on sequences consisting of a few thousand tokens to achieve comparable performance with competitive baselines that continually train these LLMs on long sequences. Even when the sequence length is scaled to K, InfLLM still effectively captures long-distance dependencies. Our code can be found in https://github.com/thunlp/InfLLM.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 64 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Big Bird: Transformers for Longer Sequences 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Titans: Learning to Memorize at Test Time 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
- Titans: Learning to Memorize at Test Time 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention 引用了 Big Bird: Transformers for Longer Sequences
- Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention 引用了 MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
- Language Models are Few-Shot Learners 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Neural Attention Search 引用了 Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention
- Neural Attention Search 引用了 Language Models are Few-Shot Learners
- Neural Attention Search 引用了 MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval 引用了 Big Bird: Transformers for Longer Sequences
- RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval 引用了 MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
- MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention 引用了 RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval
- MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention 引用了 Big Bird: Transformers for Longer Sequences
- MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention 引用了 Efficiently Modeling Long Sequences with Structured State Spaces
引用它的顶会 Paper64
- MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse AttentionHuiqiang Jiang, Yucheng Li, Chengruidong Zhang, Qianhui Wu 等NeurIPS 2024 · 479 次引用
- Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 次引用
- Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 次引用
- Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse AttentionJingyang Yuan, Huazuo Gao, Damai Dai, Junyu Luo 等ACL 2025 · 334 次引用
- RetrievalAttention: Accelerating Long-Context LLM Inference via Vector RetrievalDi Liu, Meng Chen, Baotong Lu, Huiqiang Jiang 等NeurIPS 2025 · 148 次引用
它引用的 Paper33
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 次引用
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
相关 Paper
- Training-Free Long-Context Scaling of Large Language ModelsChenxin An, Fei Huang, Jun Zhang, Shansan Gong 等ICML 2024 · 68 次引用
- LLM Maybe LongLM: SelfExtend LLM Context Window Without TuningHongye Jin, Xiaotian Han, Jingfeng Yang, Zhimeng Jiang 等ICML 2024 · 167 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
- ReAttention: Training-Free Infinite Context with Finite Attention ScopeXiaoran Liu, Ruixiao Li, Zhigeng Liu, Qipeng Guo 等ICLR 2025
- SirLLM: Streaming Infinite Retentive LLMYao Yao, Zuchao Li, Hai ZhaoACL 2024
