Manuscript Offprint

arXiv:2610.25747

Bayesian Model Discovery with Language Models: Closing the Loop between Hypotheses and Experiments

JooKyung Yuh, Byungmin Park, Eunseo Choi, Jinheon Baek, Junmo Cho, Kyu Hyun Choi, Sung Ju Hwang, Kyong Hwan Jin, Hae Beom Lee

Abstract

Scientific model discovery requires proposing candidate models of an unknown system and designing experiments that discriminate among them. However, LLM-based approaches typically rely on in-context learning to predict outcomes and select experiments, lacking explicit model evaluation to systematically guide hypothesis search, while Bayesian approaches enable principled model comparison but are confined to a predefined candidate set which results in limited search spaces. To this end, we introduce Bayesian Model Discovery (BMD), which closes the loop between LLM-driven hypothesis generation and Bayesian experimental design. Specifically, an LLM proposes model families, while a numerical engine fits their parameters, weighs them by model evidence, and averages their predictions. Then, BMD chooses the next experimental conditions by maximizing the joint expected information gain over families and their parameters, while feeding the updated beliefs and residual diagnostics back to the LLM to guide its next proposals. Across four scientific discovery benchmarks, BMD achieves lower final prediction error than in-context learning and LLM-based scientific agents while recovering exact functional forms more often, with ablations supporting numerical feedback and the joint objective.

1 Introduction

Many scientific advances take the form of mathematical models that describe how a system responds to experimental conditions (Langley et al., 1987; Schmidt and Lipson, 2009; Wang et al., 2023). Discovering such models alternates between proposing candidate models and designing experiments that discriminate among them (Box and Hill, 1967; Blei, 2014). For example, a scientist studying how a drug slows down an enzyme may consider two candidate models: the drug either competes with the molecule the enzyme acts on or attaches elsewhere on the enzyme. Both models may fit the initial measurements equally well, but the scientist can tell them apart with an experiment that adds a large amount of this molecule, as the two predict different reaction rates. Recently, Large Language Models (LLMs) have shown promise in automating this process (Boiko et al., 2023; Romera-Paredes et al., 2024; Yang et al., 2024; Lu et al., 2024; Shojae et al., 2025; Baek et al., 2025), owing to their broad scientific knowledge and reasoning abilities.

One common approach is in-context learning (ICL) (Brown et al., 2020), where the LLM directly predicts responses and selects experiments from observations (Gandhi et al., 2025). While this approach exploits the prior knowledge of LLMs, it does not commit to explicit models fitted to data, leaving the LLM to make every prediction and choose experiments without quantifying which explanations remain plausible (Gupta et al., 2025).

In contrast, explicit probabilistic models address both issues by expressing each candidate explanation as an equation, called a model family, whose functional form (e.g., competitive inhibition) contains unknown parameters (e.g., the maximum reaction rate). Specifically, once these parameters are estimated, the equation can predict responses at untested conditions, allowing a suitable family to generalize from few observations. In addition, these models guide experiment selection, as Bayesian inference quantifies how plausible each family and its parameters remain (Kass and Raftery, 1995; Hoeting et al., 1999), which Bayesian experimental design (Lindley, 1956; Chaloner and Verdinelli, 1995; Rainforth et al., 2024) uses to select the most informative experiment to run next.

However, explicit modeling alone is not sufficient, as Gandhi et al. (2025) find no consistent benefit from augmenting an LLM with a statistical model. Moreover, Bayesian inference over a fixed

Run the experiment and add its response

Figure

Figure 1: Overview of Bayesian Model Discovery. Given the observations DtD_t, the numerical engine fits each candidate family and returns the resulting beliefs and residual diagnostics to the LLM, which proposes new families. These proposals are validated, fitted, and compared with the existing families, after which the updated pool selects the next experimental conditions xt+1x_{t+1} by maximizing the joint expected information gain.

set of candidates cannot recover a family missing from it, while LLMs can propose new families (Li et al., 2024; Shojaee et al., 2025) that remain unverified until they are fitted against the data. The central challenge, therefore, lies in connecting family search, parameter inference, and experiment selection such that each step informs the others.

To address this, we present Bayesian Model Discovery (BMD), a framework that closes the loop between LLM-driven hypothesis generation and Bayesian experimental design (Figure 1). Our key insight is that LLMs and Bayesian inference have complementary strengths: LLMs can draw on domain knowledge to propose plausible functional forms, whereas Bayesian inference can quantify how well each form explains the data. Specifically, BMD employs an LLM to propose model families, while a numerical engine fits their parameters, weighs each family by its model evidence, and averages their predictions. Then, since a new observation can distinguish competing families, refine their parameters, or both, BMD chooses the next experimental conditions by maximizing the joint expected information gain over families and their parameters (Borth, 1975; McGree, 2017), while feeding the updated beliefs and residual diagnostics back to the LLM to inform its next proposals.

