Machine Learning System Design Interview, issue 35, May 23, 2026

The Weighted Cross-Entropy Trap

Senior ML Engineer interview at Meta, and the interviewer asks:

You’re training a fraud detection model on an extremely imbalanced production stream, 1 fraud sample for every 10,000 legitimate transactions. How do you construct the loss function to ensure the model actually learns the rare class without collapsing?

Why scaling loss by class frequency silently swamps your gradients with easy background noise, and how to dynamically shift optimization focus to hard production edge cases.

The full answer, with the mechanism and the arithmetic, is for paid subscribers on Substack.

Read it on Substack

Get the next one

Free on Substack. Unsubscribe in one click.