acceptodds
Under review as a conference paper at ICLR 2027

AgentBayes: Open-Ended Scientific Model Discovery

Abstract

Scientific data modeling often requires more than predicting observations; it must recover the probabilistic data-generating structure: how observations are nested, how variation arises at each level, and how uncertainty propagates through to predictions. We introduce AgentBayes, an agentic system for Bayesian model discovery on real scientific datasets. AgentBayes automates the iterative Bayesian workflow through two roles: an Interactor that explores raw data and fitted posteriors through executable analysis, and a Modeler that converts these findings into hierarchical probabilistic programs. Because data and posterior samples remain in an executable sandbox rather than being serialized into LLM context, AgentBayes can critique and revise models at dataset scales where prior agentic Bayesian systems exhaust the context window. Across five posteriordb benchmarks and three scientific case studies, AgentBayes matches or improves on expert-written Bayesian models on most datasets, scales to larger datasets than prior agentic Bayesian systems, and outperforms symbolic regression baselines on data with experimental hierarchy. AgentBayes also surfaces overlooked data structure in existing benchmarks, and adapts its probabilistic programs accordingly. Together, these results show that LLM agents can aid scientists by performing the full Bayesian workflow, from exploratory data analysis to open-ended posterior predictive checks, on real-world, large-scale scientific data, broadening LLM-based scientific discovery from equation search to full probabilistic modeling.

Primary area:
foundation or frontier models, including LLMs
Keywords:
Agents, large language models, AI for Science

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_fbbNOpenReview ↗
Rating
1
Confidence
4
Informativeness
1
Presentation
1
Soundness
1
Read review
Paper summary

This paper presents AgentBayes, a two-agent framework for automated Bayesian model discovery. An Interactor performs data exploration and posterior critique, while a Modeler generates and fits Stan programs. The method is evaluated against expert Bayesian models, BoxLM, and symbolic regression baselines.

Critical strengths

The integration of executable data exploration with automated Bayesian modeling has practical utility.

Critical weaknesses

he presentation of this paper is disastrous. After reading the entire introduction, I could not grasp what the core contributions of the paper actually are. Upon finishing the full text, it appears that the paper merely repurposes the existing "LLM candidate generation – execution evaluation – feedback refinement" loop as its primary contribution, without clearly proposing any novel mechanisms that go beyond general agent search. Furthermore, the Odorant program (Appendix A.5, lines 1191–1207) conditions posterior predictive generation on observed responses, which forces predictions to zero whenever the observation is non-positive. This invalidates the posterior predictive procedure presented in the paper and raises serious concerns regarding the reliability of the critique mechanism. The experimental evaluation is also severely inadequate. The paper fails to justify the necessity of the two-agent architecture. Additionally, the ablation study removes multiple capabilities simultaneously, and the scalability comparison omits BoxLM's existing visual-only variant. More importantly, improved predictive performance does not establish the recovery of the underlying data-generating process. The baseline comparisons are also insufficient; notably, there is a complete lack of comparison with existing studies that leverage LLMs to accelerate Bayesian Optimization (BO). In conclusion, this paper suffers from severe flaws and requires substantial improvements before it can be considered for publication.

Questions for authors

No

2 comments
AuthorsOpenReview ↗

Response to Reviewer fbbN (1/2)

We thank the reviewer for their review and are glad they acknowledge that our proposal has practical utility.

  1. A.5 posterior reliability.

We thank the reviewer for identifying this. The A.5 program, written by the LLM, generates y_rep conditioned on the observed zero; the posterior predictive procedure itself is standard, but this program implemented it incorrectly for those observations. To assess how much this affects our results and the critique mechanism, we analyzed all AgentBayes selected models. Only 1 of 26 has this fault. We agree this is a limitation of LLM generated models. Predictive checks are one of several inputs to the critic, alongside ELPD-LOO, Pareto-k, convergence diagnostics, and the code itself. To make identification of such issues more reliable, we have added mechanical invariance checks to the pipeline, which test whether y_rep[n] changes when only y[n] changes.

