The left surface is a synthetic loss landscape over two hyperparameters — think learning rate on one axis, batch size or dropout on the other. A search strategy drops trial points onto it, each one a full train + validate cycle. The right chart tracks two lines as the search progresses: the best validation loss found so far, and the true generalization loss of that same winning configuration.
This is why practitioners hold out a separate test set that is never used to choose hyperparameters: with enough trials against the same validation set, you can "search your way" to a low validation score that doesn't generalize — the exact multiple-comparisons pitfall this optimism gap visualizes.
A search strategy drops trial configurations onto a 3D hyperparameter loss landscape, while a linked chart tracks the gap between the noisy validation score you observe and the true generalization loss of the trial you'd actually pick.
Grid search spends effort evenly across both axes even when only one matters, while random search covers the important axis far more densely for the same budget. Meanwhile, picking the "best" trial by a noisy validation score tends to be optimistic — the true loss of that pick is usually a little worse, and the gap widens with more trials and more noise.
Choose grid or random search and a trial budget, drag the second hyperparameter's importance down to create a ridge-shaped search space, and crank up validation noise to see the optimism gap grow between the orange (validation) and blue (true) lines.
This is the statistical reason a separate, untouched test set exists: repeatedly checking a validation score while searching hyperparameters is itself a form of multiple comparisons, and it can silently overfit your "best" configuration to that validation split.