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 off-the-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.
Exploring Context Window of Large Language Models via Decomposed Positional Vectors
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Baichuan Inc.(百川公司);School of Information, Renmin University of China(中国人民大学信息学院);Department of Computer Science, National University of Singapore(新加坡国立大学计算机科学系)
Scaling External Knowledge Input Beyond Context Windows of LLMs via Multi-Agent Collaboration
Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China(计算机科学与技术系,人工智能研究院,清华大学,北京,中国);Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China(人工智能产业研究院(AIR),清华大学,北京,中国);Institute of Intelligent Computing, Alibaba Group(智能计算研究院,阿里巴巴集团)
LongRecipe: Recipe for Efficient Long Context Generalization in Large Language Models
National University of Singapore(新加坡国立大学);Nanjing University(南京大学);University of Toronto(多伦多大学);Mila, Québec AI Institute(魁北克人工智能研究所(Mila));Université de Montréal(蒙特利尔大学);Tencent Inc(腾讯公司);Baidu Inc(百度公司);Nanyang Technological University(南洋理工大学)
PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training
Microsoft Corporation(微软公司);School of Computer Science, Peking University(北京大学计算机学院);National Key Laboratory for Multimedia Information Processing, Peking University(北京大学多媒体信息处理国家重点实验室)
CLEX: Continuous Length Extrapolation for Large Language Models
Sun Yat-sen University(中山大学);DAMO Academy, Alibaba Group(阿里巴巴集团达摩院);Hupan Lab(湖畔实验室);University of Glasgow(格拉斯哥大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)
ParallelComp: Parallel Long-Context Compressor for Length Extrapolation
The University of Hong Kong(香港大学);The Chinese University of Hong Kong(香港中文大学);The University of California, Los Angeles(加利福尼亚大学洛杉矶分校);Sun Yat-Sen University(中山大学);Tencent(腾讯);Hong Kong Polytechnic University(香港理工大学)
Stacked from One: Multi-Scale Self-Injection for Context Window Extension
Singapore University of Technology and Design (SUTD)(新加坡科技设计大学);Singapore Management University (SMU)(新加坡管理大学);Nanyang Technological University (NTU)(南洋理工大学);National University of Singapore (NUS)(新加坡国立大学)
A Dynamic Window Neural Network for CCG Supertagging
Institute of Automation, CAS(中国科学院自动化研究所);CAS Center for Excellence in Brain Science and Intelligence Technology(中国科学院脑科学与智能技术卓越创新中心);University of Chinese Academy of Sciences(中国科学院大学)
Beyond Turn Limits: Training Deep Search Agents with Dynamic Context Window
Chinese Information Processing Laboratory, Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所信息处理实验室);Alibaba Group(阿里巴巴集团);University of Chinese Academy of Sciences(中国科学院大学)