PreprintCited by 9Topic ModelingNatural Language Processing TechniquesMultimodal Machine Learning Applications

Long-Context Language Modeling with Parallel Context Encoding

Open access
Yen, Howard, Gao, Tianyu, Chen, Danqi·2024·arXiv

Abstract

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 10x 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.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2402.16617

Cites

2 of 2 references verified0 citation errors · 0 not checkable

Statistics

Recomputing p-values needs the paper’s full text.

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Developers of long-context base models often turn to perplexity and synthetic tasks to evaluate their models.

    “As a result, developers of long-context base models often turn to perplexity and synthetic tasks to evaluate their models (Fu et al., 2024; Yen et al., 2024; AI et al., 2024).”

    From HELMET: How to Evaluate Long-Context Language Models Effectively and Thoroughly (2024) · cites this paper as Yen et al., 2024

Cites

Flagged first, then by citations

Cited by

Sorted by citations

Authors
Yen, H., Gao, T., & Chen, D.
Affiliations
Princeton University (US)
Venue
arXiv
Publisher
arXiv
Published
2024
Pages
2588-2610
ISSN
0736-587X (ISSN-L)
OpenAlex
W4402671910
Cited by
9
References
2
Citations by year
2026: 2 · 2025: 7
FWCI
2.66
Type
conference paper
Language
en
Open access
Locations
  • Proceedings of the conference - Association for Computational Linguistics. Meeting (publishedVersion, cc-by)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
National Science Foundation (2239290, CAREER)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Multimodal Machine Learning Applications
Keywords
long-context language modeling, context window extension, cross-attention, in-context learning, retrieval-augmented generation, instruction-tuned models, memory efficiency, Llama 2

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review