Core ML2018intermediate13 min read

Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization

Hyperband: نهج مبتكر لضبط المعاملات الفائقة مستوحى من مسائل قطّاع الطريق

Li, L. · Jamieson, K. · DeSalvo, G. · Rostamizadeh, A. · Talwalkar, A. — JMLR

The problem

a modern requires choosing hyperparameters — , , , architecture depth — and the performance of the final model depends critically on these choices. Grid search and random search evaluate every configuration to completion, wasting enormous compute on configurations that are obviously poor after a few epochs. methods adaptively select configurations but still train each one to completion, and they struggle in high-dimensional search spaces. There was no principled method for deciding how to allocate a fixed between exploring many configurations briefly versus exploiting fewer configurations thoroughly.

The contribution

Hyperband: an that formulates as a pure- infinite-armed bandit problem. It extends Successive Halving — which trains n configurations, discards the worst fraction, and repeats — by running it at multiple aggressiveness levels (brackets). Each bracket represents a different tradeoff between the number of configurations n and the average budget per configuration B/n. Hyperband requires only two inputs: the maximum resource R per configuration and a discard factor η (typically 3). It needs no model of the surface, no assumptions about rates, and adapts automatically. On deep learning and benchmarks, Hyperband provided 5× to 30× speedups over Bayesian optimization methods.

The impact

Hyperband established early-stopping as a first-class strategy for hyperparameter optimization. It is the default scheduler in major frameworks — Ray Tune, Optuna, Keras Tuner, and Determined AI. Its idea of adaptive resource allocation directly inspired BOHB (Bayesian Optimization + Hyperband) and ASHA (Asynchronous Successive Halving). The framing of hyperparameter search as a problem opened a bridge between bandit theory and that continues to drive research.

Imagine you are a talent scout with a fixed budget and 81 candidates to evaluate. You could spend your entire budget watching each candidate perform a full show — but then you can only watch a handful. Or you could give every candidate just one minute on stage, cut the weakest two-thirds, give the survivors three minutes, cut again, and keep going until only one remains.

The second approach feels risky: what if a slow starter gets cut unfairly? But statistically, you see far more candidates and the truly terrible ones reveal themselves quickly. Hyperband hedges this risk by running the audition at multiple aggressiveness levels simultaneously — some rounds are ruthless (many candidates, short auditions) and others are patient (few candidates, long auditions). Together, they cover every scenario.

The problem: hyperparameter search wastes compute

Training a requires choosing hyperparameters — learning rate, batch size, number of layers, regularization strength — and the final model's quality depends critically on these choices. By 2016, practitioners had two main approaches:

  • Random search: sample configurations uniformly and train each to completion. Simple and embarrassingly parallel, but it wastes enormous compute on configurations that are obviously bad after a few epochs.

  • Bayesian optimization (SMAC, TPE, Spearmint): build a probabilistic model of the loss surface and adaptively choose the next configuration to try. Smarter than random, but each configuration is still trained to completion, and the surrogate model struggles in high-dimensional spaces.

Both approaches treat every configuration equally: whether a configuration is obviously terrible or potentially great, it gets the same training budget. The waste is staggering — most of the compute goes to configurations that never had a chance.

Open in Lab
Compare three search strategies. Grid and random train every configuration fully. Hyperband trains many briefly and promotes survivors.
The demo wakes as you arrive…

The core tension: breadth vs depth

Given a fixed compute budget BB, you face a fundamental tradeoff. You can either:

  • Go wide: try many configurations nn with small average budget B/nB/n each. This works when bad configurations reveal themselves quickly (the loss curve diverges or plateaus early).

  • Go deep: try few configurations with large average budget each. This works when configurations converge slowly and you need a long training run to distinguish good from great.

The optimal strategy depends on two unknowns: (1) how fast configurations converge (the envelope function γ\gamma), and (2) how often a random configuration is good (the FF of terminal losses). Without knowing either, practitioners are guessing — and guessing wrong can waste orders of magnitude of compute.

