Searching for Optimal Solutions with LLMs via Bayesian Optimization
Dhruv Agarwal, Manoj Ghuhan Arivazhagan, Rajarshi Das, Sandesh Swamy, Sopan Khosla, Rashmi Gangadharaiah
Abstract
Scaling test-time compute to search for optimal solutions is an important step towards building generally-capable language models that can reason. Recent work, however, shows that tasks of varying complexity require distinct search strategies to solve optimally, thus making it challenging to design a one-size-fits-all approach. Prior solutions either attempt to predict task difficulty to select the optimal search strategy, often infeasible in practice, or use a static, pre-defined strategy, e.g., repeated parallel sampling or greedy sequential search, which is sub-optimal. In this work, we argue for an alternative view using the probabilistic framework of Bayesian optimization (BO), where the search strategy is adapted dynamically based on the evolving uncertainty estimates of solutions as search progresses. To this end, we introduce Bayesian-OPRO (BOPRO)-a generalization of a recent method for in-context optimization, which iteratively samples from new proposal distributions by modifying the prompt to the LLM with a subset of its previous generations selected to explore or exploit different parts of the search space. We evaluate our method on word search, molecule optimization, and a joint hypothesis+program search task using a 1-D version of the challenging Abstraction and Reasoning Corpus (1D-ARC). Our results show that BOPRO outperforms all baselines in word search (≥10 points) and molecule optimization (higher quality and 17% fewer invalid molecules), but trails a best-k prompting strategy in program search. Our analysis reveals that despite the ability to balance exploration and exploitation using BOPRO, failure is likely due to the inability of code representation models in distinguishing sequences with low edit-distances.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Unexpected Improvements to Expected Improvement for Bayesian Optimization cites BoTorch: A Framework for Efficient Monte-Carlo Bayesian Optimization
- Generative Bayesian Optimization: Generative Models as Acquisition Functions cites Unexpected Improvements to Expected Improvement for Bayesian Optimization
- Large Language Models as Optimizers cites Self-Refine: Iterative Refinement with Self-Feedback
- Improving LLM-based Global Optimization with Search Space Partitioning cites Large Language Models as Optimizers
- Improving LLM-based Global Optimization with Search Space Partitioning cites BoTorch: A Framework for Efficient Monte-Carlo Bayesian Optimization
Cited by top-tier papers9
- HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-based Automatic Heuristic DesignChentongChen, Mengyuan Zhong, Jialong Shi, Jianyong Sun et al.ICLR 2026 · 17 citations
- A Survey of Large Language Models for Text-Guided Molecular Discovery: From Molecule Generation to OptimizationZiqing Wang, Kexin Zhang, Zihan Zhao, Yibo Wen et al.ACL 2026 · 10 citations
- Unleashing LLMs in Bayesian Optimization: Preference-Guided Framework for Scientific DiscoveryXinzhe Yuan, Zhuo Chen, Jianshu Zhang, Huan Xiong et al.ICLR 2026 · 7 citations
- Improving LLM-based Global Optimization with Search Space PartitioningAndrej Schwanke, Lyubomir Ivanov, David Salinas, Fabio Ferreira et al.ICLR 2026 · 7 citations
- Generative Bayesian Optimization: Generative Models as Acquisition FunctionsRafael Oliveira, Daniel M. Steinberg, Edwin V. BonillaICLR 2026 · 3 citations
Builds on12
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
- Large Language Models as OptimizersChengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu et al.ICLR 2024 · 817 citations
- BoTorch: A Framework for Efficient Monte-Carlo Bayesian OptimizationMaximilian Balandat, Brian Karrer, Daniel R. Jiang, Samuel Daulton et al.NeurIPS 2020 · 686 citations
- Unexpected Improvements to Expected Improvement for Bayesian OptimizationSebastian Ament, Samuel Daulton, David Eriksson, Maximilian Balandat et al.NeurIPS 2023 · 280 citations
- Hypothesis Search: Inductive Reasoning with Language ModelsRuocheng Wang, Eric Zelikman, Gabriel Poesia, Yewen Pu et al.ICLR 2024 · 156 citations
Related papers
- A Sober Look at LLMs for Material Discovery: Are They Actually Good for Bayesian Optimization Over Molecules?Agustinus Kristiadi, Felix Strieth-Kalthoff, Marta Skreta, Pascal Poupart et al.ICML 2024 · 55 citations
- SolverLLM: Leveraging Test-Time Scaling for Optimization Problem via LLM-Guided SearchDong Li, Xujiang Zhao, Linlin Yu, Yanchi Liu et al.NeurIPS 2025 · 15 citations
- LABO: LLM-Accelerated Bayesian Optimization through Broad Exploration and Selective ExperimentationZhuo Chen, Xinzhe Yuan, Jianshu Zhang, Jinzong Dong et al.ICML 2026 · 2 citations
- Latent Bayesian Optimization via Autoregressive Normalizing FlowsSeunghun Lee, Jinyoung Park, Jaewon Chu, Minseo Yoon et al.ICLR 2025
- The Surprising Effectiveness of Test-Time Training for Few-Shot LearningEkin Akyürek, Mehul Damani, Adam Zweiger, Linlu Qiu et al.ICML 2025