We further clarify that this model was not used for the generation of Table 3, but was from the case study section, of how a scientist might apply AgentBayes (and use the entire dataset, as is common practice in Bayesian modeling). However, we will update Figure 3 to accurately represent the correct posterior. Visually, it remains almost identical. Table C shows the exact changes in the figure.

Table C. Figure 3 before and after correcting the A.5 y_rep

Panellog₁₀ conc.Old meanNew meanOld 90% bandNew 90% band
Non-responder−80.0000.002[0.00, 0.00][0.00, 0.00]
Non-responder−70.0000.005[0.00, 0.00][0.00, 0.00]
Non-responder−60.0000.012[0.00, 0.00][0.00, 0.00]
Non-responder−50.0000.026[0.00, 0.00][0.00, 0.00]
Non-responder−40.0000.044[0.00, 0.00][0.00, 0.15]
Responder−80.1020.102[0.03, 0.23][0.03, 0.24]
Responder−70.3310.330[0.13, 0.68][0.13, 0.67]
Responder−60.9341.042[0.41, 1.76][0.48, 1.93]
Responder−52.6782.673[1.38, 4.54][1.38, 4.57]
Responder−44.7154.709[2.65, 7.59][2.65, 7.58]
Saturator−80.0450.065[0.01, 0.13][0.01, 0.18]
Saturator−70.2760.385[0.06, 0.68][0.10, 0.88]
Saturator−61.8881.897[0.66, 3.91][0.66, 3.90]
Saturator−54.1464.151[1.83, 7.57][1.83, 7.63]
Saturator−45.0555.037[2.50, 8.59][2.50, 8.59]
  1. Necessity of the two-agent architecture and Ablations.

    We have conducted new experiments to compare AgentBayes with a general-purpose coding agent, Codex with access to the same machinery (stan, plotting, analysis environment) and underlying LLM (GPT 5.2). We show test-set predictions on the held-out Radon, Odorant, and Wingbeat datasets. To better quantify the predictive distribution, we include the Continuous Ranked Probability Score (CRPS), a generalization of the mean absolute error. We find that Codex approximately matches Radon, but AgentBayes outperforms Codex on both Odorant and the unpublished dataset Wingbeat.

Table A. AgentBayes vs Codex, mean test set CRPS, NMSE

DatasetSystemnCRPS ↓NMSE ↓
RadonAgentBayes30.5110.697
RadonCodex30.5120.699
OdorantAgentBayes30.3530.406
OdorantCodex30.5070.593
WingbeatAgentBayes31.860.075
WingbeatCodex32.430.123

To help separate the contributions of the different roles of the Interactor, exploration and critique, we ran additional held-out ablations on Radon and Odorant. Removing the Interactor (proposer alone) degrades prediction on average on both datasets. Much of the benefit of the Interactor comes from exploring the data before modeling, as exploration alone can help match the full system performance. A system with the explorer ablated, but critic intact can reach full system performance on Radon but not on Odorant. Radon has a well-established hierarchical structure, and all interactive configurations converge to similar accuracy. Odorant is more complex and has no standard model, and interaction matters more there. We believe the benefit of interaction is problem-dependent and is largest when structure must be discovered from data.

Table B. Stage ablation (held-out test set), CRPS and NMSE

ConfigurationRadon nRadon CRPS ↓Radon NMSE ↓Odorant nOdorant CRPS ↓Odorant NMSE ↓
Full AgentBayes (explore + critique)30.5110.69730.3530.406
Explore only20.5110.69820.3320.418
Critique only20.5120.70320.4590.690
Proposer alone (no interaction)20.5230.73320.3960.538
AuthorsOpenReview ↗

Response to Reviewer fbbN (2/2)

  1. “The scalability comparison omits BoxLM’s existing visual-only variant”