Open in Lab
Drag the slider to shift between breadth (many configs, short training) and depth (few configs, long training). Watch how the best config found changes.
The demo wakes as you arrive…

Building block: Successive Halving

Before understanding Hyperband, we need its inner subroutine: Successive Halving. The idea is exactly what the name says:

  1. Start with nn randomly sampled configurations.
  2. Allocate a small budget to each and train them all.
  3. Evaluate the validation loss of each configuration.
  4. Discard the worst 1/η1/\eta fraction (typically the bottom two-thirds with η=3\eta = 3).
  5. Increase the budget for the survivors by a factor of η\eta.
  6. Repeat until one configuration remains.

Each round eliminates the weakest competitors and gives more resources to the survivors — exponentially more resources go to the most promising configurations. Think of it as a tournament bracket where losers are eliminated in each round and winners get promoted to longer matches.

Open in Lab
Watch Successive Halving in action. Each round eliminates the worst performers and promotes survivors to longer training.
The demo wakes as you arrive…

Hyperband: hedging across aggressiveness levels

Hyperband's insight is simple but powerful: instead of guessing the right n, try several values of n simultaneously. It runs Successive Halving multiple times, each with a different tradeoff between exploration (large nn, small starting budget) and (small nn, large starting budget). Each such run is called a bracket.

The algorithm requires just two inputs:

  • RR: the maximum resource per configuration (e.g. 81 epochs)
  • η\eta: the discard factor (default 3 — keep the top third each round)

From these, Hyperband computes smax⁡=⌊log⁡η(R)⌋s_{\max} = \lfloor \log_\eta(R) \rfloor brackets. The most aggressive bracket (s=smax⁡s = s_{\max}) starts with the most configurations and the smallest initial budget. The least aggressive bracket (s=0s = 0) is just classical random search — every configuration gets RR resources.

Open in Lab
Explore the Hyperband bracket table for R=81, η=3. Click any bracket to see how many configurations survive each round and how much resource each gets.
The demo wakes as you arrive…
n=⌈BR⋅ηss+1⌉,r=R⋅η−sn = \left\lceil \frac{B}{R} \cdot \frac{\eta^s}{s+1} \right\rceil, \quad r = R \cdot \eta^{-s}
Number of initial configurations and minimum resource per bracket — For each bracket s, n is the number of starting configurations and r is the minimum resource each receives. Large s → many configs with tiny budgets (aggressive exploration). Small s → few configs with large budgets (conservative).

Here is a concrete example with R=81R = 81 and η=3\eta = 3, giving smax⁡=4s_{\max} = 4 brackets. Each bracket uses approximately the same total budget B=(smax⁡+1)×R=405B = (s_{\max} + 1) \times R = 405:

Bracket s=4s = 4 (most aggressive): Start with 81 configurations at 1 each. After each round, keep the top third and triple the budget. Final round: 1 survivor at 81 epochs. This bracket explores broadly.

Bracket s=0s = 0 (least aggressive): Start with 5 configurations at 81 epochs each. No early-stopping at all — pure random search. This bracket exploits deeply.

Brackets s=3,2,1s = 3, 2, 1 interpolate between these extremes. Together, they cover every reasonable tradeoff. No matter which scenario you face — fast-converging or slow-converging — at least one bracket is near-optimal for it.

The algorithm step by step

Open in Lab
Click each step to see what it does in the Hyperband pipeline.
The demo wakes as you arrive…
Hyperband, complete implementationpython

Simplified to show the idea — not the real implementation.

import numpy as np
from math import log, ceil, floor

