A language model learns from the tokens we actually show it. Choosing those tokens means deciding which sources to collect, which text survives cleaning, and how often repeated content appears. This reading follows a web corpus from crawl to training input, connecting each decision to the distribution learned by the model and the compute spent learning it.
- Scope
- Printed slides 51–93 of the current architecture deck, ending at “Summary: preparing pre-training data.” That summary is PDF page 91; printed labels 91–92 are absent in this file. Links below use PDF pages. The next divider, “The actual pre-training” (printed 94), is outside this handout.
- Assigned papers
- None. This handout is the reading for Session 15. Papers are linked as evidence and optional further reading.
- Time
- 5–7 minutes for the warm-up, then 45–55 minutes for the core reading (§1–§4 and §7). Optional: 10–15 minutes for the bonus notes (§5), and 20–30 minutes for the CPU lab and code reading (§6).
- By the end
- Distinguish corpus size from processed tokens; propose and audit cleaning rules; explain why duplicates change training; trace a data pipeline; interpret reference-LM perplexity without treating it as a universal quality score.
- Assumes
- Next-token loss and perplexity from Handout #2, and tokenization from Handout #9. The model architecture is held fixed here.
Slide-to-reading map
| Printed slides | Reading and emphasis |
|---|---|
| 51–54, 56–57 | §1: scale, Common Crawl, multiple snapshots, and inspecting samples |
| 55 · Bonus | §5.1: WARC/WAT/WET — optional |
| 58–61 | §2: cleaning, C4 heuristics, and interpreting the experiment |
| 62–66 | §3: why deduplicate, what counts as a duplicate, and why not remove every repetition |
| 67–80 · Bonus | §5.2: short algorithm/policy comparison — optional; no implementation required |
| 81, 83 | Brief audit questions in §4.3; detailed follow-ups are bonus |
| 82, 84–86 · Bonus | §5.3: freshness, mixtures, and language filtering — optional |
| 87–90 | §4: end-to-end pipeline and reference-LM scoring |
| 93 (PDF page 91) | §7: core synthesis and practice |
Warm-up: which data reaches the loss?
Predict before opening the answers. These are original, ungraded preparation questions.
A corpus has 20 billion tokens under a fixed tokenizer. Training processes 60 billion tokens by taking three complete passes. How many distinct corpus token positions were available, and how many token presentations did training consume?
Reveal the answer
20B positions and 60B presentations. Repetition increases exposure, not the size of the underlying corpus. “Distinct positions” does not imply distinct strings or independent information: the original corpus may itself contain copies.
Your dataset has nine copies of document A and one of document B, with equal lengths. You sample documents uniformly. What fraction of draws is A? What happens after keeping one copy of each?
Reveal the answer
Initially 90%; after deduplication 50%. Removing copies changes the sampling distribution even though both unique documents remain. Different lengths or token-based sampling require accounting for the token contributions too.
A Wikipedia-trained LM assigns higher perplexity to a correct Python function than to a generic encyclopedia paragraph. Does that establish that the function is lower-quality training data?
Reveal the answer
No. It establishes that the function is less predictable under that model and tokenization. Whether to keep it depends on the target corpus and evaluation: code is useful for a code-capable model. This is the key limitation of the quality proxy in §4.2.
1Collecting a corpus: size, coverage, and provenance
1.1 What does “trained on a trillion tokens” count?
Slide 52 illustrates the move from billions to trillions of processed tokens. The useful lesson is the order of magnitude, not a table of model names to memorize. A token count depends on the tokenizer, the text retained, and repetition during training. Two systems reporting the same number of tokens may have seen different amounts of text and very different distributions.
Keep three quantities separate: raw collected text, retained corpus tokens after preparation, and tokens processed during training. With a fixed model and sequence setup, training arithmetic grows roughly with processed tokens. Repeated boilerplate still consumes that budget.
1.2 Why use Common Crawl?
Common Crawl releases large web snapshots collected over time. Reusing a crawl avoids building a crawler, but leaves the hard work of turning web pages into suitable training text. A snapshot is an incomplete sample of the web, shaped by discovery, reachability, and crawl choices. It is not a uniform sample of human language.
Combining snapshots increases coverage, while also adding recrawls, mirrored pages, and older versions. A URL is provenance, not a reliable identity for text: one page may change at the same URL, and the same text may appear at several URLs. Record the snapshot, source URL, extraction version, and later processing decisions so you can explain where retained text came from.
1.3 Read examples before choosing rules
Slide 57 links the instructor’s sample Common Crawl documents. For a short inspection, read several documents and annotate useful content, navigation, repeated templates, extraction failures, language, and domain. A handful of examples suggests hypotheses; it cannot estimate how common a problem is. Test a proposed rule on a separate random sample and on known useful edge cases.
| Synthetic excerpt | Possible interpretation | Question before filtering |
|---|---|---|
Home · Sign in · Subscribe | Navigation left by extraction | Can we remove the menu and preserve the article? |
def square(x): return x*x | Useful code without prose punctuation | Would a prose-only rule reject a desired domain? |
| The same article on ten mirror sites | Repeated training exposure | Which copy should survive, and at what matching granularity? |
2Cleaning: improve the training signal, then audit the tradeoff
2.1 A heuristic is a testable choice
Slides 59–60 introduce C4’s rule-based cleaning. Examples include requiring terminal punctuation, minimum sentence and word counts, and removing placeholder text such as “Lorem ipsum.” These rules approximate desirable prose; they do not define all useful language. A short answer, poem, equation, or code snippet can be valid even when it fails a prose rule.
Separate extraction (finding the main text), repair (removing a corrupt span), and rejection (dropping a unit). Removing a menu from an article is different from rejecting the whole page because it contains a menu. Likewise, normalization for a matching key need not overwrite the original training text: lowercasing and replacing numbers can erase meaningful distinctions.
A filter keeps only documents with at least five sentences ending in punctuation. Give one useful document it could reject and one low-value document it could still retain. What would you measure before deploying the rule?
Reveal the answer
It could reject a short accurate explanation or code sample, and retain five polished spam sentences. Inspect accepted and rejected samples; label usefulness under a stated goal; measure rejection rates by source/domain/language; then compare downstream quality under a controlled training budget. Passing syntax rules is evidence about form, not truth or relevance.
2.2 What the C4 comparison establishes
Slide 61 draws on Raffel et al., T5 (2020), §3.4 and Table 8. The unfiltered corpus is larger on disk yet performs worse in the reported comparison. Two columns illustrate the result:
| Corpus | Reported size | GLUE ↑ | SuperGLUE ↑ |
|---|---|---|---|
| C4 | 745 GB | 83.28 | 71.36 |
| C4, unfiltered | 6.1 TB | 81.46 | 68.04 |
This supports the value of the tested curation recipe in that setup. It does not prove that smaller corpora always win, that every individual rule helps, or that disk bytes measure training tokens. The same study reports task-dependent gains from domain-focused data: a corpus that matches an evaluation domain can help that domain without being the best universal mixture.
2.3 A useful audit has a denominator
For every stage, record input/output documents and tokens, rejection reasons, and affected sources. “We removed 80%” is incomplete: 80% of documents, bytes, or tokens? Relative to the raw crawl or the preceding stage? Sequential stage percentages multiply only when the denominator is clear. For overlapping rules, count both their individual flags and the final unique removals.
To compare training recipes, hold the model, tokenizer, evaluation, and training budget fixed, and report how you matched that budget. A fixed number of steps only matches processed tokens when the effective token batch size also matches. Inspect both aggregate quality and the domains a rule might disproportionately remove.
3Deduplication changes what the model repeatedly learns
3.1 Copies consume compute and alter the objective
Repeated pages, templates, and long copied passages receive repeated next-token losses. With token-averaged training, each presentation contributes to the empirical objective:
$$\mathcal L(\theta)=\frac{1}{T}\sum_{i=1}^{T}-\log p_\theta(x_i\mid x_{<i}).$$Duplicating a document increases the share of terms coming from that document. Deduplication therefore changes both the amount of repetition and the effective weighting of content. In Lee et al. (2022), deduplication reduced memorized output and helped training efficiency; the paper also examines train–validation overlap. Removing overlap makes evaluation more informative, while better held-out loss alone does not establish that all overlap is gone.

