Lune

ACL2023Top-tier venue

Parallel Context Windows for Large Language Models

Nir Ratner, Yoav Levine, Yonatan Belinkov, Ori Ram, Inbal Magar, Omri Abend, Ehud Karpas, Amnon Shashua, Kevin Leyton-Brown, Yoav Shoham

Abstract

When applied to processing long text, Large Language Models (LLMs) are limited by their context window. Existing efforts to address this limitation involve training specialized architectures, and cannot be easily applied to offthe-shelf LLMs. We present Parallel Context Windows (PCW), a method that alleviates the context window restriction for any off-the-shelf LLM without further training. The key to the approach is to carve a long context into chunks ("windows"), restrict the attention mechanism to apply only within each window, and re-use the positional embeddings across the windows. Our main results test the PCW approach on in-context learning with models that range in size between 750 million and 178 billion parameters, and show substantial improvements for tasks with diverse input and output spaces. We show additional benefits in other settings where long context windows may be beneficial: multi-hop questions and retrieval-augmented question answering with multiple retrieved documents. Our results highlight Parallel Context Windows as a promising method for applying off-the-shelf LLMs in a range of settings that require long text sequences. We make our code publicly available at https://github.com/ ai21labs/parallel-context-windows .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

27 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Long Range Arena : A Benchmark for Efficient Transformers cites Big Bird: Transformers for Longer Sequences
  • DoraemonGPT: Toward Understanding Dynamic Scenes with Large Language Models (Exemplified as A Video Agent) cites Language Models are Few-Shot Learners
  • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation cites Language Models are Few-Shot Learners
  • Superposition Prompting: Improving and Accelerating Retrieval-Augmented Generation cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models cites Superposition Prompting: Improving and Accelerating Retrieval-Augmented Generation
  • Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models cites Language Models are Few-Shot Learners
  • Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolation cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolation cites Language Models are Few-Shot Learners
  • Calibrate Before Use: Improving Few-shot Performance of Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers27

  1. DoraemonGPT: Toward Understanding Dynamic Scenes with Large Language Models (Exemplified as A Video Agent)Zongxin Yang, Guikun Chen, Xiaodi Li, Wenguan Wang et al.ICML 2024 · 70 citations
  2. Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length ExtrapolationZhenyu He, Guhao Feng, Shengjie Luo, Kai Yang et al.ICML 2024 · 25 citations
  3. 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 et al.ACL 2025 · 22 citations
  4. Exchange-of-Thought: Enhancing Large Language Model Capabilities through Cross-Model CommunicationZhangyue Yin, Qiushi Sun, Cheng Chang, Qipeng Guo et al.EMNLP 2023 · 15 citations
  5. Superposition Prompting: Improving and Accelerating Retrieval-Augmented GenerationThomas Merth, Qichen Fu, Mohammad Rastegari, Mahyar NajibiICML 2024 · 14 citations

Builds on9

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
  3. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
  4. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
  5. Long Range Arena : A Benchmark for Efficient TransformersYi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen et al.ICLR 2021 · 881 citations

Related papers

  1. Revisiting Parallel Context Windows: A Frustratingly Simple Alternative and Chain-of-Thought DeteriorationKejuan Yang, Xiao Liu, Kaiwen Men, Aohan Zeng et al.ACL Findings 2024 · 1 citation
  2. LongHeads: Multi-Head Attention is Secretly a Long Context ProcessorYi Lu, Xin Zhou, Wei He, Jun Zhao et al.EMNLP Findings 2024 · 12 citations
  3. Long-Context Language Modeling with Parallel Context EncodingHoward Yen, Tianyu Gao, Danqi ChenACL 2024
  4. Retrieval meets Long Context Large Language ModelsPeng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee et al.ICLR 2024 · 131 citations
  5. Training-Free Long-Context Scaling of Large Language ModelsChenxin An, Fei Huang, Jun Zhang, Shansan Gong et al.ICML 2024 · 68 citations
Dusk over the sea between two cliffs drawn in fine vertical lines