XGen-7B: an open 7B LLM trained up to 8K context (1.5T tokens) with instruction-tuned releases

September 7, 20238 min

Overview

Decision SnapshotNeeds Validation

The paper provides concrete training recipes, open code and weight releases, and benchmark numbers; results are repeatable for practitioners with TPU/GPU access.

Citations4

Evidence Strength0.80

Confidence0.90

Risk Signals12

Trust Signals

Findings with numeric evidence: 6/6

Findings with evidence refs: 6/6

Results with explicit delta: 7/7

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 70%

Production readiness: 70%

Novelty: 50%

Authors

Erik Nijkamp, Tian Xie, Hiroaki Hayashi, Bo Pang, Congying Xia, Chen Xing, Jesse Vig, Semih Yavuz, Philippe Laban, Ben Krause, Senthil Purushwalkam, Tong Niu, Wojciech Kryściński, Lidiya Murakhovs'ka, Prafulla Kumar Choubey, Alex Fabbri, Ye Liu, Rui Meng, Lifu Tu, Meghana Bhat, Chien-Sheng Wu, Silvio Savarese, Yingbo Zhou, Shafiq Joty, Caiming Xiong

Links

Abstract / PDF / Code / Data

Why It Matters For Business

XGen-7B gives teams a practical, open 7B model that handles long documents (up to 8K tokens) and competitive instruction-following, lowering cost versus much larger closed models while keeping good accuracy.

Who Should Care

Summary TLDR

Salesforce trains and releases XGen-7B, a family of 7-billion-parameter models trained stage-wise to handle up to 8K input tokens. Key facts: base models saw up to 1.5 trillion training tokens (800B@2K, 400B@4K, 300B@8K). They release two instruction-tuned variants (WizardLM-based and a general public-data mix). Evaluations show XGen-7B matches or beats other open-source 7B models on standard benchmarks and shows clear gains on long-context tasks. Models and code are open-sourced.

Problem Statement

Most competitive open-source LLMs are trained with a 2K token limit. That prevents reliable handling of long documents (summaries, long code, transcripts). The paper aims to produce a practical, open 7B model that reliably uses context up to 8K tokens and remains efficient to serve.

Main Contribution

Train a 7B dense-attention LLM (XGen-7B) with stage-wise context growth: 2K → 4K → 8K tokens.

Scale total token budget to 1.5T tokens (800B, 400B, 300B splits) for the 8K model.

Key Findings

Stage-wise training yields an 8K-capable model that uses long context.

Numbers800B@2K + 400B@4K + 300B@8K = 1.5T tokens

Practical UseUse stage-wise sequence growth to train long-context models without catastrophic loss spikes; adopt the 2K→4K→8K token schedule when you need an 8K model.

Evidence RefTable 1; Section 3

XGen-7B matches or slightly improves over LLaMA-7B on standard benchmarks.

NumbersMMLU five-shot wavg: XGen 36.3 vs LLaMA 35.1

Practical UseFor general NLP tasks, a trained 7B XGen model is a viable drop-in alternative to LLaMA-7B.

Evidence RefTable 4

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
MMLU five-shot weighted average36.3%LLaMA-7B 35.1%+1.2 ppMMLU five-shotTable 4: XGen-7B 36.3 vs LLaMA-7B 35.1Table 4
MMLU zero-shot weighted average32.1%LLaMA-7B 32.0%+0.1 ppMMLU zero-shotTable 5: XGen-7B 32.1 vs LLaMA-7B 32.0Table 5

What To Try In 7 Days

Run XGen-7B-8K on your long-doc tasks (documents >2K tokens) and compare summaries/QA against your 2K models.

Replace a 13–40B inference endpoint with XGen-7B-Inst for inexpensive dev/testing of assistant flows.

Fine-tune or prompt-engineer XGen-7B-Inst wizardLM on a small in-domain instruction set for rapid assistant prototyping.

Optimization Features

Token Efficiency
Concatenate documents with <|endoftext|> and exclude docs <100 tokensShuffle and chunk to control distribution shifts across sequence-length stages
Model Optimization
Increase vocab to 51,200 tokensUse RMS-Norm and swish-GLU for numerical stability
System Optimization
FP32 numerics except matmul in BF16Data and model parallelism optimized for TPU-v4
Training Optimization
Stage-wise sequence length schedule (2K→4K→8K)1.5T total token budget for 8K modelJAX implementation (JaxFormer) optimized for TPU-v4
Inference Optimization
Model kept at 7B for inference efficiency and potential mobile/16GB-GPU deployment

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Data URLs

https://github.com/togethercomputer/OpenWebTexthttps://github.com/togethercomputer/RedPajama (GitHub subset)Starcoder/BigCode (referenced)WizardLM dataset (WizardLM-196K)ShareGPT, Baize, Dolly2, OpenAssistant, SCROLLS

Risks & Boundaries

Limitations

Models still exhibit bias, toxicity and hallucinations like other LLMs (Section 7).

Quadratic attention cost makes long-sequence training and inference expensive.

When Not To Use

When you need the highest possible single-shot assistant quality (GPT-4 still scores higher on MT-Bench).

For extreme context lengths beyond 8K tokens without further engineering.

Failure Modes

Hallucinations on factual queries despite long context.

Performance degradation if training recipe deviates from RMS-Norm and sequential attention choices.

Core Entities

Models

XGen-7B-4KXGen-7B-8KXGen-7B-Inst wizardLMXGen-7B-Inst general

Metrics

Accuracypass@1Win rate (AlpacaEval)MT-Bench scoreROUGE-1/2/LPerplexity

Datasets

Natural language mix (public corpora)RedPajama GitHub subsetApex codeStarcoder (BigCode) dataWizardLM-196KShareGPTBaizeDolly2OpenAssistant (OAsst)SCROLLS (long-sequence subsets)HumanEvalMMLUAlpacaEvalMT-Bench

Benchmarks

MMLUHumanEvalAlpacaEvalMT-BenchSCROLLS long-sequenceROUGE (dialogue summarization)