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.
The core tension: breadth vs depth
Given a fixed compute budget , you face a fundamental tradeoff. You can either:
-
Go wide: try many configurations with small average budget 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 ), and (2) how often a random configuration is good (the of terminal losses). Without knowing either, practitioners are guessing — and guessing wrong can waste orders of magnitude of compute.
Building block: Successive Halving
Before understanding Hyperband, we need its inner subroutine: Successive Halving. The idea is exactly what the name says:
- Start with randomly sampled configurations.
- Allocate a small budget to each and train them all.
- Evaluate the validation loss of each configuration.
- Discard the worst fraction (typically the bottom two-thirds with ).
- Increase the budget for the survivors by a factor of .
- 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.
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 , small starting budget) and (small , large starting budget). Each such run is called a bracket.
The algorithm requires just two inputs:
- : the maximum resource per configuration (e.g. 81 epochs)
- : the discard factor (default 3 — keep the top third each round)
From these, Hyperband computes brackets. The most aggressive bracket () starts with the most configurations and the smallest initial budget. The least aggressive bracket () is just classical random search — every configuration gets resources.
Here is a concrete example with and , giving brackets. Each bracket uses approximately the same total budget :
Bracket (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 (least aggressive): Start with 5 configurations at 81 epochs each. No early-stopping at all — pure random search. This bracket exploits deeply.
Brackets 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
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 times means training that configuration for units of resource (epochs, data samples, features).
- The loss after pulls is the validation error of the partially trained model.
- The terminal loss 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 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.
Theory: why Hyperband works
The theoretical analysis of Hyperband revolves around two unknown quantities:
-
The envelope function : a bound on how far the intermediate loss can be from the terminal loss after units of resource. A fast-decaying means configurations converge quickly. Parameterized as where large means slow convergence.
-
The distribution of terminal losses: how often a randomly sampled configuration is good. Parameterized as where large means good configurations are rare.
Successive Halving's budget scales like while uniform allocation (random search) scales like to achieve the same error . The gap can be enormous. Hyperband, without knowing or , achieves a budget within log factors of Successive Halving with the optimal bracket.
Practical guidelines
Deploying Hyperband in practice requires setting and . Here are the authors' recommendations:
-
Setting : 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 gives faster results; larger gives better guarantees.
-
Setting : Values of 3 or 4 are recommended. Larger means more aggressive elimination (fewer rounds, faster, but higher risk of cutting good configurations). The theory suggests 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 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 budget was competitive with results from other methods after .
-
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.
Impact: from paper to production
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.
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.
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.
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.
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.
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
- Hyperparameterالمعلمة الفائقة
- Early Stoppingالإيقاف المبكر للتدريب
- Multi-Armed Banditقطّاع الطريق متعدد الأذرع
- Bayesian Optimizationالأمثَلة البايزية
- Model Selectionاختيار النموذج
- Learning Rateمعدل التعلم
- Convergenceالتقارب الحسابي