Read the figure · What experiment is missing?
The staged comparison supports the combined recipe in that setup. To isolate each stage’s effect, test an ablation with the other stages fixed; also report retained tokens and matched training budgets. The chart does not establish one algorithm as best for every corpus, nor compare a new model architecture.
3.2 “Duplicate” requires a unit and a matching rule
Whole-document exact matching catches copies but misses a copied paragraph inside otherwise different pages. Paragraph or substring matching finds smaller repeated units, but can also remove legitimate quotations or shared context. Near-duplicate matching catches small edits; it can also merge two versions whose small differences matter. “The dose is 5 mg” and “The dose is 50 mg” must not be treated as interchangeable merely because their words mostly match.
The core choice is semantic and operational: what unit is compared, what counts as equivalent, which population is searched, and what survives? A scalable algorithm implements that policy; it does not decide the right policy for you. §5.2 gives an optional overview of the algorithms on the bonus slides.
3.3 Why removing every repetition can hurt
Repeated boilerplate can crowd out diverse examples, but repeated facts in different useful contexts can reinforce learning. Slide 65’s curve is a conceptual warning, not a measured universal optimum. More removal is not an objective by itself. Tune a policy against quality, coverage, and compute; preserve a record of removed units so you can inspect over-aggressive cases.
If you randomly split a corpus before handling copied content, the same text can land in training and validation. Grouping related copies before splitting helps prevent this particular leakage; verify overlap again afterward, including the granularity you care about. Exact matching alone will not detect paraphrases or every copied fragment.
4Trace the pipeline and interpret its scores
4.1 Each stage changes the input to the next
Slides 87–90 walk through a CCNet-style pipeline: extract text from a crawl, shard it for processing, normalize comparison keys and remove repeated paragraphs, identify language, then score text with a reference LM. Actual recipes differ in their order and retention policies; the diagram is one example, not a mandatory universal pipeline.