BoxLM provides neither the code to generate visual representation of datasets nor the structure to propose plots in a data-agnostic way. There is no way to generate the visual-representation of PosteriorDb that was used in BoxLM and to attempt to generate visual representations on new datasets would require a domain expert to decide on how to generate the plots. In AgentBayes, the Interactor can propose plots to represent the data without a human expert pre-defining the plots.

  1. Improved predictive performance and the recovery of the underlying data-generating process

We agree that predictive metrics do not certify that a discovered structure is correct, and we will narrow our wording accordingly. This limitation applies to Bayesian modeling generally, not only to AgentBayes: under misspecification the posterior concentrates on the parameter values closest in KL divergence to the data generating process (Berk, 1966; Kleijn & van der Vaart, 2006), and expected log predictive density ranks models by the KL divergence of their predictive distributions from that process (Gelman et al., 2014; Vehtari et al., 2017). AgentBayes searches for the best-supported model among those it proposes and checks, and its parameter and variance-component estimates are interpreted conditional on that model. We will replace “recover the data-generating process” with “propose, test, and select probabilistic models”.

We target the problem of real world scientific domains, which attempt to model imperfectly observed phenomena where the ground truth structure is unknown. We do devote the case studies to dive into these datasets and show how the models are useful for real scientific tasks and how the modeling choices shed light on underlying structures within the data that we verify.

  1. “There is a complete lack of comparison with existing studies that leverage LLMs to accelerate Bayesian Optimization (BO).”

Despite the shared term “Bayesian”, the two settings address different problems. BO, including LLM-assisted variants, use a Bayesian surrogate model to choose where to evaluate an expensive black-box objective, searching a fixed, typically low-dimensional parameter space for a best configuration. AgentBayes, instead automates the Bayesian modeling workflow itself (Box’s loop of model building, inference, and criticism). Its search space is the open-ended set of probabilistic programs, which the system writes, fits, and criticizes against the data. The output is not an optimal point, but a fitted scientific model. The closest comparisons for our setting are prior LLM-driven model-discovery systems (like BoxLM, which we compare against in Table 2), the more distantly related symbolic regression systems (which we compare against), and general-purpose coding agents tasked with model discovery (which we now report in Table A).

Reviewer_xoydOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper introduced AgentBayes, an automated Bayesian model discovery framework that uses two agents to iteratively perform data exploration, probabilistic program generation, posterior inference, and model diagnostics. The Interactor analyzes raw data and fitted posteriors in an executable Python environment, while the Modeler generates and fits Stan programs based on its reports. Evaluations show competitive ELPD relative to expert-written reference models and other baselines.

Critical strengths
  1. The paper addresses a practically meaningful problem and implements a comprehensive, scalable Bayesian modeling workflow. By keeping data and posterior samples in the execution environment and exchanging only structured findings, the system avoids the context-window bottleneck in previous method.

  2. The empirical results for predictive values on are promising, and the Radon case studies demonstrate useful data analysis capabilities.

Critical weaknesses

1, The current ablation removes the entire Interactor, simultaneously eliminating initial data exploration and subsequent posterior critique. Therefore, the experiment only demonstrates that the Interactor is beneficial as a whole, without establishing whether the gains primarily come from initial exploratory data analysis or iterative, open-ended model critique.

2, The paper emphasizes discovering hierarchical structures, latent variables, and sources of variation at different levels. However, its main quantitative evidence consists of ELPD for predictive distributions and NMSE/R^2 for predictive means. These metrics do not directly establish whether the discovered structures, parameter interpretations, or variance decompositions are correct.

3, The paper specifies the number of candidate models, search iterations, and Interactor interaction budgets, but does not evaluate how these choices affect performance and computational cost.

4, The paper does not quantitatively report the complexity of the generated models.

Questions for authors

See Weaknesses.

2 comments
AuthorsOpenReview ↗

