In-Context Freeze-Thaw Bayesian Optimization for Hyperparameter Optimization

Herilalaina Rakotoarison, Steven Adriaensen, Neeratyoy Mallik, Samir Garibov, Eddie Bergman, Frank Hutter

Abstract

Hyperparameter optimization (HPO) is a critical yet computationally expensive stage in deep learning workflows. We present ifBO, a novel HPO framework that leverages a Transformer-based "Prior-Data Fitted Network" (PFN) to perform zero-shot performance prediction. By treating learning curve extrapolation as an in-context learning task, our surrogate model, FT-PFN, eliminates the need for costly neural network retraining during the search process. Experimental results across major benchmarks (LCBench, PD1, Taskset) demonstrate that ifBO is 10x to 100x faster than existing deep learning surrogates while achieving state-of-the-art optimization performance.

Introduction

The performance of deep learning models is highly sensitive to hyperparameters such as learning rates and architectural choices. Traditional HPO methods often require training numerous configurations to completion, incurring massive computational costs. Freeze-Thaw Bayesian Optimization offers a more efficient path by pausing underperforming models and resuming promising ones based on early-stage learning curves. However, this approach relies on surrogate models to predict final performance from partial data. Existing surrogates, such as Deep Gaussian Processes, are often computationally heavy, require frequent retraining, and struggle with the non-stationary nature of learning curves.

The ifBO Framework

We introduce ifBO, which centers on the FT-PFN (Freeze-Thaw Prior-Data Fitted Network) surrogate. Unlike traditional surrogates that update weights for every new observation, FT-PFN utilizes a Transformer architecture to perform in-context learning.

In-Context Learning and Synthetic Pre-training

FT-PFN processes observed learning curve segments as a "prompt" and generates probabilistic predictions for future performance in a single forward pass. To achieve this without real-world HPO data, we meta-train the model on a massive synthetic dataset of curves generated from mathematical basis functions (e.g., power laws and exponentials). This allows the model to generalize to real-world tasks in a zero-shot manner.

FT-PFN surrogate model predicting learning curves from early observations.

Acquisition Strategy: MFPI-random

To manage the "freeze-thaw" logic, we developed MFPI-random, an acquisition function that decides which configuration to resume. By randomizing the prediction horizon and improvement thresholds, MFPI-random avoids the need for manual tuning of search parameters, creating a robust "portfolio" approach to exploration and exploitation.

Experimental Results

We evaluated ifBO on three large-scale benchmarks: LCBench (MLPs on tabular data), PD1 (Transformers, CNNs, and ResNets), and Taskset (robustness testing).

Prediction Accuracy and Speed

FT-PFN demonstrates a significant advantage in both speed and accuracy. It is 10 to 100 times faster than competing deep learning surrogates like Deep Power Laws (DPL) and DyHPO. Furthermore, it provides superior uncertainty estimates and lower mean squared error (MSE) across diverse learning curve types.

A baseline Deep Kernel Gaussian Process surrogate, illustrating the comparative instability and wider uncertainty in curve extrapolation.

Optimization Performance

On LCBench and Taskset, ifBO established new state-of-the-art results. On the PD1 benchmark, it remained highly competitive, often identifying optimal hyperparameters with a fraction of the compute budget required by traditional methods.

Discussion and Conclusion

The success of ifBO highlights that the traditional "retraining" bottleneck in HPO is optional. A Transformer can effectively learn the dynamics of model training purely through its context window. While currently limited to 10 hyperparameters and requiring normalized inputs, future iterations could scale to larger search spaces and longer context windows. ifBO represents a significant step toward making high-performance deep learning more accessible and computationally efficient.

Summary updated

BibTeX
@inproceedings{rakotoarison2024context,
  author = {Herilalaina Rakotoarison and Steven Adriaensen and Neeratyoy Mallik and Samir Garibov and Eddie Bergman and Frank Hutter},
  title = {{In-Context Freeze-Thaw Bayesian Optimization for Hyperparameter Optimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=VyoY3Wh9Wd},
}
Figure