def hyperband(get_config, run_config, R=81, eta=3):
    """
    get_config() -> random hyperparameter config
    run_config(config, budget) -> validation loss after training for budget
    R: maximum resource per config (e.g. 81 epochs)
    eta: discard factor (default 3: keep top 1/3)
    """
    s_max = floor(log(R) / log(eta))   # number of brackets
    B = (s_max + 1) * R                 # budget per bracket
    best = (float('inf'), None)

    for s in range(s_max, -1, -1):      # outer loop: brackets
        n = ceil(B / R * eta**s / (s + 1))   # initial configs
        r = R * eta**(-s)                     # min resource

        # --- Successive Halving inner loop ---
        configs = [get_config() for _ in range(n)]
        for i in range(s + 1):
            n_i = floor(n * eta**(-i))
            r_i = r * eta**i
            losses = [run_config(c, r_i) for c in configs]
            # keep top 1/eta fraction
            k = max(1, floor(n_i / eta))
            ranked = sorted(zip(losses, configs))
            configs = [c for _, c in ranked[:k]]
            if ranked[0][0] < best[0]:
                best = (ranked[0][0], ranked[0][1])

    return best  # (best_loss, best_config)

The bandit connection: why this is a multi-armed bandit problem

Hyperband frames hyperparameter optimization as a pure-exploration non-stochastic infinite-armed bandit problem. Here is the mapping:

  • Each arm is a hyperparameter configuration sampled from the search space.
  • Pulling an arm kk times means training that configuration for kk units of resource (epochs, data samples, features).
  • The loss after kk pulls is the validation error of the partially trained model.
  • The terminal loss νi=lim⁡k→∞ℓi,k\nu_i = \lim_{k \to \infty} \ell_{i,k} is the validation error at convergence.
  • The goal is to find the arm with the smallest terminal loss using as few total pulls as possible.

Unlike classical bandit problems where each arm gives a stochastic reward from a fixed distribution, here the losses are non-stochastic — the validation error after kk epochs is a deterministic function of the configuration and the training procedure. This makes the problem harder because we cannot estimate the terminal loss by averaging.

Open in Lab
Each arm is a configuration with its own loss curve. Hover to see the validation loss over time. Hyperband pulls promising arms more.
The demo wakes as you arrive…

Theory: why Hyperband works

The theoretical analysis of Hyperband revolves around two unknown quantities:

  • The envelope function γ(j)\gamma(j): a bound on how far the intermediate loss ℓi,k\ell_{i,k} can be from the terminal loss νi\nu_i after kk units of resource. A fast-decaying γ\gamma means configurations converge quickly. Parameterized as γ(j)≈j−1/α\gamma(j) \approx j^{-1/\alpha} where large α\alpha means slow convergence.

  • The distribution FF of terminal losses: how often a randomly sampled configuration is good. Parameterized as F(ν∗+ε)≈εβF(\nu^* + \varepsilon) \approx \varepsilon^{\beta} where large β\beta means good configurations are rare.

Successive Halving's budget scales like Δ−max⁡{α,β}\Delta^{-\max\{\alpha, \beta\}} while uniform allocation (random search) scales like Δ−(α+β)\Delta^{-(\alpha + \beta)} to achieve the same error Δ\Delta. The gap can be enormous. Hyperband, without knowing α\alpha or β\beta, achieves a budget within log factors of Successive Halving with the optimal bracket.

νı^T−ν∗≤c(log⁡~(T)3log⁡(log⁡~(T)/δ)T)1/max⁡{α,β}\nu_{\hat{\imath}_T} - \nu^* \leq c \left( \frac{\widetilde{\log}(T)^3 \log(\widetilde{\log}(T)/\delta)}{T} \right)^{1/\max\{\alpha, \beta\}}
Hyperband convergence guarantee — After a total budget T, the best configuration found by Hyperband has excess loss that shrinks polynomially in T. The rate depends on the harder of the two factors: convergence speed (α) and sampling difficulty (β).

Practical guidelines

