Text from one document appears in both training and test data. What is the problem?
Why C is the answer
Data leakage
Test scores no longer reflect unseen data.
In detail
- A test set containing training text is data leakage.
- Split by document, not by chunk.
Use case
An illustrative scenario, not a real incident.
The same document sits in both splits, so test scores overstate real performance.
See it in different ways
flowchart LR A["Raw text"] --> B["Clean and deduplicate"] B --> C["Split without leakage"] C --> D["Tokenize"] D --> E["Truncate and pad"]
mindmap
root((Data preparation))
Cleaning
Remove near duplicates
Splitting
Avoid leakage
Tokenizing
Same tokenizer everywhere
Paddingflowchart TD
Q{"Does test text appear in training?"}
Q -->|"Yes"| A0["Data leakage"]
Q -->|"No"| A1["A fair test"]Key point: Shared text across splits is leakage.
Why the other options are wrong
- A. Early stopping
- That is about stopping training.
- B. Weight decay
- That is regularization.
- D. Gradient clipping
- That is about gradients.

