Training loss / points Validation loss / points Fitted model curve Best checkpoint Stop epoch

Early Stopping: Watching a Real Model Overfit, in 2D

Every model that trains long enough eventually starts memorising its training set instead of learning from it. Rather than scripting that shape, this simulator actually trains one: a Chebyshev-polynomial regressor is fit by real gradient descent against a small noisy synthetic dataset, epoch by epoch, and both the training and validation loss you see are genuine mean-squared error computed from the model's current weights. Tune model capacity and data noise to control how sharply overfitting appears, then tune patience and min-delta to see the exact patience-based early-stopping algorithm used by frameworks like Keras and PyTorch Lightning catch the best checkpoint and halt training a fixed number of epochs after the true minimum — exactly as it does in a real training run.