Empirical Risk Minimization
Empirical risk minimization is the basic training principle of choosing parameters that minimize average loss on observed data.
Given a dataset:
the empirical risk is:
Training chooses:
is an input, is a target, is the model, and is the loss.
Why It Matters
Many learning methods are variations on this template. The difference is usually in the data distribution, loss, regularizer, sampling process, or optimization method.
ERM is an approximation to population risk:
The training set replaces the unknown data distribution with an empirical distribution:
so is only as meaningful as the dataset, labels, preprocessing, and split policy behind it.
With a regularizer:
penalizes model complexity or parameter size, and controls the penalty strength.
Weighted Risk
Real training objectives often use weights, masks, or sampling rules:
where may encode class weights, label confidence, missing-label masks, token masks, or task balancing. This changes the target empirical distribution. A model trained on reweighted risk should not be evaluated as if it optimized the unweighted population.
Protocol Boundary
ERM is not only a formula. It includes decisions that must be fixed before final evaluation:
Changing any component after seeing validation or test behavior changes the learning procedure. This connects ERM to model selection and leakage.
Checks
- What examples define the empirical distribution?
- Does the loss match the task and target semantics?
- Is the training objective the same quantity as the evaluation metric?
- Are weights, masks, or sampling probabilities changing the risk?
- Is regularization explicit or hidden in the optimizer?
- Which parts of preprocessing are fit only on training data?
- Is the final test set untouched by objective, sampler, or hyperparameter choices?
- Does the claimed deployment distribution match the empirical distribution used for training?