Deploying Hyperband in practice requires setting RR and η\eta. Here are the authors' recommendations:

  • Setting RR: Use the natural maximum training budget for one configuration. For neural networks, a common rule-of-thumb number of epochs. For data subsampling, the full size. Smaller RR gives faster results; larger RR gives better guarantees.

  • Setting η\eta: Values of 3 or 4 are recommended. Larger η\eta means more aggressive elimination (fewer rounds, faster, but higher risk of cutting good configurations). The theory suggests η=e≈2.718\eta = e \approx 2.718 is optimal, but 3 works well in practice.

  • Number of brackets: Aim for approximately 5 brackets — enough to cover the range of tradeoffs without excessive overhead.

  • Resource-dependent hyperparameters: If a hyperparameter should change with the resource (e.g. max tree depth with dataset size), try to decouple them. Hyperband struggles when the optimal setting at low resource differs from that at high resource.

Beyond iterations: different resource types

A powerful aspect of Hyperband is that the "resource" need not be training iterations. Any quantity that correlates with model quality and whose cost scales can serve:

  • Iterations/epochs: The most common. Train for rr epochs, evaluate, and decide.

  • Dataset subsampling: Train on a random subset of the data. Especially effective for models with super-linear training time (like kernel methods), where 8× less data can mean 64× less compute.

  • subsampling: For random feature approximations of kernel methods, the number of random features serves as the resource.

  • Time: Allocate wall-clock training time directly. Useful when different configurations have different per-epoch costs.

The only requirement is that model quality should generally improve (or at least not degrade) as the resource increases. Hyperband makes no assumption about how fast quality improves — it adapts to whatever rate it encounters.

Results: orders of magnitude faster

The authors benchmarked Hyperband against SMAC, TPE, Spearmint, and random search on a diverse set of problems:

  • CIFAR-10 (8-dimensional search space): Hyperband was over 10× faster than all Bayesian methods. The first result after just 5R5R budget was competitive with results from other methods after 50R50R.

  • Kernel (6-dimensional): Hyperband evaluated 250+ configurations in the time it took competitors to evaluate 3, achieving 30× speedup over Bayesian methods and 70× over random search.

  • 117 datasets (110-dimensional AutoML space): On the subset of 21 datasets where downsampling was effective, Hyperband outperformed all methods including random 2×.

  • Random feature kernel approximation: Hyperband achieved 6× speedup — more modest because the 3-dimensional search space was low enough for random search to cover well.

A key finding: Hyperband's first result (after the first bracket) was often competitive with the final results of other methods that ran 10× longer. It was also less variable across trials, which is highly desirable in practice.

Open in Lab
Speedup of Hyperband over competitors across different benchmarks.
The demo wakes as you arrive…

Impact: from paper to production

  1. 2015

    Successive Halving analyzed

    Jamieson & Talwalkar analyze the Successive Halving algorithm in the non-stochastic setting, providing theoretical guarantees and showing it works well for hyperparameter optimization. This becomes Hyperband's core subroutine.

  2. 2017

    Hyperband at ICLR

    Li et al. present the preliminary Hyperband paper at ICLR, introducing the bracket system that solves the n vs B/n tradeoff.

  3. 2018

    Full Hyperband paper in JMLR

    The complete paper with full theoretical analysis, infinite horizon version, and extensive experiments on 117 datasets is published in JMLR.

  4. 2018

    BOHB combines Bayesian optimization with Hyperband

    Falkner et al. combine TPE-style configuration selection with Hyperband's early-stopping, getting the best of both worlds. BOHB becomes one of the most popular HPO methods.

  5. 2020

    ASHA for distributed systems

    Li et al. introduce ASHA (Asynchronous Successive Halving Algorithm), extending Hyperband for massively parallel distributed clusters where workers complete at different rates.

  6. 2023

    PriorBand at NeurIPS

    Mallik et al. extend Hyperband with informative priors from meta-learning, making it even more practical in the age of large-scale deep learning.

Today Hyperband is the default early-stopping scheduler in Ray Tune, Optuna, Keras Tuner, and Determined AI. Its conceptual children — BOHB, ASHA, PriorBand — continue to evolve. The bridge it built between bandit theory and AutoML remains one of the most productive cross-pollinations in modern machine learning.

CitationLi, Jamieson, DeSalvo, Rostamizadeh, Talwalkar. Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimization. JMLR, 2018.

Terms in this paper