Skip to main content
Hyperparameter Tuning

Hyperparameter Tuning

The Search Space Challenge

Hyperparameters are the knobs you set before training begins — they control how the model learns, but they are not learned by gradient descent. Think of them as the recipe parameters for baking: oven temperature, baking time, and flour-to-sugar ratio are “hyperparameters” that you choose before baking starts. You can not adjust the oven temperature by tasting the dough mid-bake. The search space is often exponential. If you have 5 hyperparameters each with 10 possible values, that is 100,000 combinations. At 30 minutes per training run, exhaustive search would take 5.7 years. How do we find good configurations efficiently?

Search Strategies

Bayesian Optimization

Bayesian Optimization is the “smart” approach: instead of blindly sampling configurations, build a statistical model of how hyperparameters relate to performance, and use that model to choose the most promising configuration to try next. Think of it like a restaurant critic who keeps a mental model of which neighborhoods have good food, and uses that model to decide where to eat next — rather than randomly picking restaurants.

Optuna Integration


Ray Tune Integration


Population-Based Training

PBT is a fascinating hybrid that combines ideas from evolutionary algorithms with neural network training. The core insight: hyperparameters that are good at the start of training may not be good at the end. Instead of fixing hyperparameters before training, PBT adapts them during training. Think of it like a track race where runners can peek at the leaders’ strategies and copy what is working, while also trying small variations.

Successive Halving / Hyperband

These methods address a key waste in hyperparameter search: you often know within the first few epochs whether a configuration is terrible, yet most methods train every configuration for the full budget. Successive Halving aggressively prunes bad configurations early, redirecting compute to the promising ones.

Best Practices


Exercises

Combine Bayesian optimization with Hyperband:
Optimize for both accuracy and efficiency:
Use past experiments to warm-start new searches:

What’s Next?

Reproducibility

Experiment tracking and reproducible research

Model Interpretation

Understanding model decisions