Data Curation & Scaling Laws

Data Curation & Scaling Laws

When scaling laws first emerged, pre-training was treated primarily as a raw compute race: scrape larger snapshots of the public web and train larger parameter matrices. Today, frontier pre-training is fundamentally data-constrained. High-quality human text on the open web is finite, and raw web crawls (such as CommonCrawl) consist of over 85% HTML boilerplate, SEO keyword spam, machine-translated filler, and duplicated templates.

Training a foundation model therefore requires solving two coupled mathematical problems:

  1. Compute-Optimal vs. Inference-Optimal Allocation: Given a fixed floating-point budget , how should we partition compute between model parameters and training tokens ?
  2. Sub-Quadratic Corpus Curation: How do we filter and deduplicate raw web documents down to high-signal tokens without quadratic pairwise comparisons or distribution collapse?

Compute-Optimal & Inference-Aware Scaling Laws

In a standard dense Transformer, every training token requires approximately floating-point operations (FLOPs) for the forward pass and FLOPs for the backward pass, yielding the canonical pre-training compute identity:

Hoffmann et al. (2022) (Chinchilla) modeled the pre-training cross-entropy loss as a sum of three terms: the irreducible entropy of natural text , the finite-parameter approximation error, and the finite-data estimation error:

where empirical fits across four orders of magnitude of compute give , , , , and .

Minimizing subject to the constraint via Lagrange multipliers yields the power-law scaling allocation:

Because , model parameters and training tokens must scale in 1:1 proportion (~20 training tokens per parameter). However, because inference cost over a deployed model’s lifetime scales linearly with parameter count , modern frontier models (LLaMA 3, Qwen, Gemma) intentionally over-train smaller parameter matrices up to (e.g., LLaMA 3 8B trained on tokens, or tokens per parameter):

Symbol / QuantityScaling / DomainPhysical & Statistical Meaning
Dense Pre-Training Compute Budget: Total floating-point operations to train a dense Transformer of non-embedding parameters over tokens ( forward + backward).
Chinchilla Parametric Loss Law: Decomposes cross-entropy test loss into irreducible natural text entropy , finite-capacity approximation error , and finite-sample estimation error .
Compute-Optimal Allocation (Hoffmann et al. 2022): Because , model parameters and training tokens must scale equally (~20 tokens per parameter for training-optimal loss).
Jaccard n-Gram Similarity: Overlap fraction between two documents' 5-gram shingle sets, estimated in time via MinHash signatures and Locality-Sensitive Hashing (LSH).
LSH Collision S-Curve: Probability that two documents with Jaccard similarity collide in at least one of hash bands of rows each, with threshold .

Frontier Pre-Training Data Curation Funnel (FineWeb / LLaMA 3 Scale: 100T → 15T Tokens)

1. Raw Crawl~100T TokensHTML Boilerplatetrafilatura Extract2. Heuristics~48T TokensfastText LangIDC4 / Gopher Rules3. MinHash LSH~22T Tokens5-Gram ShinglesDrops 54% Clones4. Classifier15T TokensQuality ScorerCode / Math Mix
Figure 1 (The 85% Rejection Funnel): Out of ~100 trillion raw scraped web tokens, over 85% are discarded. MinHash LSH fuzzy deduplication (, highlighted in carmine) removes SEO spam and syndicated clones that otherwise trigger double-descent memorization spikes.

MinHash LSH Deduplication Walkthrough

Duplicate documents in pre-training corpora degrade generalization, allow models to memorize verbatim passages, and waste FLOPs. However, comparing documents pairwise for fuzzy overlap requires comparisons.

Frontier pipelines (FineWeb, Dolma, RedPajama) achieve near-deduplication using MinHash with Locality-Sensitive Hashing (LSH):

1. Document Shingling & Jaccard Similarity

Each document is converted into a set of character or word -grams (typically ). The overlap between documents and is measured by their Jaccard similarity:

2. MinHash Signature Compression

Given independent random hash permutations , the MinHash signature of a set is the vector of minimum hash values:

By a foundational property of random permutations, the probability that two documents share the exact same minimum hash equals their Jaccard similarity:

3. Banded LSH S-Curve Calculation

We partition a signature of length into bands of rows each. Two documents are flagged as candidate duplicates if they match on all rows in at least one band:

  1. Probability that all rows in a single band match: (where ).
  2. Probability that at least one row in that band differs: .
  3. Probability that none of the bands match: .
  4. Probability of colliding as a candidate duplicate pair:

Let us evaluate for (threshold ):

  • Unrelated Documents (): ( false positive rate).
  • Near-Duplicate Clones (): ( detection rate).

Interactive Chinchilla & Over-Training Simulator

Compare the three historical scaling regimes below under an identical pre-training compute budget () to observe how shifting from parameter-heavy to token-heavy allocation transforms serving VRAM and decode throughput:

Chinchilla IsoFLOP & Inference-Aware Over-Training Simulator

Explore how a fixed pre-training compute budget trades off model parameters against training tokens , and why modern models intentionally over-train to to minimize inference cost.

Compute C: 3.4 × 1023 FLOPs
Ratio D / N: 20 : 1
Model Size N (Billions of Params, log scale)Loss LChinchilla Min (53B)Chinchilla (D/N = 20)8B53B175B
Model Parameters () & Tokens () N = 53B, D = 1.1T
Balanced scaling where finite-capacity error and finite-data error are equalized.
Predicted Cross-Entropy Loss 1.942 nats
Decomposes into + model error 0.126 + data error 0.126.
Serving VRAM (FP16) & Decode Latency 106 GB (2× H100)
Requires multi-GPU tensor parallelism to fit weights in HBM.
Regime 2 / 3
Allocation:

Synthetic Data & The Model Collapse Boundary

As organic human text is exhausted, frontier pipelines increasingly incorporate synthetic data (math reasoning traces, code unit tests, textbook rewrites). However, training generation naively on the unfiltered output distribution of generation triggers Model Collapse (Shumailov et al. 2024).

If each generation fits a Gaussian distribution to finite samples drawn from the previous model, the variance evolves as a random walk that converges to zero:

Low-probability tail events vanish first, collapsing the model into repetitive mode-seeking outputs. Modern pipelines prevent collapse through Verifier-Guided Filtering: synthetic candidates are only admitted into the training mix if they pass deterministic external verifiers (compiler execution, Lean 4 proof checkers, or unit test suites) while always preserving a fixed anchor proportion of grounded human text.


Comparing Frontier Open & Proprietary Corpora

Corpus / PipelineScale (Tokens)Deduplication StrategyQuality Classifier & Filtering
FineWeb-Edu (HuggingFace 2024) ( Edu)Per-dump MinHash LSH ()LLaMA-3-70B educational rubric annotations distilled into a fast linear classifier
Dolma v1.7 (AI2 OLMo)Bloom filter exact + paragraph span dedupRule-based Gopher/C4 heuristics + fastText perplexity thresholds
DataComp-LM (DCLM)Intra-crawl + cross-crawl MinHashFastText classifier trained on OpenHermes-2.5 & ELI5 high-score examples
LLaMA 3 Pre-TrainingMulti-level URL, line, and MinHash LSHDistilled LLaMA-2 quality scorers + 4× code & mathematical annealing in final phase

Key Papers & References