Loss Functions, Behaviors & Selection Questions
Loss function design, evaluation, and selection in machine learning. Includes common loss functions (MSE, cross-entropy, hinge, focal loss), how loss properties affect optimization and gradient flow, issues like class imbalance and label noise, calibration, and practical guidance for choosing the most appropriate loss for a given task and model.
MediumTechnical
83 practiced
Explain the difference between calibration and discrimination. Describe how to evaluate calibration using reliability diagrams, Expected Calibration Error (ECE), Brier score and log-loss. When would you prefer temperature scaling over isotonic regression for post-hoc calibration in production, and what are the limitations of each?
MediumTechnical
98 practiced
When your target metric is non-differentiable (for example F1 score or top-k accuracy), explain practical strategies to train models: use surrogate losses, structured prediction with task-specific losses, reinforcement learning approaches (policy gradients), or threshold optimization after training. For each strategy, list pros, cons, and production complexity.
HardTechnical
72 practiced
Design experiments to measure the effect of label smoothing on model calibration and adversarial robustness. Specify datasets, baseline models, metrics to report (ECE, Brier score, adversarial accuracy under PGD/CW), hyperparameters to sweep, and statistical tests to validate whether smoothing helps or harms calibration and robustness.
HardTechnical
103 practiced
Derive the gradient of the binary focal loss with respect to logits. Show the algebraic steps that lead from the focal loss definition to the gradient expression, analyze how the focusing parameter γ modifies gradient magnitudes for easy (high p) and hard (low p) examples, and discuss the implications for training dynamics.
HardTechnical
149 practiced
Training loss is decreasing but validation metrics are plateauing or degrading—diagnose a scenario where label noise or memorization is occurring. Provide a step-by-step debugging and remediation plan: per-example loss histograms, small-loss selection, co-teaching, early stopping, semi-supervised learning, relabeling, and production safeguards to prevent deploying a memorized model.
Unlock Full Question Bank
Get access to hundreds of Loss Functions, Behaviors & Selection interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.