Now open each station up. The same four stations — gather, extract, deduplicate, recipe — but the algorithms, engineering, legal and safety details underneath. Twelve short, interactive deep-dives.
Who's legally allowed to take the data, and why fresh facts never live in the weights.
Scraping public pages is broadly legal in the US, but sites still control AI crawlers with one file — robots.txt. It's a gate keyed on the crawler's name.
GPTBot, ClaudeBot, OAI-SearchBot. The gate matches it against the rules.A trained model's weights are frozen. Retraining for the news would cost weeks and millions — so fresh facts get in a completely different way: retrieval.
Hidden instructions in pages, connected-code cleanup, licence traps, and PDFs that fight back.
Attackers hide instructions inside a page — white-on-white text, HTML comments, invisible characters. You don't see them; the model does.
Code teaches logic and structure — but only if it's readable and kept in context.
<|file_sep|> marker into one green stream, so the model sees how main.py uses utils.py.A license sets the rules for reusing code. Some are safe to train on; some can force you to give your own product away.
Papers hold the densest knowledge — but it's locked inside PDFs that a naive reader scrambles.
\frac{a}{b} for a fraction.The three real algorithms: exact hashing, fuzzy MinHash + LSH, and semantic clustering.
The cheapest layer catches byte-identical text. No AI needed: if two documents hash to the same value, one is a copy. Two techniques run at different levels.
Exact hashing breaks on the real web: the same article on 50 sites has different sidebars and dates, so every SHA-256 differs. MinHash estimates how similar two documents are — this runs a real estimator on two samples.
Hashing and MinHash only see surface words. They miss semantic redundancy: ten summaries of the same event, worded differently. SemDeDup runs on embeddings — but only after the cheap stages shield it.
The temperature knob, the token-reuse cliff, and the gauntlet every synthetic doc must pass.
A recipe sets target percentages for each domain — but the data loader draws from huge per-domain buckets in real time. A single parameter, domain temperature τ, bends the natural frequencies toward that target.
Upsample maths hard enough and you exhaust the unique maths tokens before the compute budget is spent — so the loader repeats them. A little repetition helps; too much memorises.
The synthetic text a teacher model writes can hallucinate, reason in circles, or accidentally reproduce a benchmark question. Pour that into pre-training and you poison the student — so every synthetic doc runs a gauntlet.
That's the whole data pipeline, top to bottom. The locked recipe now heads to bin-packing & binary serialization — pre-tokenized once, stitched with EOS markers, packed into zero-waste batches, and memory-mapped into the .bin/.idx files GPUs stream during training.