Reasoning BO: Enhancing Bayesian Optimization with Long-Context Reasoning Power of LLMs

Zhuo Yang, Daolang Wang, Lingli Ge, Beilun Wang, Tianfan Fu, Yuqiang Li · DOI

Abstract

Many real-world scientific and industrial applications require the optimization of expensive black-box functions. Bayesian Optimization (BO) provides an effective framework for such problems. However, traditional BO methods are prone to get trapped in local optima and often lack interpretable insights. To address this issue, this paper designs Reasoning BO, a novel framework that leverages reasoning models to guide the sampling process in BO while incorporating multi-agent systems and knowledge graphs for online knowledge accumulation. By integrating the reasoning and contextual understanding capabilities of Large Language Models (LLMs), we can provide strong guidance to enhance the BO process. As the optimization progresses, Reasoning BO provides real-time sampling recommendations along with critical insights grounded in plausible scientific theories, aiding in the discovery of superior solutions within the search space. We systematically evaluate our approach across 10 diverse tasks encompassing synthetic mathematical functions and complex real-world applications. The framework demonstrates its capability to progressively refine sampling strategies through real-time insights and hypothesis evolution, effectively identifying higher-performing regions of the search space for focused exploration. This process highlights the powerful reasoning and context-learning abilities of LLMs in optimization scenarios. For example, in the Direct Arylation task, our method increased the yield to 60.7%, whereas traditional BO achieved only a 25.2% yield. Furthermore, our investigation reveals that smaller LLMs, when fine-tuned through reinforcement learning, can attain comparable performance to their larger counterparts.

Introduction

In high-stakes scientific and industrial domains such as drug discovery and materials science, finding the optimal parameters for a process is often an expensive and time-consuming endeavor. Traditional Bayesian Optimization (BO) has long been the standard tool for navigating these search spaces by using mathematical models to predict the next best experiment. However, these purely statistical methods possess a significant "blind spot": they lack inherent understanding of the underlying chemistry or physics. This often leads to models getting trapped in local optima and failing to provide interpretable explanations for their recommendations.

Reasoning BO addresses these challenges by embedding Large Language Models (LLMs) directly into the optimization loop. By combining statistical sampling with a dynamic knowledge management system, the framework allows the AI to "reason" through experimental data, evolving scientific hypotheses much like a human researcher would.

Methods: The Reasoning BO Framework

The Reasoning BO architecture is built upon three core pillars designed to integrate reasoning and contextual understanding into the BO process.

The Reasoning BO framework integrates a core BO loop with a multi-agent knowledge management system and a post-trained reasoning engine.
  1. The Reasoning Engine: Instead of relying solely on a mathematical formula to pick the next experiment, an LLM evaluates candidate points. It leverages domain priors and historical data to generate scientific hypotheses and assign confidence scores to potential trials.
  2. Dynamic Knowledge Management: To prevent the "forgetting" of historical context, the system employs a multi-agent architecture (Verifier, Formatter, and Notes agents). It extracts Chain-of-Thought (CoT) insights from every round and stores them in a dual-channel system: a Knowledge Graph for structured rules and a Vector Database for unstructured literature.
  3. Post-Training for Optimization: The framework utilizes smaller, efficient models (e.g., a 14B parameter Qwen) fine-tuned via Supervised Fine-Tuning (SFT) and Group Relative Policy Optimization (GRPO). This allows smaller models to follow complex optimization instructions with performance comparable to much larger frontier models.

Experimental Evaluation

The framework was rigorously tested across 10 diverse benchmarks to evaluate its versatility and robustness:

  • Real-World Chemical Tasks: Suzuki-Miyaura Reaction, Direct Arylation, and CPA-Catalyzed Thiol-Imine addition.
  • Engineering and Control: The "Lunar Lander" 12-dimensional spacecraft landing simulation.
  • Synthetic Benchmarks: Classic mathematical "stress tests" for optimizers, including the Ackley, Rosenbrock, Hartmann, and Levy functions.

Results and Key Insights

Reasoning BO demonstrated superior performance across nearly all tasks, particularly in complex chemical environments where domain knowledge is paramount.

Performance comparison of Reasoning BO against Vanilla BO, Random Search, and other baselines across synthetic and real-world tasks.

Performance Gains

  • Direct Arylation: Reasoning BO achieved a 60.7% yield, significantly outperforming traditional BO's 25.2%.
  • Suzuki Reaction: The framework reached a final yield 23.3% higher than the baseline and showed 44.6% better performance in the very first round of sampling due to effective initialization via an "Experiment Compass."
  • Lunar Lander: In this 12-dimensional physics problem, the system achieved significantly higher initial rewards, proving its versatility beyond chemical synthesis.

Scientific Reasoning and Transferability

A key finding is the framework's "Hypothesis Evolution" capability. Reasoning BO does not just update a probability map; it evolves a narrative. For instance, it might pivot from testing "bulky ligands" to "electronic effects" based on experimental failures. Furthermore, the researchers discovered that training the model on general logical tasks (like GSM8K math) improved its ability to optimize chemical reactions, suggesting that logical reasoning is a general skill that helps navigate complex search spaces.

Conclusion and Future Work

Reasoning BO represents a significant step toward "AI Scientists" capable of guiding complex experimental campaigns with both mathematical precision and scientific intuition. By providing real-time sampling recommendations grounded in plausible theories, it aids in discovering superior solutions in vast search spaces. Future work will focus on expanding the framework to multi-objective optimization—balancing yield against cost or safety—and addressing context window limitations for even longer optimization trajectories.

Summary updated

BibTeX
@misc{yang2025reasoning,
  author = {Zhuo Yang and Daolang Wang and Lingli Ge and Beilun Wang and Tianfan Fu and Yuqiang Li},
  title = {{Reasoning BO: Enhancing Bayesian Optimization with Long-Context Reasoning Power of LLMs}},
  year = {2025},
  eprint = {2505.12833},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.12833},
}
Figure