Skip to main content
QUICK REVIEW

[Paper Review] Effective Long-Context Scaling of Foundation Models

Wenhan Xiong, Jingyu Liu|arXiv (Cornell University)|Sep 27, 2023
Topic ModelingComputer Science9 citations
TL;DR

The paper presents a series of long-context LLMs (up to 32,768 tokens) through continual pretraining from Llama 2, with lightweight instruction tuning, achieving strong long-context and competitive short-context performance while analyzing positional encodings and training curricula.

ABSTRACT

We present a series of long-context LLMs that support effective context windows of up to 32,768 tokens. Our model series are built through continual pretraining from Llama 2 with longer training sequences and on a dataset where long texts are upsampled. We perform extensive evaluation on language modeling, synthetic context probing tasks, and a wide range of research benchmarks. On research benchmarks, our models achieve consistent improvements on most regular tasks and significant improvements on long-context tasks over Llama 2. Notably, with a cost-effective instruction tuning procedure that does not require human-annotated long instruction data, the 70B variant can already surpass gpt-3.5-turbo-16k's overall performance on a suite of long-context tasks. Alongside these results, we provide an in-depth analysis on the individual components of our method. We delve into Llama's position encodings and discuss its limitation in modeling long dependencies. We also examine the impact of various design choices in the pretraining process, including the data mix and the training curriculum of sequence lengths -- our ablation experiments suggest that having abundant long texts in the pretrain dataset is not the key to achieving strong performance, and we empirically verify that long context continual pretraining is more efficient and similarly effective compared to pretraining from scratch with long sequences.

Motivation & Objective

  • Demonstrate open, strong long-context capabilities beyond existing open models.
  • Investigate how to modify architecture and training to support very long contexts without prohibitive costs.
  • Assess the impact of data mix, curriculum, and instruction tuning on long-context performance.
  • Analyze positional encodings and other design choices that affect long-range modeling.
  • Evaluate safety and compare against proprietary models on long-context benchmarks.

Proposed method

  • Continual pretraining from Llama 2 with longer sequences (up to 32,768 tokens) and data upsampling of long texts.
  • Modify RoPE positional encoding (base frequency) to enable attendance over longer contexts.
  • Experiment with data mixes to assess impact of long-text presence versus data quality on long-context abilities.
  • Use cost-efficient instruction tuning by leveraging short-prompt RLHF data plus self-instruct long data without human long-context annotations.
  • Train 7B/13B with 32k and 34B/70B with 16k–32k sequences; evaluate with language modeling, synthetic probes, and diverse benchmarks.
  • Examine training curricula to compare continual pretraining versus long-sequence pretraining from scratch.
Figure 1 : We show that our model’s validation loss can be fit as a function of the context length: $L(c)=(\frac{\alpha}{c})^{\beta}+\gamma$ with a different set of $\alpha,\beta,\gamma$ for each model size. This power-law relationship also suggests that context length is another important axis of s
Figure 1 : We show that our model’s validation loss can be fit as a function of the context length: $L(c)=(\frac{\alpha}{c})^{\beta}+\gamma$ with a different set of $\alpha,\beta,\gamma$ for each model size. This power-law relationship also suggests that context length is another important axis of s

Experimental results

Research questions

  • RQ1Can open-source long-context LLMs match or exceed proprietary long-context models on long-context benchmarks?
  • RQ2What architectural and training choices best enable long-context modeling without prohibitive compute?
  • RQ3How do data mix, curriculum, and instruction tuning affect long-context and short-context performance?
  • RQ4To what extent do positional encodings limit long-range attention, and can simple fixes extend context length effectively?
  • RQ5How safe are long-context instruction-tuned models compared with existing baselines?

Key findings

  • Models achieve effective context windows up to 32,768 tokens, with a power-law scaling of validation loss with context length.
  • On research benchmarks, long-context models improve over Llama 2, with notable gains on long-context tasks and modest gains on some short-context tasks.
  • A 70B instruction-tuned model can surpass gpt-3.5-turbo-16k on a suite of long-context benchmarks without human-annotated long-context data.
  • RoPE ABF (adjusted base frequency) outperforms other positional encoding variants for long-context modeling, maintaining performance across 32k tokens.
  • Data quality matters more than mere abundance of long texts; long-context gains persist even with limited long-text data; a mix including long data helps short-context knowledge tasks.
  • Continual pretraining with longer sequences achieves similar or better results with substantially less FLOPs than training long sequences from scratch.
Figure 2 : Performance on long-context tasks as the maximum context lengths of prompts increase.
Figure 2 : Performance on long-context tasks as the maximum context lengths of prompts increase.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.