Hyperparameter optimization (HPO)
Hyperparameter optimisation, or tuning, is the search for the training settings, such as learning rate and batch size, that give a model its best performance on validation data.
Every training run depends on settings chosen in advance, called hyperparameters: how big each learning step is, how many examples go in each batch, how much dropout to apply. Hyperparameter optimisation is the process of finding good values. Each candidate set is used to train a model, the model is scored on validation data, and the best-scoring set wins. Because each trial means training a model, the search can be expensive.
The simplest method is grid search: pick a few values for each setting and try every combination. Five learning rates and five batch sizes make 25 runs. Random search samples combinations at random instead. In a 2012 paper in the Journal of Machine Learning Research, James Bergstra and Yoshua Bengio showed that random search found models as good as or better than grid search in a small fraction of the computing time. Their explanation was that for most problems only a few hyperparameters really matter, and random search tries many more distinct values of each one; 25 random runs test 25 different learning rates, not five.
Smarter methods learn as they go. Bayesian optimisation builds a model of how settings relate to results and uses it to choose the next trial, which usually needs fewer evaluations. Evolutionary methods breed and mutate a population of settings. Population-based training adjusts settings while several models train in parallel. Methods such as successive halving and Hyperband start many trials and cut the weak ones early to save compute.
Software does much of this work. Optuna, an open-source framework developed by the company Preferred Networks and community contributors, lets developers define a search space in code, chooses which settings to try next, and prunes unpromising trials early.
There is a trap. If you tune long enough against one validation set, you risk fitting the hyperparameters to that set, so its score no longer tells you how the model will do on new data. Careful practice keeps a separate test set untouched until the end, or uses nested cross-validation. When a paper reports a big gain, it is fair to ask how much tuning each method being compared received.
It is the search for the best training settings for a model, such as the learning rate, batch size or dropout rate. Different combinations are tried, each resulting model is scored on validation data, and the best combination is kept. Often, yes. Bergstra and Bengio showed in 2012 that random search usually finds settings as good as or better than grid search with far less computation, because only a few hyperparameters tend to matter and random sampling tests more distinct values of each. It is a method that builds a statistical model of how hyperparameter choices affect performance, then uses it to pick the most promising settings to try next. It typically needs fewer training runs than grid or random search, which matters when each run is expensive. Yes. Tuning heavily against one validation set can fit the settings to that set, making its score an overly optimistic guide to real performance. Keeping a separate test set for the final check, or using nested cross-validation, avoids this.Common questions
What is hyperparameter tuning?
Is random search better than grid search?
What is Bayesian optimisation for hyperparameters?
Can hyperparameter tuning cause overfitting?
Search for "hyperparameter optimization", "random search vs grid search", "Bayesian optimization hyperparameters" or "Hyperband" to learn more. Reliable sources include the Bergstra and Bengio paper, documentation for tuning libraries such as Optuna, and machine learning textbooks. Vendor comparisons of tuning services tend to use conditions that suit their own products, so check what was measured.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.