atlas

Research map / Large language models / Language, safety and interpretability

Data Engineering for Scaling Language Models to 128K Context

ICML 2024 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 4 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies a data recipe for continually pretraining LLaMA-2 7B/13B to 128K context, finding that 1-5B tokens of per-source length-upsampled, domain-balanced SlimPajama suffice to pass Needle-in-a-Haystack retrieval.

Problem

Extending language models' context windows to 128K while retaining precise retrieval at arbitrary positions and short-context ability, at academic-scale compute; prior long-context continual pretraining used hundreds of billions of tokens and ad hoc data mixtures.

Approach

Long-context retrieval is mostly acquired during standard pretraining, so light continual pretraining on 1-5B tokens suffices; the key data choice is per-source length upsampling, which increases long sequences within each domain while keeping the original domain mixture fixed.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Continue pretraining LLaMA-2 7B on 5B tokens of per-source length-upsampled dataLLaMA-2 7B · Needle-in-a-HaystackNeedle performance: 70.0 -> 88.0Helped
Continue pretraining LLaMA-2 13B on 5B tokens of per-source length-upsampled dataLLaMA-2 13B · Needle-in-a-HaystackNeedle performance: 54.1 -> 90.0Helped
Continue pretraining LLaMA-2 7B on 5B tokens of per-source length-upsampled dataLLaMA-2 7B · MMLUaccuracy: 37.9 -> 43.3Mixed
Continue pretraining LLaMA-2 13B on 5B tokens of per-source length-upsampled dataLLaMA-2 13B · InfiniBench BookQA, 128KBookQA: 24.6 -> 31.1Helped
Increase continual-pretraining data from 500M to 5B tokens (ablation)LLaMA-2 7B · Needle-in-a-Haystack, 128Kretrieval performanceHelped
Increase continual-pretraining data from 5B to 10B tokens (ablation)LLaMA-2 7B · Needle-in-a-Haystack, 128Klength generalizationHurt
Add per-source length upsampling while retaining the original domain proportions (ablation)LLaMA-2 7B · Needle-in-a-Haystack, 128Kprecise retrievalHelped
Replace per-source length upsampling with the original mixture without length upsampling (ablation)LLaMA-2 7B · Needle-in-a-Haystack, 128Kprecise retrievalHurt
Upsample book data instead of keeping a balanced domain mixture (ablation)LLaMA-2 7B · Book and Github domains, 0-4K contextvalidation loss: + .029 Github; -- .175 BookMixed
Upsample code data instead of keeping a balanced domain mixture (ablation)LLaMA-2 7B · Book and Github domains, 0-4K contextvalidation loss: + .030 Book; -- .023 GithubMixed
Upsample Arxiv data instead of keeping a balanced domain mixture (ablation)LLaMA-2 7B · Arxiv and Book domains, 0-4K contextvalidation loss: -- .060 Arxiv; + .040 BookMixed

Surprising findings

Limitations

Experimental setup

Datasets: SlimPajama InfiniBench (BookQA) MMLU

Benchmarks: Needle-in-a-Haystack MMLU InfiniBench BookQA

Metrics: retrieval accuracy MMLU accuracy BookQA score validation loss

Baselines: YaRN Mistral 7B 128K LongLoRA Together LLaMA-2 32K LongChat v1.5 32K GPT-4 Turbo 128K

Builds on: LLaMA 2 SlimPajama FlashAttention DeepSpeed ZeRO YaRN

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy