Long-Context Language Modeling with Parallel Context Encoding
Howard Yen, Tianyu Gao, Danqi Chen
摘要
Extending large language models (LLMs) to process longer inputs is crucial for a wide range of applications. However, the substantial computational cost of transformers and limited generalization of positional encoding restrict the size of their context window. We introduce Context Expansion with Parallel Encoding (CEPE ), a framework that can be applied to any existing decoder-only LLMs to extend their context window. CEPE employs a small encoder to process long inputs chunk by chunk, enabling the frozen decoder to utilize additional contexts via cross-attention. CEPE is efficient, generalizable, and versatile: trained with 8K-token documents, it extends the context window of LLAMA-2 to 128K tokens, offering 10× the throughput with only 1/6 of the memory. CEPE yields strong performance on language modeling and in-context learning. CEPE also excels in retrieval-augmented applications, while existing long-context models degenerate with retrieved contexts. We further introduce a CEPE variant that can extend the context window of instruction-tuned models using only unlabeled data, and showcase its effectiveness on LLAMA-2-CHAT, leading to a strong instruction-following model that can leverage very long contexts on downstream tasks. 1
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 37 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Implicit In-context Learning 引用了 Language Models are Few-Shot Learners
- Implicit In-context Learning 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
- DAPE: Data-Adaptive Positional Encoding for Length Extrapolation 引用了 Language Models are Few-Shot Learners
- Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models 引用了 Language Models are Few-Shot Learners
- Language Models are Few-Shot Learners 引用了 The Curious Case of Neural Text Degeneration
- Vision-centric Token Compression in Large Language Model 引用了 Language Models are Few-Shot Learners
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- Calibrate Before Use: Improving Few-shot Performance of Language Models 引用了 Language Models are Few-Shot Learners
- Calibrate Before Use: Improving Few-shot Performance of Language Models 引用了 The Curious Case of Neural Text Degeneration
引用它的顶会 Paper37
- Implicit In-context LearningZhuowei Li, Zihao Xu, Ligong Han, Yunhe Gao 等ICLR 2025 · 1,989 次引用
- Cartridges: Lightweight and general-purpose long context representations via self-studySabri Eyuboglu, Ryan Ehrlich, Simran Arora, Neel Guha 等ICLR 2026 · 74 次引用
- DAPE: Data-Adaptive Positional Encoding for Length ExtrapolationChuanyang Zheng, Yihang Gao, Han Shi, Minbin Huang 等NeurIPS 2024 · 42 次引用
- Vision-centric Token Compression in Large Language ModelLing Xing, Alex Jinpeng Wang, Rui Yan, Xiangbo Shu 等NeurIPS 2025 · 32 次引用
- Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language ModelsZhisong Zhang, Yan Wang, Xinting Huang, Tianqing Fang 等ACL 2025 · 22 次引用
它引用的 Paper31
- 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 次引用
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes 等ICLR 2020 · 4,112 次引用
- Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 次引用
- Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein 等ICML 2021 · 1,843 次引用
相关 Paper
- Training-Free Long-Context Scaling of Large Language ModelsChenxin An, Fei Huang, Jun Zhang, Shansan Gong 等ICML 2024 · 68 次引用
- Parallel Context Windows for Large Language ModelsNir Ratner, Yoav Levine, Yonatan Belinkov, Ori Ram 等ACL 2023 · 37 次引用
- PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise TrainingDawei Zhu, Nan Yang, Liang Wang, Yifan Song 等ICLR 2024 · 110 次引用
- PEPE: Long-context Extension for Large Language Models via Periodic Extrapolation Positional EncodingsJikun Hu, Dongsheng Guo, Yuli Liu, Qingyao Ai 等EMNLP Findings 2025
- ChatQA 2: Bridging the Gap to Proprietary LLMs in Long Context and RAG CapabilitiesPeng Xu, Wei Ping, Xianchao Wu, Chejian Xu 等ICLR 2025
