Data, Training, Validation, and Inference
Data, Training, Validation, and Inference
Fact-check status
Key jargon
| Term | Plain-language meaning |
|---|---|
| Training set | Examples used to adjust model parameters. S1 |
| Validation set | Held-out examples used to choose designs and tune settings without training on the final test. S1 |
| Test set | A protected dataset used for the final estimate of performance. S1 |
| Inference | Using a trained model to produce a prediction or generation. S1 |
Key concepts
- Separate data by purpose to reduce self-deception and leakage. S1
- Training changes model parameters; inference uses the resulting parameters on new inputs. S1
Concept map
flowchart LR
A["Collect and clean data"] --> B["Train parameters"]
B --> C["Validate choices"]
C --> D["Test then run inference"]Diagram semantics verified against S1 and S2 on 2026-09-02.
Learning objectives
- Explain training, validation, testing, post-training, and inference. S1
- Recognize leakage, distribution shift, and feedback-loop risk. S1
Core lifecycle
- Define the task and metric. What input, output, and acceptable error matter? S1
- Collect and prepare data. Provenance, consent, labeling, balance, and quality shape the result. S1
- Train. Optimization adjusts parameters to reduce a loss on training examples. S1
- Validate. A separate split guides choices without becoming the final exam. S1
- Test. A held-out set estimates performance on the defined distribution. S1
- Post-train. Instruction tuning, preference optimization, or task adaptation changes behavior. S1
- Infer. The frozen model computes outputs for new input. S1
- Monitor. Real use reveals drift and failure cases; changes require a new evaluation. S1
What can go wrong
- Training examples leak into the test set. S1
- A benchmark does not resemble the real task. S1
- Users change behavior after deployment. S1
- Feedback data rewards confident-looking answers instead of correct ones. S1
- “Fine-tuning” is proposed when retrieval, prompting, or a deterministic rule would be cheaper. S1
Exercise
For an email-classification system, propose separate training, validation, test, and post-deployment samples. Explain how you would prevent one conversation thread appearing in multiple splits.