The purple bowl-shaped surface is a simplified validation-loss landscape over two hyperparameters: a "key" hyperparameter on one horizontal axis (say, learning rate) that strongly affects performance, and a "secondary" hyperparameter on the other axis whose effect you control with the influence slider. Bright gold marks low loss (good), dark purple marks high loss (bad). Sky-blue spheres are a grid search — an evenly spaced lattice of trials. Amber spheres are a random search using the same total budget.
k² trials it only ever tests k distinct values of each hyperparameter.n distinct values of every hyperparameter for the same budget n, because no two random draws land on the same grid line.Bergstra & Bengio's 2012 paper "Random Search for Hyper-Parameter Optimization" showed random search matching or beating grid search on real neural-network and DBN tuning tasks while using a fraction of the trials — a finding that still underpins default tuning advice today.
A purple loss landscape over two hyperparameters, sampled side by side by an evenly spaced grid search and a random search on the same budget — watch which one finds the deeper minimum.
For a fixed trial budget, grid search only ever probes as many distinct values of each hyperparameter as the grid resolution allows, while random search probes up to one distinct value per trial — a decisive edge when only one hyperparameter really matters.
Set the sample budget and the secondary hyperparameter's influence, then compare the best loss each method finds. Lower the influence toward 0% to simulate low effective dimensionality and watch random search pull ahead.
Bergstra & Bengio's 2012 study found random search matched grid search's best result using roughly a fifth of the trials on real neural-network tuning tasks.