What is the difference between empirical risk and true (generalization) risk?

Quick Overview

Asks how empirical risk on a training sample differs from true risk over the data distribution. Tests whether you can define both, explain why training error is biased low and what drives the generalization gap, estimate true risk correctly, and split excess risk into estimation and approximation error.

What is the difference between empirical risk and true (generalization) risk?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Supervised learning picks a model by minimizing loss on training data, while the goal is low loss on data the model has not seen. What is the difference between empirical risk and true (generalization) risk? ```hint Write both down Write each one as an average or an expectation of the loss, and note which distribution or sample each one is taken over. ``` ```hint Watch the selection step Ask whether the training loss of the chosen model is still an unbiased estimate once that model was picked using the same data. ``` ### What a Strong Answer Covers - Formal definitions of both quantities and what each one needs in order to be computed - When empirical risk is an unbiased estimate of true risk, and why training error is biased low - What controls the size of the generalization gap - How to estimate true risk in practice, and what reintroduces optimistic bias - The split of excess risk into estimation error and approximation error ### Follow-up Questions - If the empirical risk of every fixed hypothesis is unbiased, why is the training error of the selected hypothesis biased low? - What does a uniform bound over a finite hypothesis class say for a million hypotheses and 10,000 training examples? - When can cross-validation still give an optimistic estimate? - How does distribution shift between training and deployment change the picture?

Overview: Asks how empirical risk on a training sample differs from true risk over the data distribution. Tests whether you can define both, explain why training error is biased low and what drives the generalization gap, estimate true risk correctly, and split excess risk into estimation and approximation error.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Supervised learning picks a model by minimizing loss on training data, while the goal is low loss on data the model has not seen. What is the difference between empirical risk and true (generalization) risk?

What a Strong Answer Covers Guidance

  • Formal definitions of both quantities and what each one needs in order to be computed
  • When empirical risk is an unbiased estimate of true risk, and why training error is biased low
  • What controls the size of the generalization gap
  • How to estimate true risk in practice, and what reintroduces optimistic bias
  • The split of excess risk into estimation error and approximation error

Follow-up Questions Guidance

  • If the empirical risk of every fixed hypothesis is unbiased, why is the training error of the selected hypothesis biased low?
  • What does a uniform bound over a finite hypothesis class say for a million hypotheses and 10,000 training examples?
  • When can cross-validation still give an optimistic estimate?
  • How does distribution shift between training and deployment change the picture?