Response to Reviewer xoyd (1/2)

Thank you for your careful review. We are glad you found the empirical results promising and that the case studies demonstrate useful capabilities.

  1. Contribution of Interaction components.

To help separate the contributions of the different roles of the Interactor, exploration and critique, we ran additional held-out ablations on Radon and Odorant. We also present the CRPS (continuous ranked probability score), a generalization of the mean absolute error to additionally quantify the predictive distribution. Removing the Interactor degrades prediction on average on both datasets. Much of the benefit comes from exploring the data before modeling, as exploration alone can help match the full system. Critique alone can help on Radon but not Odorant. Radon has a well-established hierarchical structure, and all interactive configurations converge to similar accuracy. Odorant is more complex and has no standard model, and interaction matters more there. We believe the benefit of interaction is problem-dependent and is largest when structure must be discovered from data.

Table B. Stage ablation (held-out test set), CRPS and NMSE

ConfigurationRadon nRadon CRPS ↓Radon NMSE ↓Odorant nOdorant CRPS ↓Odorant NMSE ↓
Full AgentBayes (explore + critique)30.5110.69730.3530.406
Explore only20.5110.69820.3320.418
Critique only20.5120.70320.4590.690
Proposer alone (no interaction)20.5230.73320.3960.538

We have also conducted new experiments to compare AgentBayes with a general-purpose coding agent, Codex, with access to the same machinery (stan, plotting, analysis environment) and LLM (GPT 5.2). We show test-set predictions on the held-out Radon, Odorant, and Wingbeat datasets. We find that Codex approximately matches Radon, but AgentBayes outperforms Codex on both Odorant and the unpublished dataset Wingbeat.

Table A. AgentBayes vs Codex, mean test set CRPS, NMSE

DatasetSystemnCRPS ↓NMSE ↓
RadonAgentBayes30.5110.697
RadonCodex30.5120.699
OdorantAgentBayes30.3530.406
OdorantCodex30.5070.593
WingbeatAgentBayes31.860.075
WingbeatCodex32.430.123
  1. Correctness of discovered hierarchical structures.

We agree that predictive metrics do not certify that a discovered structure is correct, and we will narrow our wording accordingly. This challenge applies to Bayesian modeling generally, not only to AgentBayes: under misspecification the posterior concentrates on the parameter values closest in KL divergence to the data generating process (Berk, 1966; Kleijn & van der Vaart, 2006), and expected log predictive density ranks models by the KL divergence of their predictive distributions from that process (Gelman et al., 2014; Vehtari et al., 2017). AgentBayes searches for the best-supported model among those it proposes and checks, and its parameter and variance-component estimates are interpreted conditional on that model. We will replace “recover the data-generating process” with “propose, test, and select probabilistic models”.

In real scientific datasets the true structure is unknown, and predictive fit alone cannot establish it. Instead, the structure AgentBayes proposes acts as a set of testable hypotheses about the data, and following up on them can reveal facts that were not previously known about its structure. The case studies show this. On Radon, exploration flagged floor code 9 as a sentinel rather than a floor level, and the model encoded floors as separate levels, unlike the PosteriorDB expert model. Additionally, the split of county uranium into between-and within- components exposed the within-county variation in the counties where the geology says there should not have been any. Following up on this, we traced it to a preprocessing error in the benchmark data: counties were indexed by names, merging counties across states. For imperfectly observed scientific phenomena, this is the role we see for AgentBayes: proposing structure that scientists can investigate and verify.

  1. Performance and Cost of search parameters.

Running the computation varying the search parameters across interactor turn budget, number of parallel candidates, and number of iterations would be an expensive search ranging 1-4 weeks continuously. We do not claim that the demonstrated parameters are optimal. However, we do provide the following analysis on our runs. On average, the selected model was found 75% of the way through the iteration budget. It came from the final iteration in 5/12 searches for the small PosteriorDB datasets and 5/9 on the larger, more complex datasets (Radon, Odorant, and Wingbeat). This provides evidence that iterative refinement results in improved performance.

