Data, Training, Validation, and Inference

Data, Training, Validation, and Inference

Key jargon

Term Plain-language meaning
Training set Examples used to adjust model parameters.
Validation set Held-out examples used to choose designs and tune settings without training on the final test.
Test set A protected dataset used for the final estimate of performance.
Inference Using a trained model to produce a prediction or generation.

Key concepts

Concept map

flowchart LR
    A["Collect and clean data"] --> B["Train parameters"]
    B --> C["Validate choices"]
    C --> D["Test then run inference"]

Learning objectives

Core lifecycle

  1. Define the task and metric. What input, output, and acceptable error matter?
  2. Collect and prepare data. Provenance, consent, labeling, balance, and quality shape the result.
  3. Train. Optimization adjusts parameters to reduce a loss on training examples.
  4. Validate. A separate split guides choices without becoming the final exam.
  5. Test. A held-out set estimates performance on the defined distribution.
  6. Post-train. Instruction tuning, preference optimization, or task adaptation changes behavior.
  7. Infer. The frozen model computes outputs for new input.
  8. Monitor. Real use reveals drift and failure cases; changes require a new evaluation.

What can go wrong

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.

Checklist