Data for Language Models

Dive into Deep Learning · §20

Data for Language Models
extraction · quality filters · deduplication · mixtures · synthetic data · tokenizers

Of 9,731 Crawled Pages, About One in Ten Reaches the Corpus

The problem

A quarter of one Common Crawl archive file, through the first three sections:

stage documents left section
HTML responses with extracted text 9,286 Document Extraction
English, language score at least 0.65 3,288 Document Extraction
after the heuristic rules 1,032 Quality Filtering
after exact and near-duplicate removal 1,014 Deduplication

Every row is a decision made before the first batch. A manifest records each one, and the section that makes it measures what it removes.

By the End of This Chapter You Can

Goals

  • extract text from web archives and measure what an extractor loses;
  • filter by rules and by a classifier on model labels, and audit whose pages a filter removes;
  • find near-duplicates without comparing every pair, and keep test items out of training data;
  • choose domain weights with small proxy runs and a noise floor;
  • check text written by a model, and compare it with real text at equal cost;
  • choose a vocabulary, and write verified token files for pretraining.

Running example: 256 MiB of one Common Crawl file beside FineWeb’s text for the same records; then FineWeb-Edu as released.

Idea: record every decision in a manifest and measure its effect: on the documents for extraction, filters and deduplication; on small trained models for mixtures and rewritten text.

Three Steps: Choose Documents, Weigh Them, Cut Them into Tokens

Chapter map

step section question
choose documents Document Extraction from Web Crawls what does extraction lose, and on which pages?
Quality Filtering what does a filter remove, and whose pages?
Deduplication and Decontamination how are near-copies found without comparing every pair?
weigh them Data Mixtures can small runs choose the domain weights of a large one?
Synthetic and Rephrased Data when does text written by a model help?
cut into tokens Tokenizers at Scale what does one vocabulary cost each language?
  • Uses: byte-level BPE; bits per byte; paired error bars; text embeddings.
  • Next: the reference model trains on this chapter’s token files.