AuthorsOpenReview ↗

Response to Reviewer xoyd (2/2)

  1. Complexity of generated models.

We will update the appendix to include the standard complexity criterion for Bayesian probabilistic programs, the number of effective parameters.

References:

Berk, R. H. (1966). Limiting behavior of posterior distributions when the model is incorrect. Annals of Mathematical Statistics, 37(1), 51–58.

Kleijn, B. J. K., & van der Vaart, A. W. (2006). Misspecification in infinite-dimensional Bayesian statistics. Annals of Statistics, 34(2), 837–877.

Gelman, A., Hwang, J., & Vehtari, A. (2014). Understanding predictive information criteria for Bayesian models. Statistics and Computing, 24(6), 997–1016.

Vehtari, A., Gelman, A., & Gabry, J. (2017). Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing, 27(5), 1413–1432.

Reviewer_S8XMOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes AgentBayes, an agentic framework for automated Bayesian model discovery. It employs an Interactor agent for data exploration and posterior critique, and a Modeler agent for generating and fitting hierarchical probabilistic programs. By keeping data and posterior samples in an executable environment, the system supports iterative model refinement at scale. Experiments on Bayesian benchmarks and real scientific datasets demonstrate competitive predictive performance and the ability to identify meaningful data structures.

Critical strengths
  • Practical and scalable framework. AgentBayes integrates data exploration, probabilistic model generation, and posterior critique into an automated workflow. Its executable data interaction mechanism enables analysis of larger scientific datasets without excessive context consumption.

  • Meaningful empirical results. The experiments demonstrate competitive performance against expert-written Bayesian models and improvements on structured scientific datasets. The case studies also highlight the system's ability to identify data anomalies and construct useful hierarchical models.

Critical weaknesses
  • Limited evidence for architectural novelty. Several components build upon existing LLM-based model discovery and agentic analysis techniques. The experiments do not sufficiently establish the advantages of the proposed two-agent architecture over a similarly equipped single-agent system.

  • Concerns about evaluation reliability. The posterior predictive implementation shown in Appendix A.5 appears to depend on observed outcomes when generating predictions. If this implementation is used for held-out evaluation, it could introduce information leakage and affect the reported results. Further clarification is needed.

Questions for authors
  1. In Appendix A.5, the generation of yrepy_{rep} depends on the observed value of yy. Is this implementation used to compute the held-out predictions reported in Table 3? If so, how is information leakage from the test observations prevented?

  2. Could the authors further explain the unique benefits of the Interactor–Modeler separation? In particular, how much of the improvement comes from the two-agent architecture rather than providing a general-purpose coding agent with executable data access and posterior diagnostics?

2 comments
AuthorsOpenReview ↗

Response to Reviewer S8XM (1/2)

We thank you for your helpful review and are glad that you found that our system demonstrates “the ability to identify meaningful data structures” and “competitive predictive performance.” We believe we have addressed your points with additional experiments and clarification.

  1. Advantages of AgentBayes vs similarly equipped general-purpose coding agent.

We have conducted new experiments to compare AgentBayes with a general-purpose coding agent, Codex, with access to the same machinery (stan, plotting, analysis environment) and underlying LLM (GPT 5.2). We show test-set predictions on the held-out Radon, Odorant, and Wingbeat datasets, which are the three largest datasets. As an additional method for quantifying the predictive distribution, we include the Continuous Ranked Probability Score (CRPS), a generalization of the mean absolute error. We find that Codex approximately matches Radon, but AgentBayes outperforms Codex on both of the more complex datasets: Odorant and the unpublished Wingbeat.

Table A. AgentBayes vs Codex, mean test set CRPS, NMSE

