Natural language processing
Corpus Design: Domains, Documents, Rights, and Sampling
Design corpora whose units, provenance, permissions, coverage, splits, and documentation match the intended language system.
By the end you can
- Choose a document and example unit that preserves the context needed by the task
- Compare traffic, stratified, challenge, and longitudinal sampling strategies
- Identify licensing, consent, provenance, duplication, and contamination risks
- Document represented populations, missing evidence, and intended limitations
Key idea
A large corpus can still describe the wrong world
In May 2021 two of the largest US surveys were asking a simple question: how many adults had received a first dose of a COVID-19 vaccine. Delphi-Facebook was collecting about 250,000 responses per week. The Census Household Pulse was collecting about 75,000. Measured against the CDC benchmark, Delphi-Facebook overstated adult first-dose uptake by 17 percentage points and the Household Pulse by 14. An Axios-Ipsos online panel of about 1,000 responses, run following AAPOR practice, was accurate.
The analysis appeared in Nature in 2021. Its abstract puts the consequence in one sentence: “We show how a survey of 250,000 respondents can produce an estimate of the population mean that is no more accurate than an estimate from a simple random sample of size 10.” Two hundred and fifty thousand responses, worth ten.
Ten million customer messages look impressive in exactly the same way. Most can come from one language, one channel, or one policy period. If the product serves voice transcripts, rural users, and newly introduced services, raw volume does not create coverage. A corpus is a sampling decision: whose language, which situations, and which periods become visible to the model.
Dataset size cannot repair a missing population or a broken evidence boundary.
Comparison
Possible units of language data
The unit should match the context required by the decision and the boundary used for splitting. The unit is also what a split can be grouped by. Choosing it decides, in advance, which kinds of leakage are even detectable later.
Utterance or sentence
A small segment treated as one example.
- Efficient annotation
- Weak surrounding context
- Risk of document leakage
- Useful for local intent
Document
A message, article, report, or case file.
- Preserves discourse
- Longer inputs
- Supports document tasks
- Needs document-level splits
Conversation
A sequence of turns and state changes.
- Captures repair and context
- Speaker identity matters
- Harder annotation
- Requires conversation grouping
Event-centered bundle
Text plus records around a real-world event.
- Supports temporal reasoning
- Joins create leakage risk
- Useful for incidents
- Needs availability timestamps
Visual
Four complementary views of a corpus
No single sample supports every claim about system behavior. A traffic sample describes who turned up, not who exists. The 250,000 responses a week that missed US first-dose vaccine uptake by 17 percentage points in May 2021 were a very large record of who was willing to answer on one platform. No additional week of them would have closed the gap — and the 1,000-response panel did not have that gap to close.
Traffic sample
Estimates average behavior under the observed deployment distribution.
Stratified sample
Guarantees enough evidence for selected languages, classes, channels, or populations.
Challenge sample
Concentrates known ambiguity, rare hazards, and adversarial cases.
Longitudinal sample
Preserves time to test policy, vocabulary, and population change.
Example
Questions every source should answer
A corpus record should make two things inspectable: how the text was acquired, and what obligations travel with it.
Writing those answers down is a standing professional practice, not a courtesy. That was the argument of the data-statements paper, published in Transactions of the Association for Computational Linguistics in 2018. Bender and Friedman offered data statements as “a design solution and professional practice for natural language processing technologists”. Their case is half ethical and half arithmetic. A claim that a result generalises is a claim about a population. A dataset whose population was never described cannot support one. The practice, they argue, “will help alleviate issues related to exclusion and bias in language technology, lead to better precision in claims about how natural language processing research can generalize and thus better engineering results” — which is to say, better engineering.
Six years later a legislature wrote much the same checklist into law. The EU's AI Act, Regulation (EU) 2024/1689, was published on 12 July 2024. Its Article 10, “Data and data governance”, governs high-risk AI. Paragraph 3 reads: “Training, validation and testing data sets shall be relevant, sufficiently representative, and to the best extent possible, free of errors and complete in view of the intended purpose.” For systems in scope, the questions below stopped being professional courtesy and became compliance items.
- Origin: Which system, publisher, participant, device, or archive produced the text? Article 10(2)(b) of the AI Act asks for exactly this — “data collection processes and the origin of data, and in the case of personal data, the original purpose of the data collection”.
- Purpose: Why was the language collected, and does the proposed use match that purpose? Point (b) binds origin and original purpose in the same clause. A corpus reused outside the purpose it was gathered for has to say so, rather than let the reuse pass unrecorded.
- Rights: Which license, consent, contract, or legal basis permits storage, annotation, and modeling? One set of books got two different answers in June 2025. In Bartz v. Anthropic, Judge William Alsup held that training LLMs on the books was “exceedingly transformative” and a fair use, and that destructively scanning purchased print copies was fair use too. Keeping the pirated ones was not. Anthropic had “pirated over seven million copies of books” from Books3, LibGen and PiLiMi: “However, Anthropic had no entitlement to use pirated copies for its central library. Creating a permanent, general-purpose library was not itself a fair use excusing Anthropic’s piracy.” The same text, acquired two ways and retained one way, produced two different legal answers. The case then settled for $1.5 billion, roughly $3,000 per work across about 500,000 titles.
- Time: When was the text created, observed, transformed, and made available to the prediction workflow? A corpus with no availability timestamps cannot support a time-boundary split, and cannot show that the model was not told the future.
- Transformations: Which OCR, transcription, filtering, redaction, translation, or deduplication steps changed it? Each one leaves the corpus different from its sources, and none of them is visible from the file size.
- Withdrawal: Can a source, user, or document be removed from future datasets and indexes? The Danish Rights Alliance described Books3 as “a collection of approximately 200,000 illegal e-books originating from an illegal German file-sharing service”. It had the dataset taken down in 2023: “The effort bore fruit in mid-July when the host of Books3, after being contacted by Rights Alliance, chose to remove Books3 from their website.” It had been busy right up to the end — “in June 2023 alone, Books3 was downloaded approximately 4,000 times from the online platform HuggingFace”. Removal from the index is not removal from what was trained on it. In June 2025 the Bartz court was still counting “Books3, an online library of 196,640 books that he knew had been assembled from unauthorized copies of copyrighted books — that is, pirated”, downloaded by an Anthropic co-founder in January or February 2021.
Figure
Analogy
A survey rather than a warehouse
A national survey samples a country, and the arithmetic of that sampling is not a metaphor. Both 2021 figures have since been reproduced by someone else, from different models. Rebecca Andridge did it in 2024, working independently: “Both the Delphi-Facebook COVID-19 Trends and Impact Survey (CTIS) and Census Household Pulse Survey (HPS) overestimated uptake substantially, by 17 and 14 percentage points in May 2021, respectively.” Two teams, two methods, the same two numbers. And the accurate estimate came from about 1,000 responses collected following AAPOR practice, not from the quarter of a million.
Collecting more responses from one neighborhood does not make the sample representative of the entire country. The sampling frame and nonresponse still matter, and neither of them shrinks as the sample grows. Corpora can contain repeated text from the same speaker or source, creating dependencies stronger than survey observations. Coverage claims still require a defined population.
A corpus supports only the population and time period its sampling process can defend.
Evaluation leakage includes more than exact duplicates
A test document can appear in training through quotes, mirrored pages, paraphrases, templates, translations, or shared conversation fragments. Repeated authors and organizations can also leak distinctive style across random splits.
The size of the problem has been measured. Over 1% of the unprompted output of language models trained on standard datasets is copied verbatim from the training data. That is Lee and co-authors, in 2022. They also found a single English sentence of 61 words sitting in C4 over 60,000 times, until they removed it. Then the finding that reaches evaluation directly: “We can also reduce train-test overlap, which affects over 4% of the validation set of standard datasets, thus allowing for more accurate evaluation.” Models retrained on the deduplicated data emitted memorized text ten times less frequently.
Duplication does not raise the risk in proportion to itself. Kandpal and co-authors, working separately in 2022, found the relationship steeply superlinear on their own measurements: “a sequence that is present 10 times in the training data is on average generated ~1000x more often than a sequence that is present only once”. Ten copies of a test item are not ten times the exposure. They are roughly a thousand.
Use source-aware deduplication, group splits, time boundaries, and semantic overlap inspection. Keep protected challenge sets outside routine tuning and prompt development.
The question is not only “Is this file duplicated?” but “Has this answer pattern already been exposed?”
Steps
Build a defensible corpus plan
Write the plan before bulk collection, so that convenience does not silently become methodology.
What happens without a plan is on the record. In 2021 Dodge and co-authors set out to provide “some of the first documentation for the Colossal Clean Crawled Corpus (C4; Raffel et al., 2020), a dataset created by applying a set of filters to a single snapshot of Common Crawl”. That sentence already contains the problem. Some of the first — for a corpus whose English variant is 305 GB of compressed JSON holding 364,868,892 training documents and 156 billion tokens, released with only minimal documentation.
When they read it, they found “a significant amount of text from unexpected sources like patents and US military websites”. They found “machine-generated text (e.g., from machine translation systems) and evaluation examples from other benchmark NLP datasets”. And they found that “blocklist filtering disproportionately removes text from and about minority individuals”. Every one of those is a property of the sampling. None of them is visible from the size.
1. Define the target language environment
Name users, domains, channels, languages, time range, and expected change.
2. Select evidence units
Choose utterance, document, conversation, or event bundles with stable identifiers.
3. Create a sampling matrix
Allocate traffic, strata, rare hazards, and future-like periods.
4. Record provenance and permissions
Attach source, purpose, rights, transformations, retention, and deletion paths.
5. Audit overlap and absence
Measure duplication, source concentration, missing groups, and unobservable attributes.
Position
A corpus filter is an editorial policy, not a hygiene step
Colossal is a measurement anyone can check: 305 GB of compressed JSON, 364,868,892 documents in the English training split. Clean is a decision somebody made. The section above has just shown what it costs to ship that decision with only minimal documentation.
The audit came back with four things at once: text from unexpected sources like patents and US military websites; machine-generated text from translation systems; evaluation examples from other benchmark NLP datasets; and a blocklist filter that disproportionately removes text from and about minority individuals. Take two of those together, because they describe the same filtering pass from opposite sides. What it admitted means a model trained on this corpus has already seen evaluation examples from other people's benchmarks — the same exposure Lee and co-authors put at over 4% of the validation set of standard datasets. What one of its filters excluded settled, across a whole snapshot of Common Crawl, which people — and which text about them — were treated as worth keeping.
Neither of those is a hygiene outcome. They are editorial judgements. The second was executed by whoever wrote the pattern list, on text nobody downstream would ever see. Bender and Friedman's argument earlier in this lesson gives the general form: a claim that a result generalises is a claim about a population, so a dataset whose population was never described cannot support one. The form this corpus takes is sharper. The population was described, precisely, by a blocklist — and what shipped beside it was minimal documentation.
So the course takes the side that “we filtered it” is not a reassurance but a claim requiring a document: which patterns, applied at which stage, with what measured on the text they removed. That position now has statutory company. Article 10(2)(f) of the AI Act requires, for high-risk systems, “examination in view of possible biases” — an examination of precisely the pass that produced the blocklist finding. Volume is not a credential for any of that. Every finding in the audit is a property of the sampling. None of them is visible from the size, and none of them is repaired by more of it.
“We filtered it” names a decision, and a decision is something you can be asked to publish.
A corpus description should make absence visible
Whoever documents a corpus should name collection procedures, annotation processes, recommended uses, excluded uses, and known gaps. It should also report what cannot be measured because demographic or provenance information is unavailable.
That form has an origin and a name. Gebru and co-authors wrote it down in 2018 as one sentence: “By analogy, we propose that every dataset be accompanied with a datasheet that documents its motivation, composition, collection process, recommended uses, and so on.” The paper is called Datasheets for Datasets, and it reached Communications of the ACM in 2021.
It did not stay a paper. NIST's AI Risk Management Framework Playbook lists “Datasheets for Datasets” as an AI Transparency Resource under more than a dozen subcategories, and cites the Communications of the ACM article in its references, alongside the data statements guide. And Article 10(2)(h) of the AI Act requires of high-risk systems “the identification of relevant data gaps or shortcomings that prevent compliance with this Regulation” — absence, written down, as an obligation rather than a confession.
Silence is not neutrality. If a corpus lacks certain dialects, genres, or consent records, future teams need that limitation before interpreting model behavior.
Documented absence is safer than an undocumented claim of representativeness.
Key takeaways
- Corpus design determines which speakers, situations, genres, channels, and periods an NLP model can learn from. In May 2021 Delphi-Facebook's roughly 250,000 responses a week overstated US adult first-dose vaccine uptake by 17 percentage points, while an Axios-Ipsos panel of about 1,000 was accurate.
- The example unit must preserve the context required by the real decision and the intended split boundary.
- Traffic, stratified, challenge, and longitudinal samples answer different evaluation questions, and a traffic sample describes who turned up rather than who exists.
- Provenance, permissions, duplication, and temporal availability are part of data quality. Article 10(2) of the EU AI Act makes origin, original purpose, bias examination and data gaps binding for high-risk AI, and Bartz v. Anthropic priced a retained library of pirated books at $1.5 billion.
- Evaluation contamination includes semantic and procedural exposure, not only identical files. Train-test overlap affects over 4% of the validation set of standard datasets, and a sequence duplicated 10 times is regenerated about 1000 times more often than one seen once.
- A responsible corpus description records both represented evidence and important absences. Gebru and co-authors named the form in Communications of the ACM, and NIST's AI Risk Management Framework Playbook adopted it as an AI Transparency Resource.