Summary
Second of two data lectures, covering the processing pipeline rather than the sources. It walks the four stages applied to raw data after collection — transformation (HTML and PDF to text), filtering, deduplication, and mixing — and closes with a survey of recent post-training data efforts, mostly for code and agentic software engineering. The deduplication section is the most technical part of the pair, deriving MinHash and locality-sensitive hashing from scratch. Where Lecture 13 asked what data exists and whether it can be used, this lecture asks how to turn it into a training set.
Key Takeaways
- Filtering has one general shape: given a small high-quality target set and a large raw pool, fit a cheap scorer and keep the raw documents that look like the target. Generative scorers use KenLM n-gram perplexity; discriminative ones use fastText linear classifiers, which is now the default.
- The same machinery serves different goals by swapping the target set: fastText language ID across 176 languages, math data via OpenMathText (LaTeX rules, KenLM trained on ProofPile, plus a math classifier with a lower bar for documents containing LaTeX), toxicity via Jigsaw Toxic Comments, and educational value via phi-1’s trick of labelling 100k documents with GPT-4 and distilling that into a cheap Random Forest.
- There is no universal quality threshold, because the optimum depends on the token budget: filtered data wins early, but once you epoch over a small high-quality pool you overfit, and training longer on unfiltered data ends up ahead.
- Deduplication matters for compute, memorization, and contamination alike; an audit of C4 found one gas-mask product description repeated 61,000 times, and near-duplicates from mirrors, forks, licenses, boilerplate, and templated spam are pervasive.
- Pairwise comparison is quadratic, so dedup relies on hashing: MinHash is built so the probability of a hash collision equals the Jaccard similarity of two sets, turning a similarity question into a linear-time one.
- Locality-sensitive hashing sharpens that stochastic signal into a near-threshold decision by splitting n hash functions into b bands of r and declaring a match if any band matches entirely; the transition sits near (1/b)^(1/r), raising r shifts it right and raising b shifts it left, and the collision probability at the threshold is about 0.64.
- Mixing weights must account for source size, not just quality: with 10T low-quality and 10B high-quality tokens, a uniform mixture trained for 1T tokens touches 5% of the low-quality pool once while epoching the high-quality pool 50 times. UniMax addresses this with a hard per-source epoch cap.
- Regression-based methods (RegMix, Olmix) train a swarm of small proxy models on sampled Dirichlet mixtures, fit a log-linear map from mixture weights to loss, and optimize it — but the optimizer pushes toward extremes the regression never saw, and targeting downstream evals quietly overfits the pre-training mix to those evals.
- Simulated epoching keeps the small-scale proxy honest by downsampling every source in proportion to the scale gap (1 in 100 for a 10B proxy versus a 1T run), so the proxy experiences the same data scarcity the full run will.
- Open post-training data is now overwhelmingly synthetic and increasingly agentic: OpenThoughts found a few sources beat many and that QwQ-32B was a better teacher than the stronger DeepSeek-R1, while SWE-Zero exploited the fact that models solve nearly 70% of SWE tasks without execution feedback to skip per-repo Docker environments and collect 300k trajectories, an approach SWE-rebench scaled to 12M.
Extracted Notes
- None yet.