From Prompts to Posteriors: Can LLM Agents Perform Bayesian Inference in Context?
Abstract
Large language models (LLMs) are increasingly applied across the scientific discovery pipeline, from synthesizing literature to generating hypotheses to informing experimental design. A unifying principle behind these tasks is the need to continuously update beliefs as evidence accumulates, for which Bayesian inference provides a natural framework. However, existing work assumes that LLMs cannot carry out principled Bayesian belief updating in context, instead relying on simplifications and heuristics. To challenge this assumption, we present a principled evaluation of Bayesian reasoning capabilities in LLMs, analyzing both the model's internal consistency as well as its ability to recover an externally determined posterior. Specifically, we build an evaluation framework spanning qualitative epistemological examples to probe probabilistic coherence, quantitative benchmarks of Bayesian inference capabilities, and analyses of the impact of non-Bayesian updates on downstream task performance. Across different scenarios, we find that LLMs generally violate Bayes' rule when updating their beliefs in context. However, when equipped with modern reasoning abilities and code execution capabilities, their performance drastically improves, enabling even the close approximation of analytically intractable posteriors. Our evaluation shows that current LLMs with access to appropriate tools could already be used to make complex belief updates in scientific discovery, enabling rapid acceleration of the efficiency and scale of AI-powered scientific discovery.
Create a lesson
Metadata
- Comments
- 10 pages, 6 figures in main text
Related papers
Emotion-Aware and Context-Grounded Dialogue Agents for Personalized Video Game Interactions
Shared title terminologycs.AIMichael Adjeisah, Jin Zhang, Pierluigi Vito Amadori et al.
Demystifying the Autoresearch Harness: How Context and Skills Shape Self-Evolving Agents
Shared title terminologycs.AIKelvin Kiu-Wai Tam, Newt Hue-Nam K. Nguyen, Tianshi Zheng et al.
Financial Context-Rich Strategy for Actor-Critic based Agents: A Deep Reinforcement Learning Approach for Stock Trading
Shared title terminologycs.AIHrishikesh Singh, Aarti Sharma, Millie Pant
Reproducible Evaluation as the Substrate for Safe Prompt Compression in Production Agents
Shared title terminologycs.AIPrabal Vashisht, Zheng Hu, Ying Yang
Fin-RSI: A Unified Library of Financial Skills, Checks, and Self-Improvement for LLM Agents
Shared title terminologycs.AIWanghao Ye, Shwai He, Sihan Chen et al.
Wactorz: Self-Writing LLM Agents That Discover, Repair, and Migrate at the Edge
Shared title terminologycs.AIPanagiotis Kasnesis, Lazaros Toumanidis, Amalia Contiero Syropoulou et al.