We validate BMD on four scientific discovery benchmarks, namely ChemBench (Kabra et al., 2026), BoxingGym (Gandhi et al., 2025), ForceBench (Wiemann et al., 2026), and NewtonBench (Zheng et al., 2026). BMD achieves the lowest final prediction error on every benchmark against direct ICL and recent LLM-based scientific agents, while also recovering exact functional forms more often. Our analyses further show that numerical feedback to the LLM improves prediction and that the joint objective outperforms targeting either families or parameters alone. These findings suggest that LLMs are most effective as hypothesis generators within a closed loop of explicit model fitting and experimental design, rather than as standalone predictors of experimental results.

References (89)

  • Miles Cranmer. 2023. Interpretable machine learning for science with PySR and SymbolicRegression.jl. arXiv preprint arXiv:2305.01582. (opens arXiv in a new tab)
  • Kanishk Gandhi, Michael Y. Li, Lyle Goodyear, Agam Bhatia, Louise Li, Aditi Bhaskar, Mohammed Zaman, and Noah D. Goodman. 2025. BoxingGym: Benchmarking progress in automated experimental design and model discovery. arXiv preprint arXiv:2501.01540. (opens arXiv in a new tab)
  • Sanchit Kabra, Nikhil Abhyankar, Saaketh Desai, Prasad Iyer, and Chandan K. Reddy. 2026. LLM-AutoSciLab: Closed-loop scientific discovery via active experimentation with LLMs. arXiv preprint arXiv:2605.24043. (opens arXiv in a new tab)
  • The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery
  • Kevin Murphy. 2026. Model discovery agent: LLM-assisted bayesian experiment design for data-efficient discovery of mechanistic world models. arXiv preprint arXiv:2608.09696. Version 5; versioned protocol comparison. (opens arXiv in a new tab)
  • Ben Prystawski, Kushin Mukherjee, Daniel Wurgaft, Linas Nasvytis, Michael Y. Li, Noah D. Goodman, and Michael C. Frank. 2026. auto-psych: Automating the science of mind using agent-driven theory discovery and experimentation. arXiv preprint arXiv:2606.26460. (opens arXiv in a new tab)
  • Stefan Wahl, Raphaela Schenk, Ali Farnoud, Jakob H. Macke, and Daniel Gedon. 2026. A probabilistic framework for LLM-based model discovery. arXiv preprint arXiv:2602.18266. (opens arXiv in a new tab)
  • Matt L. Wiemann, Lindsay M. Smith, Peter Melchior, Siddharth Mishra-Sharma, Andrew Gordon Wilson, Pavel Izmailov, and Carolina Cuesta-Lázaro. 2026. DiscoverPhysics: Benchmarking LLMs for out-of-the-box scientific thinking. arXiv preprint arXiv:2605.26087. Version 2, August 31, 2026. (opens arXiv in a new tab)
  • A task specifies a generating mechanism; a world also fixes its parameters and observation process
  • One ForceBench trajectory counts as one observation, not one observation per time point
  • All methods use Claude Opus 5.5 for their LLM calls
  • All receive the same physical task metadata and design constraints, observe trajectories through the same interface, and are evaluated using the same targets and scorer
  • Direct ICL chooses experimental designs from its observation history and receives separate prediction requests at each observation count; these requests do not change that history
  • Normalizers are specific to the target
  • Structural recovery uses only targets representable in the interface; predictive evaluation retains all tasks
  • BoxingGym uses noise-free response-mean nMSE, including survival
  • Performance at that point reflects the initial observations and fitted pool, not an effect of an EIG-selected experiment
  • BMD and ICL use all runs in Table 3
  • The exclusions are:
  • Each candidate specifies a functional expression and its coefficient roles and domains
  • Canonicalization normalizes expression syntax, roles, and family, including equivalent power notations
  • The proposer uses Claude Opus 5.5 with medium reasoning effort, 16,000 output tokens, and a 120-second timeout
  • Chem-Bench and BoxingGym’s death, dugongs, peregrines, and survival tasks use independent default role priors:
  • NewtonBench and BoxingGym’s hyperbolic task use a wide prior: intercept $\mathcal{N}(0, 4^2)$, signed $\mathcal{N}(0, 2^2)$, positive LogNormal(0, 2), and shape Gamma(2, $\frac{1}{2}$)
  • The response unit is the initial sample mean on ChemBench and BoxingGym's positive-response path, and the initial geometric mean on NewtonBench
  • BoxingGym uses the likelihood assigned to each task; ForceBench uses the task's fixed likelihood on trajectory coordinates
  • The fitted likelihood can differ from the simulator noise; ChemBench, for example, generates relative Gaussian noise
  • SMC bridges densities proportional to $\pi_m(\boldsymbol{\theta}_m) L_{m,t}(\boldsymbol{\theta}_m)^\beta$, increasing $\beta$ from zero to one (Del Moral et al., 2006)
  • The fitting configuration specifies a 5,000-stage/1,800-second limit
  • The estimator samples a family, posterior parameters, and a hypothetical outcome, then compares its conditional likelihood with the weighted predictive mixture
  • The 256-point pools declared for other comparison methods are not used by these runs
  • BoxingGym scores a 100-point candidate pool (75 for hyperbolic) and starts compass search from the best five points; it re-evaluates the pool maximum and search endpoints together
  • One set of random draws is shared across all starts and steps within a round; endpoints are re-estimated with independent draws before selection
  • The two curves in Figure 3 evaluate the same top-1 model at each observation budget: BMD's highest-evidence retained family or AutoSciLab's current hypothesis
  • The intended relations are
  • A deterministic judge (version 1.3) first applies the task's link, input transformations, and target conventions
  • Containment is recorded separately
  • They fail strict recovery but can pass the separate containment check
  • The counts below refer to the sequential recovery experiment in Figure 3
  • Candidate nuisance terms are recorded but not judged
  • Hyperbolic requires the normal cumulative distribution function, absent from the grammar, leaving 12 representable runs
  • Simulator force softening and periodic background terms are excluded from the target; candidates adding them can count as containment
  • Malus requires sine and cosine, absent from this grammar, leaving 24 runs
  • AutoSciLab uses every-round updates on ChemBench, BoxingGym, and ForceBench, but its released NewtonBench schedule produces no law before n = 16
  • Section 4.3 separates explicit prediction, parameter inference, and model selection from differences in hypothesis generation and experimental design
  • A predicts responses directly from the observations and candidate list
  • The numerical engine fits every candidate on the full D using SMC and the task priors, independently of B's parameter estimates
  • The three explicit predictors are
  • For benchmark b, let $W_b$ be its number of evaluated worlds, $S_{b,j}$ the included seeds of world j, and $e_{a,b,j,s}$ the prediction error of method a
  • Table 2 reports relative errors $R_{a,b} = E_{a,b}/E_{A,b}$, making direct ICL equal to one in every benchmark
  • Table 5 gives the reported absolute errors before normalization, and Table 6 gives the identification counts
  • No feedback
  • Lower is better
  • Figure 6 compares nine ChemBench tasks and five ForceBench worlds, each with three seeds (27 and 15 runs per variant)
  • Subsequent datasets and model pools need not match, even though initialization and the numerical inference and design procedures are shared
  • The horizontal axis is the total number of observations
  • Either feedback bundle generally improves prediction over No feedback
  • With a fixed dataset and fitted pool, the compared objectives are
  • \tag {20} $$
  • Random samples from the de-
  • Separately clipping estimates or removing different invalid components breaks this identity; the identity itself does not establish convergence
  • Let $\mathbf{x}' \sim \nu$ be a feasible target input sampled as specified in Appendix B. The prospective response at $\mathbf{x}$ and target response at $\mathbf{x}'$ share the same sampled family and parameters but are conditionally independent given them:
  • \end{aligned} $$
  • Independent latent draws would remove the predictive dependence of interest
  • Holding the fitted state fixed while optimizing one next experiment should not be confused with fixing that state for the entire sequential run
  • Each variant generates its own initial pool, so the realized pools, subsequent data
  • Entries are final geometric-mean errors; ChemBench uses $n = 33$, BoxingGym $n = 32$, and ForceBench $n = 18$
  • No NewtonBench acquisition result is reported
  • Each request also supplies the task interface, observations, feedback, and task-specific constraints
  • model family
  • ForceBench includes cos and sin; the engine applies its task-specific limits of three free constants and ten operators
  • Discovery initialization requests candidate forms from the initial observations, with the candidate/refill settings in Appendix B. The GT-containing pool of Section 4.3 is a separate controlled construction, not a prompt used to initialize the end-to-end discovery runs
  • A Bayesian engine fits and scores every candidate
  • Judge a form by how much of the data it would leave unexplained, not by how few edits separate it from the current best model
  • Inside log a raw input with a wide positive range is safe; outside log, such an input times a coefficient, or raised to a coefficient power, can overflow exp and is rejected
  • : <one input name>
  • For example c*tanh(w) counts 2, and each further term c*f(x + k) added to a sum costs 4
  • Priors are fixed by these labels; never write numeric priors
  • expression
  • Propose three distinct, non-equivalent hypotheses
  • candidates
  • Table 9 gives arithmetic seed means for each task
  • Table 10 records first admission of a ping-pong primary family
  • Posterior means $K = 1.032$ and $K_{a} = 2.060$ are close to true values 1 and 2, with particle standard deviations 0.061 and 0.140
  • The final EIG primary errors are near this value despite much lower observation error
  • The free condition estimates $b_1$, $b_2$; the fixed condition supplies them but still fits $b_0$ and noise
  • Entry and stable dominance concern the broader primary-family classifier
  • >Policy</td><td rowspan=
  • All entries are primary nMSLE