DatasetSystemnCRPS ↓NMSE ↓
RadonAgentBayes30.5110.697
RadonCodex30.5120.699
OdorantAgentBayes30.3530.406
OdorantCodex30.5070.593
WingbeatAgentBayes31.860.075
WingbeatCodex32.430.123

To help separate the contributions of the different roles of the Interactor, exploration and critique, we ran additional held-out ablations on Radon and Odorant. Removing the Interactor (proposer alone) degrades prediction on average on both datasets. Much of the benefit of the Interactor comes from exploring the data before modeling, as exploration alone can help match the full system performance. A system with the explorer ablated, but critic intact can reach full system performance on Radon but not on Odorant. Radon has a well-established hierarchical structure, and all interactive configurations converge to similar accuracy. Odorant is more complex and has no standard model, and interaction matters more there. We believe the benefit of interaction is problem-dependent and is largest when structure must be discovered from data.

Table B. Stage ablation (held-out test set), CRPS and NMSE

ConfigurationRadon nRadon CRPS ↓Radon NMSE ↓Odorant nOdorant CRPS ↓Odorant NMSE ↓
Full AgentBayes (explore + critique)30.5110.69730.3530.406
Explore only20.5110.69820.3320.418
Critique only20.5120.70320.4590.690
Proposer alone (no interaction)20.5230.73320.3960.538
  1. Evaluation reliability of A.5 and held-out evaluation.

We appreciate the identification that the A.5 example uses observed data for the generation of posterior predictive replicates. The y_rep as written affects the “0” observations in the internal agentic posterior predictive checking of the critiquing phase. This is a rare issue, where the LLM sometimes writes low quality posterior predictive replicates, and appears to occur in the most difficult models and datasets like Odorant. We have analyzed all AgentBayes selected models across the full data (Radon, Odorant, Wingbeat) runs with replicates, the train/test runs (Radon, Odorant, Wingbeat) with replicates, PosteriorDB (Eight Schools, Dugongs, Surgical, Peregrine) with replicates and find that only 1 out of 26 selected models exhibits such an observation leak. We clarify that this model was not used for the generation of Table 3, but was from the case study section, of how a scientist might apply AgentBayes (and use the entire dataset, as is common practice in Bayesian modeling). However, we will update Figure 3 to accurately represent the correct posterior. Visually, it remains almost identical. Table C shows the exact changes in the figure (next comment).

Table 3 is unaffected, Radon and Odorant saw no test set observations, and Wingbeat uses a standard time series predictive approach of rolling-one-step-ahead forecasting.

AuthorsOpenReview ↗

Response to Reviewer S8XM (2/2)

Table C. Figure 3 before and after correcting the A.5 y_rep

Panellog₁₀ conc.Old meanNew meanOld 90% bandNew 90% band
Non-responder−80.0000.002[0.00, 0.00][0.00, 0.00]
Non-responder−70.0000.005[0.00, 0.00][0.00, 0.00]
Non-responder−60.0000.012[0.00, 0.00][0.00, 0.00]
Non-responder−50.0000.026[0.00, 0.00][0.00, 0.00]
Non-responder−40.0000.044[0.00, 0.00][0.00, 0.15]
Responder−80.1020.102[0.03, 0.23][0.03, 0.24]
Responder−70.3310.330[0.13, 0.68][0.13, 0.67]
Responder−60.9341.042[0.41, 1.76][0.48, 1.93]
Responder−52.6782.673[1.38, 4.54][1.38, 4.57]
Responder−44.7154.709[2.65, 7.59][2.65, 7.58]
Saturator−80.0450.065[0.01, 0.13][0.01, 0.18]
Saturator−70.2760.385[0.06, 0.68][0.10, 0.88]
Saturator−61.8881.897[0.66, 3.91][0.66, 3.90]
Saturator−54.1464.151[1.83, 7.57][1.83, 7.63]
Saturator−45.0555.037[2.50, 8.59][2.50, 8.59]

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.