Source-linked AI summary
Closed-Loop Bayesian Molecular Inverse Design with Semantic LLM Surrogates
Yaoyao Xu, Xinjian Zhao, Xiaozhuang Song, Lei Bai, Tianshu Yu
TL;DR
Molecular inverse design must enrich candidate populations under limited oracle budgets, but one-shot generators and compressed GP embeddings provide limited use of semantic molecular history. The paper proposes BoMolLLM, a frozen-LLM surrogate that selects references and optional guidance for a frozen generator in a closed loop. Across drug and material tasks, it improves over one-shot generation, is competitive with or stronger than GP-BO, and yields inspectable exploration-to-exploitation behavior.
Problem
One-shot generators do not use oracle feedback to correct search trajectories, while GP surrogates compress molecular and task information into numerical embedding spaces.
Method
BoMolLLM reads target context, SMILES-level optimization history, and oracle scores to select top-k reference molecules with optional guidance for the next frozen-generator prompt.
Results
Across drug and material tasks, BoMolLLM improves over one-shot generation and is competitive with or stronger than GP-based BO baselines across multiple generator backbones.
Takeaways & Limitations
LLM surrogates provide a useful closed-loop alternative to classical BO surrogates while making reference selection, search behavior, and design rationales inspectable.
Takeaways & Limitations
MolQA oracles are learned predictors rather than full experimental validation, and the LLM surrogate lacks calibrated posterior uncertainty and classical Bayesian theoretical guarantees.
Abstract
from arXiv · showhide
Practical molecular inverse design is rarely a one-shot generation problem; it often takes the form of closed-loop candidate-pool enrichment, where under a limited oracle budget the goal is to \emph{increase the fraction of generated molecules that match a desired property profile}. Bayesian optimization (BO) offers a natural framework for this setting, yet standard Gaussian-process surrogates typically operate in compressed continuous embeddings, which discard the substructural and reference-similarity signals that chemists naturally use to decide where to look next. We propose \textbf{\method}, a closed-loop framework in which the surrogate, rather than the generator, is treated as the locus of design choice, and instantiate it with a frozen large language model that reasons directly over the task instruction, SMILES-level optimization history, and oracle feedback in their native textual form. At each iteration, the surrogate returns a structured decision signal that selects informative reference molecules under an exploration and exploitation principle, optionally with a concise guidance sentence. This signal is converted into next-round conditioning text for a frozen molecular generator, yielding an inspectable optimization trace in natural language. Experiments on MolQA drug and material design tasks show that \method improves over one-shot prompting, is competitive with or stronger than GP-based BO baselines, and reveals a domain-dependent interface: reference-only transfer works best for binary drug targets, while adding a concise surrogate summary is more beneficial for continuous material
1 Introduction
Molecular inverse design is framed as closed-loop candidate-pool enrichment, addressing the limits of one-shot generation and compressed numerical surrogates. BoMolLLM uses a frozen LLM to select semantic references and guide a frozen generator, matching or surpassing GP-BO across tasks.
- Motivation: Closed-loop candidate-pool enrichment targets a higher fraction of generated molecules matching desired profiles under limited oracle budgets.The useful target region may be small, irregular, and difficult to reach through unconstrained generation.
- Motivation: One-shot molecular generators do not explicitly use oracle feedback to refine structural patterns, avoid failures, or sample underexplored regions.This leaves weak initial batches without a mechanism for correcting the search trajectory.
- Motivation: Gaussian-process surrogates operate in numerical embeddings that indirectly encode molecular-string and task-level knowledge while often requiring compression or local-search heuristics.These design choices can further reduce the chemical signal available to the surrogate.
- Method: BoMolLLM reads target context and SMILES-level optimization history, then selects reference molecules and optionally produces rationale for the next generation round.Its semantic decision module preserves exploration–exploitation logic while making the optimization trace inspectable.
- Method: The framework isolates the surrogate layer as the design choice and supports both classical Gaussian-process and LLM-based surrogates in the same closed loop.The LLM surrogate treats pretrained knowledge, in-context conditioning, and reference selection as BO-style prior, posterior update, and acquisition roles.
- Results: Across three generator backbones and six tasks, BoMolLLM matches or surpasses GP-BO baselines while discovering high-scoring molecules earlier and producing interpretable rationales.Analyses also report an exploration-to-exploitation transition in the surrogate’s behavior.
2 Related Work
Related work spans goal-directed molecular design with learned generative models and emerging uses of LLMs in sequential optimization. These lines of work motivate integrating language-based reasoning into iterative molecular search.
- Goal-directed molecular design: Goal-directed molecular design has progressed from rule-based and reinforcement-learning methods to deep generators operating in latent or graph spaces.Representative approaches include policy-based methods, latent-variable models, and benchmark-driven frameworks such as GuacaMol and PMO.
- LLMs as surrogate models: Recent optimization research has incorporated LLMs for BO warm-starting, surrogate modeling, candidate sampling, and iterative solution proposal.LLAMBO and OPRO exemplify language models conditioned on optimization problems, previously evaluated solutions, or their scores.
3 Preliminaries
The preliminaries define Bayesian optimization as probabilistic surrogate modeling with acquisition-based exploration–exploitation and describe the frozen molecular generator used by the framework.
- Bayesian Optimization: Bayesian optimization iteratively selects evaluations by updating a probabilistic surrogate over a black-box function and maximizing an acquisition function.The surrogate provides predictive mean and uncertainty after conditioning on observed data.
- Bayesian Optimization: Expected Improvement combines predicted mean and uncertainty, rewarding exploitation through high mean and exploration through high uncertainty.The displayed EI expression uses the best observed value together with the standard normal CDF and PDF.
- Frozen molecular generator: The frozen generator maps text prompts to candidate molecules through an instruction-following language model, graph-based decoder, and SMILES decoding.Its language-model representation guides graph generation before the sampled graph is converted into a SMILES string.
4 Method
BoMolLLM formulates molecular inverse design as closed-loop candidate-pool enrichment, using a surrogate to convert oracle feedback and optimization history into conditioning for subsequent generation. The method supports both a semantic LLM surrogate and a classical GP surrogate within the same exploration–exploitation loop.
- 4.1 Problem Formulation: Each run evaluates generated molecules with a task-specific oracle and accumulates their scores into a multi-round optimization history.Drug tasks use class probabilities, while material tasks use continuous permeability predictions; both are converted into alignment scores in [0, 1].
- 4.1 Problem Formulation: The objective is to improve the overall quality of the generated population rather than identify only a single best molecule.Utility is measured over all molecules generated across the trajectory, reflecting candidate-pool enrichment under the target task.
- 4.3 Closed-Loop Framework: At each round, a frozen surrogate reads the current history and selects top-k references under an exploration–exploitation principle, optionally producing concise guidance.The selected references and guidance are converted into an augmented prompt for the next generator call.
- 4.4 Surrogate Modules: The framework is surrogate-agnostic, pairing the same closed-loop prompt-update process with either the semantic LLM or a classical GP surrogate.The GP baseline fits a Matérn-5/2 model with ARD in a frozen SVD-compressed conditioning-embedding space and uses LogEI to select nearby historical references.
- 4.4.1 Semantic LLM Surrogate: BoMolLLM uses a frozen instruction-following LLM to read the task, target, round, and history and emit a structured decision signal for prompt augmentation.Its output includes trajectory analysis, selected historical references, and an optional one-sentence guidance field.
- 4.4 Surrogate Modules: The LLM and GP surrogates encode different BO design choices: semantic prior and in-context history for the LLM versus probabilistic posterior and explicit acquisition in continuous embedding space for the GP.This comparison isolates the surrogate layer as the main design choice while keeping the surrounding generation loop shared.
5 Experiments
Experiments evaluate BoMolLLM across drug and material MolQA tasks, generator backbones, baselines, prompt interfaces, and trajectory analyses. Results show broad benefits from closed-loop refinement, domain-dependent value of guidance, and adaptive exploration–exploitation behavior.
- Experimental Setup: Experiments cover binary drug tasks over HIV, BBBP, and BACE and continuous material tasks over CO2, O2, and N2.Drug performance uses mean AUC over generated SMILES, while material performance uses MAE(log10) on valid SMILES plus invalid ratio.
- Baselines: BoMolLLM is compared with one-shot generation, random references, GP-BO references, and external one-shot LLMs across Qwen, Mistral, and Llama backbones.The LLM surrogate selects top-k references under an exploration–exploitation principle, while GP-BO selects references in a PCA-compressed embedding space.
- Main Results: Closed-loop refinement improves over one-shot generation, and BoMolLLM matches or surpasses GP-BO in nearly every setting across all three generator backbones.Its advantage is most pronounced on drug tasks, where it achieves the best AUC on all three targets under both Mistral and Llama.
- Ablation Studies: Guidance consistently improves material tasks across all three backbones but provides no consistent benefit on drug tasks.The authors associate this difference with softer, graded material signals versus sharper binary drug-reference signals.
- Trajectory Analysis: Across BACE, BBBP, N2, and O2, selected references shift from broad early exploration toward focused later exploitation.Score quantiles increase over rounds while mean Tanimoto distance to the top-history set decreases.
- Search Budget Allocation: On N2, BoMolLLM allocates more search budget to regions enriched with high-scoring candidates without collapsing to a single cluster.The visualization uses ECFP4 projections and a shared high-score threshold across methods.
6 Conclusion
The paper introduces BoMolLLM as a semantic surrogate for closed-loop molecular inverse design under limited oracle feedback. Across drug and material tasks, it improves over one-shot generation, competes with or exceeds GP-based BO, and exhibits interpretable adaptive search behavior.
- Conclusion: BoMolLLM treats molecular optimization as candidate-pool enrichment and replaces a numerical surrogate with a semantic module that selects references and optional guidance.The surrogate reads molecular histories directly and updates next-round generation conditioning.
- Conclusion: Across drug and material tasks and multiple generator backbones, BoMolLLM improves over one-shot generation and is competitive with or stronger than GP-based BO baselines.Analyses also show improved trajectories, an exploration-to-exploitation transition, and concentration in high-scoring chemical-space regions.
A Limitations.
The paper’s implementation separates a frozen semantic surrogate from a frozen molecular generator and uses textual histories, references, and optional guidance to update generation prompts. The supplied passages describe the loop and interface, but the paper’s explicit limitations are not included in this section’s evidence.
- Closed-Loop Procedure: Algorithm 1 uses accumulated oracle history to update the generation prompt and iteratively enrich the candidate pool.The loop takes an instruction, target, frozen surrogate, frozen generator, oracle, rounds, and batch settings.
- Surrogate Design: BoMolLLM replaces GP posterior conditioning and numerical acquisition optimization with an LLM that reads discrete molecular histories and selects references under an explore–exploit instruction.Pretrained chemical knowledge serves as a prior-like component, while in-context history provides the posterior-like state update.
- Design Motivation: The design is motivated by discrete compositional chemistry, trajectory-dependent reference utility, and the inspectability of selected references and guidance.These properties distinguish the semantic surrogate from compressed latent-space approaches.
- Baseline Interfaces: Random, GP-BO, and BoMolLLM differ only in how reference sets are chosen before conditioning the next generation round.Random sampling is uniform over history, GP-BO uses embedding-space retrieval, and BoMolLLM uses LLM-selected references.
- Prompt Interface: The generator-facing interface supplies task context, target properties, optimization history, current state, and an explicit exploration–exploitation selection principle.The guidance variant appends one concise surrogate summary and a round-dependent design focus.
E Implementation Details
The study uses a fixed Llamole molecular generator and compares external GP and LLM surrogates for iterative reference selection. The GP operates on PCA-reduced generator-conditioning embeddings, while all methods ultimately condition Llamole with textual references.
- Model families: Iterative methods use Llamole, whereas one-shot baselines directly prompt external language-model backbones without iterative optimization.The study used two model families with distinct generator and baseline roles.
- Model families: Llamole combines an instruction-following language model, graph diffusion transformer, graph encoder, and graph predictor to generate molecular graphs decoded into SMILES.In this study, Llamole serves only as the generator; optimization logic is handled externally.
- GP-BO baseline: The GP-BO baseline fits a surrogate on Llamole’s 768-dimensional DiT conditioning embedding after a 30-molecule warm start and fixed PCA projection.It uses a Matérn-5/2 kernel and LogEI acquisition with 30 PCA dimensions in the shared protocol.
- GP-BO baseline: GP proposals retrieve top-k historical molecules rather than decoding directly, so iterative methods all steer Llamole through textual reference conditioning.The shared generator interface isolates differences in how references are selected.
- Property oracles: Drug oracles are random-forest classifiers, while material oracles are random-forest regressors whose outputs are transformed into alignment scores.Drug scores are flipped for desired zero labels; material scores use exponential log-space alignment so lower target error scores higher.
F Data Overview
MolQA instances specify an inverse-design instruction, optional input, reference output, and property dictionary. Drug tasks target binary multi-property profiles, whereas material tasks target continuous gas-permeability values under a shared iterative budget.
- Task format: Each MolQA instance contains an instruction, optional input, reference output, and property dictionary describing the target profile.The instruction defines the design problem in natural language, while the property dictionary specifies the properties to match.
- Drug and material domains: Drug tasks evaluate matching desired multi-property binary profiles, while material tasks evaluate alignment with continuous gas-permeability targets.Classification supervision is relatively crisp for drugs, whereas regression supervision is softer for materials.
- Illustrative examples: The illustrative drug task requests HIV activity, BBB permeability, and BACE inactivity, represented by the target properties HIV: 1, BBBP: 1, and BACE: 0.This example demonstrates the natural-language instruction and binary target interface.
- Illustrative examples: The illustrative material task requests high CO2 permeability, low N2 and O2 permeability, and specified structural properties.Its target dictionary includes CO2 0.94, N2 0.0, O2 0.0, FFV 0.381, SC 2.28, and SA 4.21.
- Optimization budget: All iterative methods use T = 5 rounds, N0 = 30 warm-start molecules, N = 10 molecules per later round, and k = 3 in-context references.The GP additionally uses r = 30 PCA dimensions, a Matérn-5/2 kernel, and LogEI acquisition.
H Analysis Protocols
The analysis evaluates convergence, threshold-reaching speed, surrogate exploitation, exploration, and latent-space allocation. These metrics quantify both optimization progress and the intended exploration-to-exploitation behavior.
- Convergence metrics: Convergence curves report the mean best-so-far score across test instances with 95% confidence intervals.The best-so-far trajectory is built from each sample’s best score obtained within each round.
- Convergence metrics: Threshold plots report the cumulative fraction of samples whose first hitting time is at most each round, measuring how quickly methods reach a high-score region.The threshold is task-specific.
- Mechanism metrics: Exploitation is measured by the empirical score quantile of selected references within the available history.Higher q_t indicates selection closer to the top of the observed score distribution.
- Mechanism metrics: Exploration is measured by the mean Tanimoto distance between selected references and the current top-history set.Larger d_t indicates broader exploration, while increasing q_t with decreasing d_t indicates a shift toward exploitation.
- Latent-space visualization: Latent-space visualizations represent molecules with 2048-bit ECFP4 fingerprints, reduce them with PCA and t-SNE, and embed all methods in a shared two-dimensional space.A pooled empirical quantile defines a common high-score threshold for highlighting promising regions.
I Additional Results
Additional analyses extend convergence, latent-space, and trajectory evidence across tasks and inspect surrogate reasoning traces. The examples show broad iterative improvement alongside a hard BACE case with non-monotonic progress and chemically specific reference-selection rationales.
- Convergence and latent-space results: Figure 5 extends convergence analysis to BBBP and O2, showing iterative methods improve with optimization rounds.It reports mean best-so-far scores with 95% confidence intervals and cumulative threshold-crossing fractions.
- Convergence and latent-space results: Figure 6 shows that high-score concentration patterns recur across BACE visualizations rather than appearing only in the N2 example.The visualization compares highlighted high-score molecules with all displayed molecules in a shared fingerprint space.
- Hard-case trajectory: A hard BACE case falls from 0.4767 at warm start to 0.4140 by round 2 before recovering to 0.6208 in the final reported round.The trajectory illustrates non-smooth optimization with stronger progress arriving only in later rounds.
- Surrogate traces: The BACE trace uses a top-k-only interface in which the surrogate outputs ANALYSIS and SELECTED fields without a guidance sentence.Warm start initializes history without a surrogate call; rounds 1–4 then consume the full surrogate interaction trace.
- Surrogate chemical rationale: In one trace, high-scoring molecules are associated with fluorine atoms, nitrogen-containing rings, oxygen-containing groups, and aromatic rings.Low-scoring molecules often lack these features or contain fewer of them.
- Surrogate chemical rationale: The surrogate selects Molecules 16, 31, and 33 to balance exploitation of high scores with exploration of distinct structural directions.Their cited scores are 0.4767, 0.3940, and 0.4300, respectively.
- Surrogate chemical rationale: Across another trace, high-scoring molecules are described as combining fluorine substitution, nitrogen-containing heterocycles, aromatic ring systems, and polar functional groups.These observations are presented as recurring structural features in the optimization history.
I.4 Impact of Iteration Rounds
The study varies closed-loop optimization rounds from 3 to 11 on BACE and O2 while fixing other settings and generating 10 molecules per round. BoMolLLM improves with more rounds on BACE and outperforms Llamole-OneShot across all tested O2 settings.
- Experimental setup: Using the Llama backbone, the study compares 3, 5, 7, 9, and 11 optimization rounds on BACE and O2, with 10 molecules generated per round.All other settings and the evaluation protocol are held fixed against Llamole-OneShot.
- BACE: On BACE, BoMolLLM's AUC rises from 0.5831 at 3 rounds to 0.6269 at 11 rounds, while Llamole-OneShot remains around 0.51–0.53.Higher AUC is better for BACE.
- O2: On O2, BoMolLLM has lower MAE(log10) than Llamole-OneShot at every tested round count, with error changing from 0.7482 at 3 rounds to 0.7431 at 11 rounds.Lower MAE(log10) is better for O2.
- Overall trend: Increasing the number of closed-loop rounds can improve performance under the fixed per-round generation setting.The reported trend is supported by the BACE improvement and the O2 comparison across tested round counts.