Faster & More Reliable Tuning of Neural Networks: Bayesian Optimization with Importance Sampling

Setareh Ariafar, Zelda Mariet, Dana H. Brooks, Jennifer G. Dy, Jasper SnoekAISTATS 2021

Abstract

Many contemporary machine learning models require extensive tuning of hyperparameters to perform well. A variety of methods, such as Bayesian optimization, have been developed to automate and expedite this process. However, tuning remains extremely costly as it typically requires repeatedly fully training models. To address this issue, Bayesian optimization methods have been extended to use cheap, partially trained models to extrapolate to expensive complete models. While this approach enlarges the set of explored hyperparameters, including many low-fidelity observations adds to the intrinsic randomness of the procedure and makes extrapolation challenging. We propose to accelerate hyperparameter tuning for neural networks in a robust way by taking into account the relative amount of information contributed by each training example. To do so, we integrate importance sampling with Bayesian optimization, which significantly increases the quality of the black-box function evaluations and their runtime. To overcome the additional overhead cost of using importance sampling, we cast hyperparameter search as a multi-task Bayesian optimization problem over both hyperparameters and importance sampling design, which achieves the best of both worlds. Through learning a trade-off between training complexity and quality, our method improves upon validation error, in the average and worst-case. We show that this results in more reliable performance of our method in less wall-clock time across a variety of and datasets complex neural architectures.

The Challenge of Hyperparameter Tuning

To achieve peak performance in neural networks, researchers must meticulously tune hyperparameters such as learning rate and weight decay. Standard Bayesian Optimization (BO) approaches this by treating the training process as a "black box," iteratively testing different configurations. However, training a full model for every trial is prohibitively slow.

Existing "multi-fidelity" solutions, such as Fabolas or Hyperband, attempt to accelerate this process by training on small, randomly chosen subsets of data. The primary drawback of these methods is that random subsets are often noisy and fail to capture the full dataset's complexity. This leads to poor extrapolation, where a hyperparameter configuration that appears optimal on a 10% subset performs poorly on the full dataset. Current methods treat all data points as equally important, ignoring the fact that specific examples provide significantly more signal for gradient updates than others.

Importance-based Bayesian Optimization (IBO)

This paper introduces Importance-based Bayesian Optimization (IBO), a framework that merges Bayesian Optimization with Importance Sampling (IS) to prioritize the most informative training examples.

Gaussian Process surrogate models approximating a real function across different fidelity levels, illustrating the challenge of extrapolation in multi-fidelity optimization.

IBO operates through two primary mechanisms:

  1. Importance Sampling in the Inner Loop: Rather than standard Stochastic Gradient Descent (SGD) which samples training points uniformly, IBO utilizes an IS scheme. Points with higher gradient norms (or their upper bounds) are sampled more frequently, reducing the variance of gradient estimates and accelerating convergence.
  2. Multi-Task BO Outer Loop: Because IS introduces computational overhead, the authors frame the search as a multi-task BO problem. They introduce a "task" variable $B$ (pre-sample batch size) to control the trade-off between the cost of calculating importance and the resulting training quality.
  3. Cost-Aware Acquisition: The algorithm employs an acquisition function that balances expected model improvement against predicted wall-clock time. It dynamically learns when to invest in high-fidelity importance sampling versus when a cheaper, noisier evaluation suffices.

Key Results and Insights

IBO was evaluated across standard benchmarks including MNIST, CIFAR-10 (CNN and ResNet), and CIFAR-100 (ResNet). The results demonstrate that focusing on which data to use is often more effective than simply deciding how much data to use.

Validation error over time for CNN and ResNet on CIFAR-10. The rightmost plot highlights IBO's superior worst-case performance compared to baselines.
  • Superior Accuracy and Efficiency: On a ResNet trained on CIFAR-100, IBO improved validation error by approximately 4% over the leading baseline, Fabolas. Furthermore, IBO consistently reached lower error rates faster; on ResNet/CIFAR-10, it found the optimal error in roughly one-third of the time required by competing methods.
  • Robustness and Reliability: A critical finding is IBO's performance in "worst-case" scenarios. While standard BO can be misled by noisy, low-fidelity evaluations, IBO's principled sampling makes the optimization trajectory significantly more stable. In many tests, IBO's worst-performing run outperformed the best runs of methods like Entropy Search (ES).
  • Data Efficiency: While baselines often required 93-98% of the data to reach peak performance, IBO achieved superior results by intelligently weighting data rather than merely increasing subset size.

Conclusion

By treating the informativeness of data as a tunable parameter within a multi-task framework, IBO addresses the core inefficiencies of traditional hyperparameter tuning. While calculating gradient norms adds a per-iteration cost, the resulting faster convergence and increased reliability make it a powerful tool for optimizing complex neural architectures. Future work may extend this importance-based approach to other optimizers like Adam or apply it to the broader field of Neural Architecture Search (NAS).

Summary updated

BibTeX
@inproceedings{ariafar2021faster,
  author = {Setareh Ariafar and Zelda Mariet and Dana H. Brooks and Jennifer G. Dy and Jasper Snoek},
  title = {{Faster \& More Reliable Tuning of Neural Networks: Bayesian Optimization with Importance Sampling}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=rub-5ARy4-5},
}
Figure