A shard is a chunk used to distribute processing. It is not automatically a statistically independent sample. If workers deduplicate only inside their own shards, copies in different shards survive. If you need wider coverage, matching state or an additional comparison stage must cross those boundaries.
4.2 Reference-LM perplexity measures predictability
Recall from Handout #2 that perplexity is the exponential of mean negative log probability. For a reference model $q$ and a scored sequence of length $n$:
$$\operatorname{PPL}_q(x)=\exp\!\left(-\frac{1}{n}\sum_{i=1}^{n}\log q(x_i\mid x_{<i})\right).$$A model trained on Wikipedia can score how predictable a passage is under an encyclopedia-like distribution. Extremely high perplexity can flag corrupted text, but also valid code, specialized notation, or another language. Low perplexity can flag familiar or formulaic language; it does not by itself prove that a document is a duplicate. Duplicate detection requires a separate overlap test.
Only compare scores with a consistent model, tokenizer, normalization, and treatment of boundaries. A score of 50 from one tokenizer need not mean the same thing as 50 from another. Averaging paragraph perplexities is also not document perplexity: aggregate log scores and token counts before exponentiating. §6 follows this in real code.
4.3 What should the final corpus report contain?
Keep a stage ledger: source/snapshot versions, extraction and filter settings, before/after token counts, duplicate granularity and scope, and the final sampling policy. Evaluate on held-out data with an overlap audit. Slides 81 and 83 ask two additional questions: how old is the information, and which sources dominate? The detailed methods are optional (§5.3), but recording timestamps and source counts makes these questions answerable.
Static trace: with a minimum of 5 words, the 8-document/45-word input becomes 6 documents/37 words without deduplication; exact matching leaves 5/31; lowercasing and collapsing whitespace leaves 3/19. Documents a, f, and g survive the last setting. The code document has four words and is rejected despite being valid code. The original text is preserved; only the matching key is normalized. The downloadable lab verifies these counts.
5Bonus slides — optional, concise reference
Skip this section on the first pass. It summarizes the blue Bonus slides without requiring algorithm implementation or memorization of dataset recipes. The core practice in §7 does not depend on these details.
Optional bonus · §5.1 File formats (slide 55)
WARC stores web archive records such as HTTP responses; WAT contains derived metadata; WET contains extracted plain text with record metadata. WET avoids doing HTML extraction yourself but still needs cleaning. These formats describe representations of a crawl, not quality grades. The file-format distinction also appears in the pipeline figure; memorizing archival details is optional.
Optional bonus · §5.2 Algorithms and policy choices (slides 67–80)
| Method | What it helps find | Important limit |
|---|---|---|
| Document hash (67) | Exact equality of the chosen text/key | Small edits normally change the key; collisions are possible. Hash equality is a candidate identity check, not semantic equivalence. |
| Suffix array (68–72) | Repeated exact substrings, including parts of documents | Exact matching at a smaller unit, not fuzzy matching. Corpus boundaries must prevent matches spanning unrelated documents. |
| MinHash + candidate retrieval (73) | Near-duplicate documents via similarity of token-shingle sets | Estimates Jaccard overlap; tokenization, shingle size, and thresholds change candidates. High overlap does not imply equivalent meaning. |
| Bloom filter (74) | Compact membership checks for keys such as paragraph hashes | “Possibly present” may be a false positive; “absent” is reliable for inserted keys under the standard no-deletion assumptions. It is not inherently a pairwise similarity score. |
For $T=\texttt{abaaba\$}$, the sorted suffix indices are $[6,5,2,3,0,4,1]$. Suffixes beginning with aba start at positions 0 and 3 and are adjacent in sorted order. The sentinel is index 6 under zero-based indexing; the slide’s left-hand index labels have a typo. Do not implement suffix sorting by copying every suffix for a large corpus.
For shingle sets, $J(A,B)=|A\cap B|/|A\cup B|$. Sets $\{a,b,c,d\}$ and $\{a,b,c,e\}$ have similarity $3/5=0.6$. Near-duplicate policies usually select high similarity; the slide-73 “$<0.8$” should not be read as “remove the least similar pairs.” Threshold conventions must be checked against the implementation.
Slides 75–80 compare algorithm, unit, population (snapshot/shard/global), and action (keep one or reintroduce controlled repetition). Benchmark rankings are specific to their setup. A standard Bloom filter is not inherently fuzzy; a pipeline can build a document-level policy from repeated small units. Scope and retained-copy policy can matter as much as the data structure. No table of model-specific recipes is required here.
Optional bonus · §5.3 Freshness, mixtures, and languages (slides 82, 84–86)
Freshness: a download date is not necessarily the date the content was written or updated. Multiple snapshots can preserve old claims. A recent crawl therefore does not establish a sharp model knowledge cutoff. Audit timestamps and version conflicts instead of treating every old document as useless.
Mixtures: sampling uniformly over documents or tokens does not balance domains. In a synthetic 90M/10M-token two-domain corpus, 100M processed tokens sampled 50/50 give each domain 50M presentations: about 0.56 corpus-equivalent passes for the first and 5 for the second. More weight on a small domain can also mean more repetition; there is no universally correct equal mixture.
Language identification: classifier scores are fallible, especially on short text, dialects, and code-switching. A threshold can remove desired content. Compare retention and manually inspected errors by language/variety; the classifier’s label inventory is not the same as reliable coverage of every variety. Removing boilerplate first can change the language decision, connecting back to pipeline order.
6Optional implementation: a tiny audit and real CCNet code
6.1 Run the audit on a CPU
python 15_data_checks.py
The lab checks the widget’s document/word counts, an order-sensitive representative choice, score aggregation, and the small bonus arithmetic. It is an educational miniature: its in-memory set is not a distributed corpus deduplicator, and its word counts are not a model tokenizer.
Change prepare so the synthetic code example e can survive the minimum-length filter when the intended dataset includes code. Choose an explicit policy rather than copying e’s ID into the condition. Add a non-code short example to reveal a possible false acceptance. Print the changed counts and explain the tradeoff.
One approach
Introduce a domain field set by a documented source policy, then use separate thresholds for code and prose. A text heuristic such as looking for def alone is easy to fool and misses other languages. If only e is newly retained under normalized matching, the result is 4 documents and 23 whitespace words. Update the expected counts only after explaining the policy; this is not evidence of better LM quality.
The following original example is about text processing; the sentences are synthetic. Predict the two matching keys before running the code. Does this rule find an exact duplicate?
import re
texts = ["The dose is 5 mg", "The dose is 50 mg"]
def match_key(text):
return re.sub(r"\d+", "<NUM>", " ".join(text.lower().split()))
for text in texts:
print(match_key(text))
print("Same key:", match_key(texts[0]) == match_key(texts[1]))
Now remove number replacement from match_key and rerun it. Which distinction returns? Could the original key still be useful for finding candidate templates if you checked the original text before deleting anything?
Predict first, then reveal the answer
Both keys are the dose is <NUM> mg, and the comparison prints True. The original texts differ in a meaningful number: this is a collision introduced by normalization, not an exact duplicate or a hash collision. Without the substitution, the keys differ. A broad key can retrieve candidate template matches, but key equality alone is insufficient for deletion. Preserve original text, inspect the differing fields, and choose a task-appropriate rule. Normalizing a comparison key and rewriting the training text are separate decisions; retaining the original text does not prevent a careless key-based policy from deleting a useful record.
6.2 Code reading: log scores become perplexity
perplexity.py (356 lines), pinned at bda555b. Focus on pp, DocLM.do, and PerplexityBucket.get_bucket; you do not need to install KenLM to read them. The short excerpts below are verbatim from this revision, © Facebook, Inc. and affiliates, MIT license.cc_net/perplexity.py · pp · lines 38–39
def pp(log_score, length):
return 10.0 ** (-log_score / length)
The logarithms here are base 10. Supplying a summed score of −6 across 3 scored tokens gives $10^2=100$. This matches §4.2 after changing log bases; using math.exp on the same base-10 score gives about 7.389, a different value.
cc_net/perplexity.py · DocLM.do · lines 217–220 (inside the loop)
log_score = model.score(line)
length = len(line.split()) + 1
doc_log_score += log_score
doc_length += length
The code accumulates scores and lengths, including an end-of-sentence position, before computing document perplexity. Its input can already be tokenized pieces; splitting on spaces here does not imply that raw whitespace words are the LM vocabulary. Trace PerplexityBucket.get_bucket next: it labels records rather than deleting them. Find where a later pipeline chooses which labels to retain.
In a local copy of pp, remove the minus sign before log_score. What is the output for pp(-6, 3)? Edit the function, run it, then restore the sign.
Reveal the answer
The result changes from 100 to 0.01. For a valid sequence probability at most 1, ordinary perplexity is at least 1; the mutation reverses the intended relationship. The lab checks both numbers and can extract only pp from your downloaded source using Python’s AST, without importing its dependencies.
# Optional: check pp from a downloaded copy of the pinned source.
python 15_data_checks.py /path/to/cc_net/perplexity.py
Two lines have summed base-10 scores −2 and −9 with scored lengths 2 and 10 (including any boundary positions). Compute the combined perplexity. In a local copy of the aggregation, replace it with the arithmetic mean of the two line perplexities and compare.
Reveal the answer
The correct value is $10^{11/12}\approx8.2540$. The unweighted arithmetic mean is $(10+10^{0.9})/2\approx8.9716$. Aggregate log scores and lengths to weight token positions correctly; exponentiation makes an arithmetic mean of perplexities the wrong operation.
7Core practice and synthesis
Attempt these after §1–§4. Questions are original except the explicitly credited adaptation in K; no answer requires the bonus algorithms or the optional code lab.
A 200B-token corpus loses 60% of tokens in cleaning, then 25% of the remainder in deduplication. How many corpus tokens remain? A run processes 120B tokens. How many corpus-equivalent passes is that, and what is misleading about calling it “120B unique tokens”?
Reveal the answer
$200\times0.4\times0.75=60$B remain, so 120B processed tokens correspond to two corpus-equivalent passes. Processed positions include repetition. Even the 60B retained positions need not contain unique text or independent facts.
Page A changes a date between two snapshots. Page B mirrors the old version under another URL. Why is deduplicating by URL alone insufficient? What information would you preserve?
Reveal the answer
URL matching can collapse different versions of A while missing the copy at B. Preserve source URL, snapshot/download time, text identity, and version relationships. Choose whether the task needs the newest version, historical versions, or one representative; use a text-based comparison suited to that choice.
A filter removes half the documents and your LM’s validation loss improves. Give two additional checks before concluding that the filter is suitable for the course’s training corpus.
Reveal the answer
For example: match processed-token/compute budgets in the comparison; audit accepted/rejected useful text by domain; report token retention as well as documents; check train–validation overlap; inspect performance on desired domains the filter might remove. One aggregate loss cannot answer all of these.
Ten identical documents are assigned one per shard. Each worker removes exact duplicates only within its own shard. How many survive? Does launching more workers solve this problem?
Reveal the answer
All ten survive. More independent workers do not create cross-shard comparisons. Route comparable keys to shared matching state, partition by the matching key, or add a global comparison stage; then document the representative policy. The data structure details are optional.
You remove every document with very low perplexity under a Wikipedia LM “because they are duplicates,” and every document with high perplexity “because they are junk.” What two distinct mistakes does this make?
Reveal the answer
Low perplexity is predictability, not proof of copying. High perplexity can mean unfamiliar but useful text, not corruption. Validate a reference-model score as a selection proxy; use overlap checks for duplication and evaluate coverage of desired domains.
Propose a comparison of a raw extracted corpus, a cleaned corpus, and a cleaned-plus-deduplicated corpus. State what you hold fixed, what you log, and one reason a lower token count alone cannot choose the winner.
Reveal the answer
Fix the tokenizer, model, effective token batch, optimizer setup, and processed-token budget; use consistent held-out evaluation with overlap checks and, where practical, repeated runs. Log source versions, rule versions, before/after documents and tokens, processing cost, and retained-domain coverage. A smaller corpus may reduce waste but can also lose useful diversity or require more repetitions. Choose using measured quality and coverage at the stated budget.
Consider only the prediction after the identical context The answer is. The next token is yes in nine document copies and no in one. Assume these are the only possible next tokens and the model can choose any probability $p$ for yes. Predict the loss-minimizing probabilities before and after retaining one copy of each distinct document. Would unlimited model capacity remove this difference?
Predict first, then reveal the answer
Before deduplication, the mean loss at this context is $-[9\log p+\log(1-p)]/10$, minimized at $p=0.9$. After deduplication it is $-[\log p+\log(1-p)]/2$, minimized at $p=0.5$. The corresponding no probabilities are 0.1 and 0.5. More capacity cannot distinguish identical contexts in this setup: the empirical target distribution changed. Deduplication changes the objective, not merely how quickly we optimize it. If additional context distinguished the documents, the conditioning problem could differ.
Before a pipeline change, token-averaged validation losses are 2 nats on news and 4 on code. The reported average gives each domain half the weight. Afterward, both losses worsen to 2.1 and 4.1, but the evaluation weights change to 90% news and 10% code. Predict whether the reported average rises or falls, then calculate it. What comparison would let you judge the model change fairly?
Predict first, then reveal the answer
The original average is $0.5(2)+0.5(4)=3.0$. The new average is $0.9(2.1)+0.1(4.1)=2.3$: it looks better although each domain is worse. At the original 50/50 weights, the new model scores 3.1, correctly showing a deterioration of 0.1 nat. Compare on the same held-out examples and fixed aggregation weights, and report domain losses alongside the aggregate. This is a warning about changing evaluation composition, not a requirement to train with equal domain weights; optimizing training mixtures remains bonus material.
Two documents contain the same paragraph, but one follows a biology explanation and the other a discussion of metaphor. A causal LM sees the preceding paragraph within its context window. Are the next-token training examples inside the repeated paragraph necessarily identical? How would your answer change if each paragraph were processed separately with the same start marker and no preceding context?
Predict first, then reveal the answer
With preceding text visible, the targets match but the conditioning contexts can differ, so identical paragraphs need not produce identical conditional prediction examples. Removing one occurrence may remove useful contextual variation as well as repeated text. If each paragraph starts independently with the same boundary marker and tokenization, the token histories and targets match; then the repeated occurrences are identical examples under these assumptions. A finite context window can also make later predictions identical once the differing prefix falls outside it. Judge repetition together with the actual packing, document boundaries, and attention context; this does not imply that every contextual variant should be kept.
In a synthetic evaluation, 20% of scored validation token positions belong to passages copied from training. The model’s mean loss on those positions is 0.5 nats, versus 3.0 nats on the remaining 80%. Predict the reported token-averaged loss and perplexity. Then calculate both for the uncontaminated subset. Does this comparison prove the model improved its ability to handle unseen text?
Predict first, then reveal the answer
The reported loss is $0.2(0.5)+0.8(3.0)=2.5$ nats, giving perplexity $e^{2.5}\approx12.18$. On the uncontaminated subset, loss is 3.0 and perplexity is $e^3\approx20.09$. The attractive aggregate does not establish better generalization: it includes positions whose text was available during training. These are token weights, not document weights; exponentiate the weighted mean loss rather than averaging subset perplexities. This calculation illustrates how overlap can mask difficulty, not that every loss gap is caused by memorization. Audit overlap and compare systems on the same independently held-out evaluation.
Extended from Spring 2025 Quiz 2, Q4.6, p. 7, which asks about the importance of cleaning pre-training data. The budget comparison below is new.
Cleaning reduces a corpus from 100B to 50B tokens under the same tokenizer. Assume the same model, effective tokens per step, sequence setup, and training-token throughput. Compare the number of processed tokens and approximate training time under two policies: (a) one complete pass through the corpus; (b) a fixed 200B-token training run. What happens to corpus-equivalent passes in (b)? Name one cost excluded by this calculation.
Predict first, then reveal the answer
For one pass, processing falls from 100B to 50B tokens, so training time is approximately halved under the stated throughput assumption. At a fixed 200B-token budget, token-processing work and approximate training time stay the same, while corpus-equivalent passes rise from 2 to 4. The cleaner data might improve learning, but a smaller stored corpus alone does not establish a training-time saving at that budget. Cleaning, deduplication, storage, and input-pipeline costs are excluded; actual throughput can also change if the sequence or packing setup changes. The source quiz’s resource-saving argument needs an explicit training-budget assumption.