Collection, licensing and curation¶
A model can only learn the distribution you show it, so choosing the data is choosing the model. This page covers where training data comes from, what you are and are not allowed to do with it, and how to turn a heap of raw sources into a deliberate, documented sample of the world: a mixture with weights, a record of where every piece came from, and a way to take any of it out again.
10,000 ft
Every model is fitted to a dataset, and its behaviour is bounded by what that dataset covers. For most of machine learning's history the dataset was a fixed benchmark someone else had built; in the foundation-model era the dataset is the main thing a lab designs. Collection decides what exists in the training distribution, licensing decides what you may use, and curation decides how much of each thing the model sees. The pages next to this one handle the mechanics that follow: quality filtering and deduplication, labelling and human feedback, and keeping data honest in production. The pre-training pipeline itself is walked end to end in pre-training data, and the law is surveyed at national level in governance and regulation.
2,000 ft
Data flows from sources (the open web, licensed archives, your own product, people you pay to write or label, and generators you run) through acquisition, then a rights and privacy gate that asks four separate questions (copyright, contract, personal data, provenance). What survives is documented so it can be audited and removed, then curated: filtered, deduplicated and sampled into a mixture whose weights are a deliberate statement of what the model should be good at. The result is frozen as a versioned snapshot that training and evaluation both point to.
- Know the target distribution you want the model to serve before you collect anything.
- Collect from the cheapest sources that cover it, and record provenance at the moment of collection.
- Clear rights per source, not per dataset: copyright, terms, personal data and opt-outs are different questions.
- Curate by sampling design: mixture weights, temperature for imbalanced sources, a budget for repetition.
- Freeze and document a version, so every model can name exactly what it was trained on.
Ground level¶
Five places data comes from¶
Every dataset you will meet is some blend of five kinds of source. They differ in cost, scale, legal posture and, most importantly, in whose distribution they sample.
| Source | Examples | Scale | Cost per token | What it samples | Main risk |
|---|---|---|---|---|---|
| Open web | Common Crawl, Wikipedia, GitHub, forums | trillions of tokens | near zero to collect, high to clean | what people chose to publish, weighted by how linkable it is | copyright, personal data, junk, opt-outs |
| Licensed and partnered | news archives, book publishers, stock images, Stack Overflow-style data deals | billions | high, negotiated | an editor's or archive's selection | contract scope, exclusivity, cost |
| First-party | your product's logs, support tickets, user uploads, sensor streams | depends on users | cheap once the product exists | your users, under your product's incentives | consent, purpose limits, feedback loops |
| Commissioned humans | annotators, expert writers, preference raters | thousands to millions of items | the most expensive per item | a guideline document filtered through people | inconsistency, cost, annotator welfare |
| Generated | synthetic textbooks, simulator rollouts, model-written instructions | unbounded | compute only | the generator's own distribution | collapse of tails, inherited errors |
Two consequences follow. First, scale and control trade against each other: the web is the only source big enough for pre-training, and it is also the least controlled. Second, each source samples a different population. The web over-represents English, recent years, technology and whoever writes most; your product logs over-represent your current users and whatever your current model already handles well. Curation is the work of correcting those skews on purpose.
The commissioned and generated rows get their own pages (labelling and distillation and synthetic data). This page concentrates on the first three and on the curation that follows all five.
Inside a web crawl¶
Common Crawl, a non-profit founded in 2007, is the raw material of almost every open pre-training corpus. Its site describes an archive of over 300 billion pages, with 3 to 5 billion new pages added each month. Each monthly crawl is published in three formats, and the choice between them matters more than it looks:
- WARC (Web ARChive): the full HTTP responses, raw HTML included. Heavy, but you control text extraction.
- WAT: metadata and links extracted from each response.
- WET: plain text extracted by Common Crawl's own, fairly crude, extractor.
FineWeb chose to re-extract from WARC files with the trafilatura library rather than use WET,
because WET text kept too much navigation and boilerplate, and the cleaner extraction measurably
improved models trained on it (Penedo et al., 2024). The
lesson generalises: in any pipeline, the earliest transformation is the one that silently caps
quality for everything after it.
A crawler is a guest. The convention that governs it, the Robots Exclusion Protocol, was
standardised only in 2022 as RFC 9309. A site
publishes /robots.txt with groups of rules per User-agent; a crawler uses the most specific
group that matches its name (and only that group), and within a group the longest matching
path rule wins. AI developers now publish distinct user-agent names (OpenAI's GPTBot,
Anthropic's ClaudeBot, Common Crawl's CCBot) so that sites can treat training crawlers
differently from search crawlers, and sites have responded. The Data Provenance Initiative's
audit of 14,000 web domains found that in a single year (2023 to 2024) about 5% of all tokens in
C4, and 28% or more of tokens from its most actively maintained, critical sources, became fully
restricted by robots.txt; terms-of-service restrictions covered 45% of C4
(Longpre et al., 2024). The open web is closing at precisely
the moment models need more of it.
Your robots.txt parser may not implement the standard
RFC 9309 says the longest matching rule wins. Python's standard-library
urllib.robotparser applies rules in the order they are written and returns the first match.
With Disallow: /articles/ written before Allow: /articles/free/, Python blocks
/articles/free/intro.html; a standards-compliant parser allows it. If you crawl, use a
parser that implements the RFC, and log the robots.txt you saw with the date you saw it:
opt-outs change, and you will be asked what you respected at collection time.
How much data is there?¶
Collection is ultimately bounded by the stock of human-written text. Two numbers frame the question.
Demand. The Chinchilla analysis (Hoffmann et al., 2022) found that, for a fixed compute budget, loss is minimised with roughly 20 training tokens per parameter. With training compute \(C \approx 6ND\) for \(N\) parameters and \(D\) tokens, a compute-optimal run needs \(D \approx \sqrt{20C/6}\) tokens:
| Compute (FLOP) | Compute-optimal parameters | Compute-optimal tokens |
|---|---|---|
| \(10^{24}\) | 91B | 1.8T |
| \(10^{25}\) | 289B | 5.8T |
| \(10^{26}\) | 913B | 18.3T |
| \(10^{27}\) | 2.9T | 58T |
| \(10^{28}\) | 9.1T | 183T |
In practice labs train smaller models on far more tokens than this, because a smaller model is cheaper to serve: Llama 3 was pre-trained on about 15T tokens, including its 8B model (Llama 3 team, 2024), nearly 2,000 tokens per parameter. That makes demand grow faster than the table suggests.
Supply. Epoch AI estimated the effective stock of public human text on the indexed web at about \(4\times10^{14}\) tokens (roughly 400T), and projected that frontier training sets would reach it somewhere between 2026 and 2032 (Villalobos et al., 2022, revised 2024). Their estimate already credits the ability to repeat data a few times. Data is no longer the cheap input it was in 2020; it is a constraint, and much of what follows (repetition budgets, synthetic data, licensing deals, first-party data) is a response to it.
Licensing: four questions, not one¶
"Can we use this data?" is four separate questions, and a source can pass one and fail another.
This is a map, not legal advice
The law here moved fast in 2025–2026 and is still moving. What follows is the state of the main decisions as of October 2026, to give you the shape of the questions. For a real decision, ask a lawyer in the jurisdiction that matters.
Copyright. Training copies works (into the corpus, and arguably into the weights), so it needs either permission or an exception.
- United States: fair use, decided case by case. In Bartz v. Anthropic (N.D. Cal., order of 23 June 2025), Judge Alsup held that training on lawfully acquired books was fair use, describing the use as highly transformative, and that buying print books and scanning them was also fair use; but building a library from pirated copies was not. The case then settled for USD 1.5 billion, roughly USD 3,000 per work, which received final approval in July 2026. Two days after Alsup's order, in Kadrey v. Meta, Judge Chhabria also granted summary judgment to Meta, but only because the plaintiffs had not built a record of market harm; his opinion argued that "market dilution" (models flooding the market with competing works) could defeat fair use in a better-argued case. In the opposite direction, Thomson Reuters v. Ross (February 2025, affirmed by the Third Circuit in September 2026) held that copying Westlaw headnotes to train a non-generative legal-search tool that competed with Westlaw was not fair use. The US Copyright Office's report on generative AI training (pre-publication version, May 2025) concluded that some training uses will be fair and others will not, with market effect carrying much of the weight.
- European Union: an exception with an opt-out. The 2019 Copyright in the Digital Single Market Directive allows text and data mining of lawfully accessible works (Article 4) unless the rightsholder has reserved the right "in an appropriate manner, such as machine-readable means". The AI Act adds obligations for general-purpose model providers from 2 August 2025: a policy to respect those reservations, and a public summary of training content following the template the Commission published on 24 July 2025.
- United Kingdom. In Getty Images v. Stability AI (High Court, November 2025) the court held that the trained model was not itself an "infringing copy", because it did not store the works; the training claim itself had been dropped, so UK law on training remains open.
- Japan. Article 30-4 of the Copyright Act permits uses that are not for "enjoying" the expression in a work, which covers most analysis and training, unless the use would "unreasonably prejudice" the rightsholder. Guidance from the Agency for Cultural Affairs (2024) says the exception does not cover training whose purpose is to output the expression of the training works, nor copying databases that are licensed on the market for exactly this kind of analysis.
- India. There is no specific text-and-data-mining exception. In ANI v. OpenAI the Delhi High Court in July 2026 refused ANI an interim injunction against training on its articles; the suit itself has not been decided.
Contract and access. Even where copyright permits copying, terms of service, API licences and paywalls are contracts, and scraping past them can breach the contract or anti-circumvention law. Model outputs are a special case: most commercial model providers' terms restrict using outputs to develop competing models, which matters for distillation.
Dataset licences are often wrong. A dataset's stated licence is only as good as the licences of what went into it. Auditing more than 1,800 fine-tuning datasets, the Data Provenance Initiative found licences omitted on popular hosting sites for over 70% of datasets and miscategorised for over 50% (Longpre et al., 2023), usually in the permissive direction. Trace a dataset to its sources before you rely on its licence; the Data Provenance Explorer does this for the common ones.
Openly licensed corpora exist now. The Common Pile v0.1 collects 8 TB of public-domain and openly licensed text from 30 sources; 7B models trained on 1T and 2T tokens of it were competitive with Llama 1 and 2 7B at similar compute (Kandpal et al., 2025). A permissively licensed model at the frontier is still out of reach, but a respectable one is not.
Personal data¶
Web text is full of people: names, emails, phone numbers, addresses, medical forums, court records. Personal data raises three problems that copyright does not.
- A legal basis to process it. Under the GDPR you need one (consent, legitimate interest and others) and must respect purpose limitation. India's Digital Personal Data Protection Act 2023 does not apply to personal data the person themselves made public (section 3©(ii)), but practitioners read that narrowly: that a page was scrapeable does not mean its subject made it public. The DPDP Rules were notified in November 2025 and phase in until May 2027.
- Memorisation. Models can regurgitate training text. Carlini et al. extracted verbatim names, phone numbers and addresses from GPT-2 (2020), and memorisation grows with model size and with how often a sequence is duplicated (Carlini et al., 2022). Deduplication is therefore a privacy control as well as a quality one.
- Erasure. A right to deletion is easy to honour in a database and very hard in trained weights. The practical answer today is to make removal from the next version cheap: keep provenance at document level, filter PII before training, and retrain on schedule.
Scrubbing PII is done with regular expressions for structured identifiers (emails, phone numbers, card and ID numbers) plus named-entity models for names and addresses, replacing matches with placeholders. It is imperfect in both directions, so it is a mitigation, not a guarantee. Robustness, fairness and privacy covers differential privacy and membership inference.
Curation is sampling design¶
Once you have clean, licensed sources, you still have to decide how much of each the model sees. This is a sampling-design problem, and it helps to state it exactly.
You want the model to serve a target distribution \(p_{\text{target}}\): the mix of languages, domains and tasks your users will bring. You have \(k\) sources \(D_1,\dots,D_k\) with \(n_i\) unique tokens each, and a training budget of \(T\) tokens. You choose sampling weights \(w_i\) (summing to one); source \(i\) then contributes \(w_i T\) tokens and is seen
times (its number of epochs). Three forces pull on the weights:
- Coverage. Every capability you want needs enough tokens. Small, valuable sources (maths, code, a low-resource language, your domain) must be up-weighted or the model barely sees them.
- Repetition. Up-weighting a small source means repeating it. Muennighoff et al. trained about 400 models and found that up to about 4 epochs of repeated data is nearly as good as fresh data, while the value of further repetition decays, reaching about \(1/e\) of a fresh token's value after roughly 15 repetitions (2023).
- Interference. Tokens spent on one domain are not spent on another; too much code can cost prose quality, too many languages can cost each language some quality (the "curse of multilinguality" reported for XLM-R).
GPT-3 is the classic public example: its 300B training tokens took 60% from filtered Common Crawl (0.44 epochs, so most of it never seen) and 3% from Wikipedia (3.4 epochs) (Brown et al., 2020, Table 2.2). The weights encode a belief about quality that the raw sizes do not.
Temperature sampling is the standard knob when sources are wildly imbalanced, as languages are. Start from natural proportions \(p_i = n_i/\sum_j n_j\) and sample with
\(\alpha = 1\) copies the natural imbalance, \(\alpha = 0\) samples every source equally, and values in between flatten the distribution. XLM-R, trained on 100 languages, used \(\alpha = 0.3\) (Conneau et al., 2019).
Read the figure with the repetition result in mind. At \(\alpha = 0.3\) the Swahili data would be seen 97 times, far past the point where repetition still helps; the honest fix is not a lower \(\alpha\) but more Swahili, which is a collection problem. Curation can redistribute the tokens you have; it cannot create coverage you never collected.
Choosing weights by experiment. Hand-tuning against small-model ablations was the norm until 2023. DoReMi learns weights with a small proxy model trained by distributionally robust optimisation over domains: weights from a 280M proxy let an 8B model reach the baseline's accuracy in 2.6 times fewer steps on The Pile (Xie et al., 2023). Data-mixing laws (Ye et al., 2024) and RegMix (Liu et al., 2024) fit a function from mixture weights to loss on many tiny runs and then optimise it, which is the same "small runs predict big runs" logic as scaling laws, applied to the data axis.
Curation for fine-tuning: fewer, better, documented¶
For instruction tuning the trade-off flips: you are no longer short of tokens, you are short of good examples. LIMA fine-tuned a 65B LLaMA on just 1,000 carefully curated prompt–response pairs, and in a blind human comparison its answers were judged equivalent to or better than GPT-4's in 43% of cases (Zhou et al., 2023). The paper's claim is that pre-training supplies the knowledge and a small, consistent fine-tuning set supplies the format. Curation here means: diverse prompts that cover the tasks you care about, responses written to one consistent standard, no near-duplicates of your evaluation set, and a clear record of which examples came from people and which from models. The recipe-level detail is in instruction tuning.
Documentation: datasheets, data cards and manifests¶
Every dataset should answer, in writing: why it was made, what is in it, how it was collected, what was removed, who labelled it, what it should not be used for, and how to report problems. Gebru et al.'s Datasheets for Datasets is the original question list, modelled on electronics datasheets; Google's Data Cards turn it into a template used at scale. For pre-training corpora, Dodge et al.'s documentation of C4 (2021) is the model of what an audit finds when someone finally looks: patents and US military sites among the top sources, machine-translated text, benchmark test examples, and a blocklist filter that disproportionately removed text from and about minority groups.
In engineering terms, documentation means a manifest stored with each dataset version: for every source, its origin URL or contract, retrieval date, licence and legal basis, filters applied (with their versions), token counts before and after each stage, and the hash of the resulting shards. With that, "was this author's book in the training set of model X?" has an answer, and "remove it from the next version" is a filter rather than an archaeology project.
How this shows up in Jarvis
Jarvis, Finny's assistant over a FIRE financial-planning engine, does not train a foundation model, but it still has a curation problem: the most realistic evaluation and routing examples are drawn from planning conversations, which are first-party data full of personal financial detail. Every question on this page applies at small scale: a consent basis for reusing a conversation as an example, identifier scrubbing before it is stored, and a versioned example set so that an eval score always names what it was measured on. The system itself is described in the Jarvis case study.
History¶
The idea that data is a designed artefact is older than deep learning. The Brown Corpus (1961–64) was a deliberately balanced million words of American English, sampled across 15 genres in fixed proportions: a curated mixture before the word existed. The Penn Treebank (1993) showed that careful, expensive annotation creates a field. ImageNet (Deng et al., 2009) applied crowdsourcing to build a labelled image set at a scale no lab could annotate itself, and its 2012 competition launched the deep-learning era.
Language modelling then moved from curated corpora to the web. GPT-2's WebText (2019) used a cheap human quality signal: it kept pages linked from Reddit posts with at least 3 karma, about 45 million links reduced to slightly over 8 million documents and 40 GB of text. C4 (2019) replaced that with explicit rules over Common Crawl; The Pile (2020, Gao et al.) argued for diversity by mixing 22 curated sources; RefinedWeb (2023) showed that web data alone, filtered and deduplicated hard enough, could match curated mixtures; and FineWeb and DCLM (2024) turned curation into an empirical science with public ablations. The legal settlement came after the technical one: 2023–2026 brought the opt-out wave, the first court rulings and the first openly licensed corpora large enough to matter.
First principles¶
Why the data is the specification. Pre-training minimises cross-entropy on the training mixture \(m = \sum_i w_i D_i\). Cross-entropy decomposes as \(H(m, p_\theta) = H(m) + \mathrm{KL}(m \,\|\, p_\theta)\), and \(H(m)\) does not depend on the model, so the ideal model is \(p_\theta = m\) exactly. A model with unlimited capacity would reproduce the mixture, weights and all; a real model approximates it. Nothing in the objective refers to the world, to truth, or to your users: only to \(m\). That is why choosing \(m\) is choosing the model. (The decomposition is derived in entropy, cross-entropy and KL.)
Why you cannot learn what you did not collect. Empirical risk minimisation can only generalise within the support of the training distribution. If a language, a document type or a user population has zero or near-zero weight in \(m\), no amount of model capacity will make the model good at it; it can only be good by accident of transfer. Coverage is a collection decision, not a modelling one.
Why provenance must be recorded at collection time. Information about where a document came from is destroyed by every downstream step: extraction strips the URL's context, deduplication merges copies from different sources, tokenisation merges documents into packed sequences. If provenance is not attached at the start, it cannot be reconstructed later, and then neither licence compliance nor deletion requests nor contamination audits can be answered.
Why the marginal token is worth less over time. Scaling laws give loss as a power law in data, \(L(D) \approx E + B/D^{\beta}\), so each extra token buys less than the one before. Combined with the shrinking open web, this pushes value toward data that is different (new domains, new languages, expert-written, first-party) rather than data that is merely more.
The maths¶
The mixture objective and its minimiser. With source distributions \(D_i\) and weights \(w_i \ge 0\), \(\sum_i w_i = 1\):
Derivation: the minimiser is the mixture
Write \(\mathbb{E}_{m}[-\log p_\theta] = \mathbb{E}_{m}[-\log m] + \mathbb{E}_{m}[\log m - \log p_\theta] = H(m) + \mathrm{KL}(m\,\|\,p_\theta)\). KL divergence is non-negative and zero only when \(p_\theta = m\) (Gibbs' inequality), and \(H(m)\) is constant in \(\theta\). Hence the loss is minimised exactly at \(p_\theta = m\), and the excess loss of any model is its KL from the mixture. Changing \(w\) changes \(m\) and therefore the optimum.
Temperature sampling. From natural proportions \(p_i\), \(q_i \propto p_i^{\alpha}\). Two consequences are worth deriving.
- Log-ratios shrink by \(\alpha\): \(\log(q_i/q_j) = \alpha \log(p_i/p_j)\). A 1,000:1 imbalance becomes about 8:1 at \(\alpha = 0.3\), since \(1000^{0.3} \approx 7.9\).
-
Epochs scale as \(n_i^{\alpha-1}\): substituting \(p_i = n_i/N\),
\[ e_i = \frac{q_i T}{n_i} = \frac{T\, n_i^{\alpha - 1}}{\sum_j n_j^{\alpha}} . \]For \(\alpha < 1\) the exponent is negative, so the smallest sources are repeated the most, and the ratio of repetitions between two sources is \((n_j/n_i)^{1-\alpha}\). In the example above, Swahili (1B) versus English (8,000B) at \(\alpha = 0.3\): \(8000^{0.7} \approx 538\), and indeed 97.28 / 0.18 ≈ 540 in the printed output.
The value of a repeated token. Muennighoff et al. model the effective amount of data when \(U_D\) unique tokens are repeated \(R_D\) times (that is, \(R_D + 1\) epochs) as
Differentiating, the marginal value of one more repetition is \(\partial D'/\partial R_D = U_D\, e^{-R_D/R_D^{\star}}\): the first repetition is worth almost a fresh pass, the fifteenth about \(1/e \approx 0.37\) of one, and infinitely many repetitions add at most \(15.4\,U_D\) effective tokens. This gives curation a budget: as a rule of thumb, beyond four or so epochs a source's weight is buying less than its token count suggests.
Compute-optimal data demand. With \(C \approx 6ND\) and the Chinchilla ratio \(D \approx 20N\), eliminating \(N\) gives \(C \approx 6 D^2/20\), so \(D \approx \sqrt{20C/6} \approx 1.83\sqrt{C}\). Data demand grows as the square root of compute: every 100-fold increase in compute needs 10 times more tokens. That square root is the arithmetic behind "running out of data".
Common misconceptions¶
\"Public\" means \"free to use\"
Publicly accessible is not the same as public domain, nor as "made public by the data subject". Copyright, contract and personal-data law each apply to content anyone can read.
\"More data is always better\"
More distinct, relevant data is better. Repeated data decays in value, off-target data spends budget on the wrong distribution, and low-quality data can make a model worse at fixed compute. The relevant quantity is effective tokens of the distribution you care about.
\"The dataset's licence tells you what you can do\"
It tells you what the dataset's author claimed. Audits find licences missing or wrong for most popular fine-tuning sets, usually in the permissive direction. Trace the sources.
Build it¶
Two small tools. First, the mixture calculator: temperature-sampled weights, epochs per source and effective tokens under the repetition law (NumPy).
import numpy as np
# Unique tokens available per language, in billions (illustrative sizes)
langs = ["English", "Hindi", "Tamil", "Swahili"]
n = np.array([8000.0, 40.0, 6.0, 1.0])
T = 2000.0 # training budget, billions of tokens
def temperature_weights(n, alpha):
p = n / n.sum() # natural proportions
q = p ** alpha
return q / q.sum()
def effective_tokens(unique, epochs, r_star=15.4):
"""Muennighoff et al. 2023: value of repeated data, D' = U + U R*(1 - exp(-R/R*))."""
R = np.maximum(epochs - 1.0, 0.0) # repetitions beyond the first pass
seen = np.minimum(epochs, 1.0) * unique # fresh tokens actually seen
return seen + unique * r_star * (1 - np.exp(-R / r_star)) * (epochs > 1)
print(f"{'alpha':>5} | " + " | ".join(f"{l:>14}" for l in langs))
for alpha in [1.0, 0.5, 0.3, 0.0]:
w = temperature_weights(n, alpha)
epochs = w * T / n
eff = effective_tokens(n, epochs)
cells = [f"{100*wi:5.2f}% {ei:6.2f}ep" for wi, ei in zip(w, epochs)]
print(f"{alpha:>5} | " + " | ".join(cells),
f"| effective {eff.sum():7.0f}B of {T:.0f}B")
Output:
alpha | English | Hindi | Tamil | Swahili
1.0 | 99.42% 0.25ep | 0.50% 0.25ep | 0.07% 0.25ep | 0.01% 0.25ep | effective 2000B of 2000B
0.5 | 90.15% 0.23ep | 6.37% 3.19ep | 2.47% 8.23ep | 1.01% 20.16ep | effective 1977B of 2000B
0.3 | 72.10% 0.18ep | 14.71% 7.36ep | 8.33% 27.75ep | 4.86% 97.28ep | effective 1789B of 2000B
0.0 | 25.00% 0.06ep | 25.00% 12.50ep | 25.00% 83.33ep | 25.00% 500.00ep | effective 978B of 2000B
Read the last column. At \(\alpha = 0.3\) about a tenth of the budget is spent on repetitions that are worth little; at \(\alpha = 0\) half of it is. The low-resource languages gain share at a real cost, and the cost is visible in one number.
Second, a robots.txt check with the standard library, showing how groups work: a crawler
obeys the most specific User-agent group that names it, and only that group.
from urllib.robotparser import RobotFileParser
robots_txt = """
User-agent: GPTBot
Disallow: /
User-agent: CCBot
Disallow: /articles/
User-agent: *
Allow: /articles/free/
Disallow: /articles/
Disallow: /account/
"""
rp = RobotFileParser()
rp.parse(robots_txt.splitlines())
agents = ["GPTBot", "CCBot", "ClaudeBot", "MyResearchCrawler"]
paths = ["/", "/articles/free/intro.html", "/articles/paywalled.html", "/account/settings"]
print(f"{'path':<28}" + "".join(f"{a:>19}" for a in agents))
for p in paths:
url = "https://example.com" + p
print(f"{p:<28}" + "".join(f"{'allow' if rp.can_fetch(a, url) else 'BLOCK':>19}" for a in agents))
Output:
path GPTBot CCBot ClaudeBot MyResearchCrawler
/ BLOCK allow allow allow
/articles/free/intro.html BLOCK BLOCK allow allow
/articles/paywalled.html BLOCK BLOCK BLOCK BLOCK
/account/settings BLOCK allow BLOCK BLOCK
Two surprises worth understanding: CCBot may fetch /account/settings, because its own group
replaces the * group entirely and says nothing about /account/; and CCBot may not fetch the
free articles, because the Allow lives only in the * group. Site owners make exactly these
mistakes, and crawler authors must honour what the file says, not what the owner meant.
Things to try
- Swap the order of the
AllowandDisallowlines in the*group and rerun: Python's first-match parser now blocks/articles/free/, while RFC 9309's longest-match rule would not. - Find the \(\alpha\) that keeps every language at or below 4 epochs for this corpus and budget. How much Swahili share does that buy compared with \(\alpha = 0.3\)?
- Replace the illustrative sizes with real per-language counts from a multilingual corpus such as FineWeb2 (Penedo et al., 2025). Which languages hit the repetition ceiling first?
- Add a fifth "source" for synthetic Swahili text with unlimited size but a value discount of 0.5 per token. When does it beat repeating the real data?
Check yourself¶
Why does changing mixture weights change the model even if every source is already in the corpus?
Because the loss is an expectation under the mixture \(m = \sum_i w_i D_i\), and the optimal model is \(p_\theta = m\). The weights define the target distribution, not merely which data is present. Up-weighting code moves the optimum toward code.
A source has 5B unique tokens and receives 2% of a 3T-token budget. How many epochs, and roughly how much is the repetition worth?
\(e = 0.02 \times 3000 / 5 = 12\) epochs, so \(R_D = 11\) repetitions. Effective tokens \(= 5 + 5 \times 15.4 \times (1 - e^{-11/15.4}) = 5 + 77 \times 0.51 \approx 44\)B, against 60B tokens actually spent: about 27% of the source's budget buys nothing new.
What does α = 0 in temperature sampling do, and why is it rarely used?
It samples every source equally regardless of size. Small sources are then repeated enormously (500 epochs for the 1B-token language above), far past the point of useful repetition, which wastes compute and invites memorisation.
A crawler's user-agent is 'ResearchBot'. The site's robots.txt has a group for 'ResearchBot' that disallows /private/ and a '*' group that disallows /. May it fetch /index.html?
Yes. Under RFC 9309 a crawler obeys only the most specific matching group; the
ResearchBot group says nothing about /index.html, so it is allowed. The * group does
not apply to it.
Under the EU regime, what two obligations does a general-purpose model provider have regarding training data from 2 August 2025?
A policy to comply with EU copyright law, including respecting machine-readable text-and-data mining reservations under Article 4 of the DSM Directive, and a public summary of training content following the Commission's template (published 24 July 2025).
Why is deduplication relevant to privacy?
Memorisation rises steeply with how often a sequence appears: Kandpal et al. found that a sequence present 10 times is generated about 1,000 times more often than one present once. Removing duplicates removes the repeated personal details models are most likely to regurgitate.
Compute-optimal training at 10^28 FLOP needs how many tokens, and why is that a problem?
About \(1.83\sqrt{10^{28}} \approx 1.8\times10^{14}\), i.e. 180T tokens, a large fraction of Epoch AI's ~400T estimate of the effective stock of public human text, before allowing for overtraining or the opt-out wave. Hence the interest in repetition, synthetic data and licensed and first-party sources.
Hard: your product logs are your best fine-tuning data. What can go wrong if you train on them naively?
They sample your current users under your current model: tasks the model already handles well are over-represented, failures that made users leave are under-represented, and the model's own outputs appear as "data". Training on them amplifies the existing behaviour (a feedback loop) and can break consent or purpose limits. See data in production.
Go deeper¶
Papers
- Consent in Crisis: The Rapid Decline of the AI Data Commons — Longpre et al., 2024. The audit of robots.txt and terms across 14,000 domains; read the figures on restriction over time.
- The Data Provenance Initiative — Longpre et al., 2023. What a licence audit of 1,800+ datasets finds; the case for tracing provenance.
- Will we run out of data? — Villalobos et al., 2022 (revised 2024). The supply-and-demand model behind the data-wall debate; section 2 for the stock estimate.
- Scaling Data-Constrained Language Models — Muennighoff et al., 2023. How much repeated data is worth; the effective-data formula used above.
- DoReMi: Optimizing Data Mixtures — Xie et al., 2023. Learning mixture weights with a small proxy model.
- Datasheets for Datasets — Gebru et al., 2018. The questions every dataset should answer; use it as a checklist.
- Documenting Large Webtext Corpora: C4 — Dodge et al., 2021. What an audit of a famous corpus actually found.
- The Common Pile v0.1 — Kandpal et al., 2025. How far openly licensed text gets you.
- LIMA: Less Is More for Alignment — Zhou et al., 2023. Curation over quantity for fine-tuning.
Official documents
- RFC 9309: Robots Exclusion Protocol — IETF, 2022. Short and exact; section 2.2 on group and rule matching.
- EU template for the public summary of training content — European Commission, 2025. What a general-purpose model provider must disclose.
- Copyright and Artificial Intelligence — US Copyright Office. Part 3 is the analysis of training and fair use.
- Bartz v. Anthropic: order on fair use — N.D. Cal., June 2025. The most-cited US ruling on training; the distinction between training and acquisition is the part to read.
Videos and lectures
- Deep Dive into LLMs like ChatGPT — Andrej Karpathy, 2025. Opens with the pre-training data pipeline, using FineWeb as the worked example.
- Stanford CS336: Language Modeling from Scratch — Stanford Online. The data lectures cover sources, filtering and mixtures with real pipelines; course site at cs336.stanford.edu.
Articles and tools
- Will we run out of data? (Epoch AI) — Epoch AI. The accessible version of the paper with updated charts.
- Data Provenance Explorer — Trace and filter popular fine-tuning datasets by licence and source.
Where this leads¶
- Quality filtering and deduplication: once you have the sources, the maths of removing junk and duplicates at trillion-token scale.
- Labelling and human feedback: the commissioned-human source in depth, from guidelines to preference data.
- Pre-training data: the full pipeline from Common Crawl to a training batch.
- Distillation and synthetic data: the generated source, and why it cannot fully replace collection.
- Governance and regulation: the wider legal landscape for AI in the EU, US and India.