TL;DR
ZeroShotOpt is a general-purpose, pretrained transformer model that tackles continuous black-box optimization problems from 2D to 20D without requiring any manual hyperparameter tuning. By training on 20 million synthetic optimization trajectories using offline reinforcement learning, it achieves robust zero-shot generalization on unseen benchmarks, matching or exceeding the performance of state-of-the-art Bayesian optimization methods while running orders of magnitude faster.
What Problem Does This Paper Address?
In many scientific and engineering fields—such as drug discovery, materials design, and hyperparameter tuning—we often need to optimize expensive, derivative-free "black-box" functions under a strict evaluation budget. When each experiment or simulation takes hours or costs thousands of dollars, sample efficiency is paramount.
Currently, Bayesian Optimization (BO) is the gold standard for these low-budget scenarios. However, BO has a major flaw: its success heavily depends on choosing the right surrogate models, acquisition functions, and hyperparameters. These settings are typically hand-tuned by experts and fail to generalize across different problem landscapes.
The authors of ZeroShotOpt address this gap by asking: Can we pretrain a single neural network to act as a universal, "plug-and-play" black-box optimizer that requires zero task-specific tuning?
Methods
ZeroShotOpt frames black-box optimization as a sequential decision-making problem and adapts the Decision Transformer (DT) architecture to solve it.
Instead of predicting actions based on maximized rewards like standard reinforcement learning, a Decision Transformer learns to generate actions conditioned on a target outcome. The authors tokenized the optimization history into four inputs:
- Trajectory Regret ($R$): A normalized metric of how close the current best guess is to the true global minimum.
- Trajectory Length ($L$): The total evaluation budget.
- Actions ($x$): The proposed evaluation points, split dimension by dimension.
- States ($f(x)$): The resulting function values.
During training, the model learns from both highly efficient and highly inefficient optimization paths. At inference time, the user simply feeds the model its previous evaluation history and sets the desired target regret to zero. This forces the model to emulate the behavior of the best-performing optimization strategies. To pick the absolute best step, ZeroShotOpt generates four candidate actions in parallel and uses an internal expected improvement (EI) acquisition function to select the final point.
Datasets
Because no massive, open-source dataset of expert optimization trajectories existed, the authors built their own using a synthetic function generator based on Gaussian Processes (GPs).
- Training Data: They generated 1,600,000 synthetic functions (ranging from 2D to 20D) with highly randomized landscapes. They then ran 12 different BO variants (combining kernels like RBF and Matern with acquisition functions like EI, UCB, and Thompson Sampling) to collect ~20 million total trajectories.
- Zero-Shot Evaluation Data: To test out-of-distribution performance, they evaluated the model on standard synthetic benchmarks: the Virtual Library of Simulated Experiments (VLSE) and the Black-Box Optimization Benchmark (BBOB).
- Fine-Tuning Data: They used the Hyperparameter Optimization Benchmark (HPO-B), which consists of real-world machine learning hyperparameter tuning experiments from OpenML, to demonstrate the model's capacity for domain-specific adaptation.
Key Insights and Ideas
- Distilling the Experts: Rather than trying to invent a brand-new optimization algorithm from scratch, ZeroShotOpt acts as a meta-policy that distills the strengths of 12 distinct BO variants. By conditioning on a regret of zero, it dynamically shifts its optimization style to match whichever "expert" would perform best on the current landscape.
- Bypassing the BO Bottleneck: Traditional BO requires fitting a Gaussian Process and numerically optimizing an acquisition function at every single step. This becomes incredibly slow as the number of dimensions and sample points grows. ZeroShotOpt replaces this heavy mathematical machinery with a forward pass through a neural network.
Key Results
ZeroShotOpt consistently achieved top-tier performance across both in-distribution and completely unseen zero-shot benchmarks.
- Optimization Performance: On the BBOB & VLSE zero-shot test suites, ZeroShotOpt achieved the highest mean normalized performance (0.881), outperforming all 12 individual BO baselines as well as popular evolutionary algorithms like CMA-ES and Particle Swarm Optimization (PSO).
- Real-World Fine-Tuning: When fine-tuned on a small subset of the real-world HPO-B dataset, ZeroShotOpt jumped to the #2 spot (0.913), proving it can rapidly adapt to specific practical domains.
- Massive Speedups: The wall-clock time savings were drastic. For a 20D problem, the best-performing traditional BO variant (GP-LogEI) took 87.75 seconds per evaluation step. ZeroShotOpt completed the same task in just 5.56 seconds—a speedup of over 15x.
Limitations and Future Work
Despite its strong zero-shot capabilities, the authors note several limitations:
- Scope Constraints: The current model is strictly limited to continuous, single-objective optimization problems under 20 dimensions. It cannot yet handle combinatorial (discrete) spaces or multi-objective trade-offs.
- Peak Performance Variance: While ZeroShotOpt beats or matches the average performance of BO variants, a meticulously hand-tuned, problem-specific BO variant can still occasionally outperform it on specific landscapes.
- Future Horizons: The authors suggest that because ZeroShotOpt is transformer-based, future iterations could incorporate semantic information (like text descriptions of parameters or historical test data) directly into the context window—something traditional mathematical BO simply cannot do.
Summary updated