Hyperband

On this page 7

Hyperband is a bandit-based hyperparameter optimization algorithm that samples many random configurations, trains each with a small budget and repeatedly discards the weakest performers, so that most compute goes to the most promising candidates. In artificial intelligence, it belongs to the optimization toolkit for hyperparameter search, next to grid search, random search and Bayesian methods.

The method was introduced by Lisha Li, Kevin Jamieson and colleagues around 2016 and published in the Journal of Machine Learning Research in 2018. Its central idea is to treat tuning as adaptive resource allocation: the question is not only which configuration to try, but how much training each one deserves before a decision is made about it.

How Hyperband allocates training budget

Hyperband works by running successive halving several times with different trade-offs between the number of configurations and the budget given to each. A budget (also called a resource) is any quantity that makes evaluation cheaper when reduced: training epochs, iterations, the size of a data subsample, or the number of features.

Inside a single run of successive halving, a set of n configurations is trained with a minimum budget, ranked by validation loss, and only the top 1/η fraction survives to the next rung, where each survivor receives η times more budget. This repeats until one configuration has been trained with the maximum budget R. With the common default η = 3, two thirds of the candidates are eliminated at every rung.

The weakness of plain successive halving is the n versus budget dilemma. Starting with many configurations and a tiny budget explores widely but may kill slow starters that would have won with longer training. Starting with few configurations and a large budget is safe but explores little. Hyperband removes the need to choose by running a sequence of brackets, each with a different starting point, from aggressive exploration to the equivalent of plain random search.

The following table shows the bracket schedule for a maximum budget of R = 81 epochs and η = 3, which yields five brackets (s from 4 down to 0).

Bracket sStarting configurationsStarting budget per configurationCharacter
s = 4811 epochMost aggressive early stopping
s = 3343 epochsAggressive
s = 2159 epochsBalanced
s = 1827 epochsConservative
s = 0581 epochsPlain random search, no stopping
Hyperband brackets for R = 81 and η = 3

Key parameters of Hyperband

Hyperband has only two essential parameters, which is one reason for its popularity. The maximum budget R sets how long the best configurations are trained, and the reduction factor η sets how ruthlessly candidates are pruned. The number of brackets follows as s_max = floor(log_η R).

ParameterTypical valueWhat it controlsEffect of a larger value
Maximum budget R27 to 243 epochsBudget of the final rungMore brackets, longer full runs
Minimum budgetR divided by η to the power s_maxFirst-rung training lengthFewer, less noisy early decisions
Reduction factor η3 (sometimes 2 or 4)Share of survivors per rungFaster pruning, higher risk of error
Number of loops1 to severalRepetitions of all bracketsBetter coverage, higher total cost
Main Hyperband parameters and their effects

Each bracket consumes roughly (s_max + 1) × R units of budget, so one full Hyperband loop costs about the same as training (s_max + 1)² configurations to completion. In the R = 81 example, a loop evaluates 143 configurations for the cost of about 25 full trainings, which explains the large speedups over random search reported on deep learning benchmarks.

Hyperband compared with other search methods

Hyperband sits between model-free search and model-based Bayesian optimization. It samples configurations at random, like random search, but adds early stopping as a principled schedule. It does not build a surrogate model, so it is simple, robust and easy to parallelize, but it does not learn where good regions of the search space are.

MethodHow configurations are chosenEarly stoppingMain strength
Grid searchFixed lattice of valuesNoneExhaustive in small spaces
Random searchUniform random samplingNoneSimple, good in high dimensions
Bayesian optimizationSurrogate model and acquisition functionNone by defaultSample efficiency
HyperbandRandom samplingBracketed successive halvingSpeed on cheap partial evaluations
BOHBTree-structured Parzen estimator style modelHyperband bracketsCombines learning and pruning
ASHARandom samplingAsynchronous promotionScales to many workers
Hyperband and related hyperparameter search methods

BOHB, proposed by Falkner and colleagues in 2018, replaces random sampling with a density model of good configurations, similar to the tree-structured Parzen estimator. ASHA, the asynchronous successive halving algorithm, removes the synchronization barrier between rungs so that hundreds of parallel workers stay busy. Both are widely used descendants of Hyperband.

When to use Hyperband in practice

Hyperband pays off when partial training is a reliable signal of final quality and when a single full training run is expensive. Neural networks trained for many epochs, gradient-boosted trees with many rounds and models that can be fitted on data subsets are typical candidates. Libraries such as Ray Tune, Optuna, Keras Tuner and SMAC3 provide ready-made Hyperband schedulers.

SituationRecommended choiceReason
Long deep learning trainingHyperband with η = 3Early epochs filter most bad settings
Many parallel GPUsASHANo idle workers between rungs
Expensive runs, small budget of trialsBOHBLearns from earlier results
Learning curves cross lateLarger minimum budgetAvoids killing slow starters
Cheap single evaluationsRandom search or Bayesian optimizationEarly stopping adds little
Choosing Hyperband settings by situation

A practical rule is to set the minimum budget high enough that rankings at the first rung are meaningful. Learning rate warmup, heavy regularization and small batch sizes can make early validation curves misleading, and Hyperband will then prune good configurations.

Limitations and common mistakes

Hyperband assumes that low-budget performance correlates with high-budget performance. When that assumption fails, the aggressive brackets waste compute, and only the conservative brackets produce useful results. Its theoretical guarantees hold relative to random search, not to an optimal strategy.

  • Crossing learning curves: configurations that learn slowly but generalize well are discarded early.
  • Noisy validation scores: small validation sets turn early rankings into a lottery.
  • Wrong resource choice: data subsampling can change which configuration is best.
  • No knowledge transfer: plain Hyperband ignores results from earlier brackets when sampling.
  • Synchronous waiting: the original algorithm leaves workers idle until a rung finishes.

Understanding it simply

Imagine a talent show with hundreds of contestants and little time. The judges let everyone sing for ten seconds. They keep the best third. Those sing for thirty seconds, and again the best third stay. In the end, only a few perform a full song.

Hyperband tunes machine learning models in the same way. Each contestant is one set of model settings. Short training shows which settings look hopeless. Weak settings stop early, and strong ones get more time.

Some singers start slowly, so Hyperband also runs rounds that give everyone a longer first try. The key takeaway is simple: spend compute on the candidates that earn it.

Applied in practice

A machine learning team trains an image classification network that needs about 81 epochs to converge, roughly six GPU hours per full run. The team wants to tune the learning rate, weight decay, batch size and dropout, but can afford only about 150 GPU hours for the search.

Random search within that budget would test about 25 configurations. The team instead runs Hyperband with R = 81 epochs and η = 3 through a Ray Tune scheduler on eight GPUs. One full loop evaluates 143 configurations, most of them for only one to three epochs, and the most promising few reach the full 81 epochs.

The best configuration found improves validation accuracy by about two percentage points over the previous hand-tuned baseline. A follow-up search with BOHB reuses the same budget settings and converges on a similar region, which gives the team confidence that the result is not a lucky draw.