Bayesian Teaching Enables Probabilistic Reasoning in Large Language Models

Linlu Qiu, Fei Sha, Kelsey Allen, Yoon Kim, Tal Linzen, Sjoerd van Steenkiste · DOI

TL;DR

Large Language Models (LLMs) are notoriously bad at systematically updating their beliefs over multiple interactions, often plateauing after a single piece of feedback. By fine-tuning LLMs to mimic the predictions of a mathematically optimal "Bayesian Assistant"—a method the authors call Bayesian teaching—researchers significantly improved the models' ability to reason under uncertainty and generalize these skills to entirely new domains like web shopping.

What Problem Does This Paper Address?

For an AI agent to be truly useful, it needs a "world model"—a way to represent the environment and the people it interacts with. Crucially, these models must be probabilistic; because we rarely have perfect information, an agent must maintain a distribution of possibilities and update them as new evidence arrives.

The gold standard for this process is Bayesian inference. However, current LLMs struggle with this. While they are excellent at one-shot tasks, they often fail to refine their understanding of a user’s hidden preferences over a series of interactions. As shown in the paper, off-the-shelf models frequently hit a performance ceiling almost immediately, failing to "learn" from subsequent rounds of dialogue.

Methods

The researchers introduced a framework to evaluate and then "teach" LLMs how to be better Bayesians:

  1. The Task: A flight recommendation game where an assistant must infer a user's hidden preferences (e.g., "prefers short flights," "hates stops") by observing their choices over five rounds.
  2. The Teacher: They built a Bayesian Assistant that performs exact Bayesian updates. It maintains a probability distribution over all possible user preference profiles and updates that distribution using Bayes' rule after every interaction.
  3. Bayesian Teaching: Instead of fine-tuning the LLM on the "correct" user choice (Oracle teaching), they fine-tuned it to mimic the predictions of the Bayesian Assistant. This means the LLM learns from the teacher's "educated guesses" and how those guesses evolve as uncertainty decreases.
  4. Models: They tested a variety of models, including Gemma 2, Llama 3, Qwen 2.5, GPT-4.1 Mini, and Gemini 1.5 Pro.

Datasets

  • Flight Recommendation: A synthetic dataset where flights are defined by four features (duration, stops, price, etc.).
  • Hotel Recommendation: A transfer task with similar logic but different features (distance to downtown, rating).
  • WebShop: A complex, real-world benchmark involving thousands of products and natural language descriptions. This served as a "stress test" for generalization.
  • Human Interactions: The authors recruited 500 human participants to act as users, providing a "noisy" real-world evaluation set.

Key Insights and Ideas

  • Educated Mistakes are Better Teachers: Surprisingly, training an LLM on the Bayesian Assistant's predictions (which include mistakes made under high uncertainty) was more effective than training it on the ground-truth "Oracle" answers. Mimicking the process of reasoning under uncertainty provided a stronger learning signal than just seeing the final answer.
  • Neural Robustness vs. Symbolic Rigidity: While the symbolic Bayesian Assistant was the "perfect" reasoner for simulated users, the Bayesian-tuned LLMs actually outperformed it when interacting with real humans. Humans are often inconsistent; LLMs, having learned a "fuzzy" approximation of Bayesian logic, proved more robust to this human "noise" than the rigid symbolic model.
  • Generalization is Possible: Probabilistic reasoning isn't just a task-specific trick. Models taught to be Bayesian on simple flight data showed marked improvements on the much more complex WebShop task, suggesting they acquired a transferable reasoning skill.
Figure 3: Bayesian teaching significantly outperforms both the original models and those trained on ground-truth "Oracle" data.

Key Results

  • Performance Jumps: Off-the-shelf models like Gemma 2 9B started with ~37% accuracy and showed zero improvement over five rounds. After Bayesian teaching, accuracy jumped to 76% by the final round.
  • Closing the Gap: The fine-tuned models achieved roughly 80% agreement with the optimal Bayesian strategy, a massive increase from the ~40% baseline.
Figure 4: Fine-tuned LLMs align much more closely with the normative Bayesian strategy over multiple interactions.
  • Domain Transfer: In the WebShop task, models fine-tuned on the synthetic flight task outperformed the original models by a wide margin, proving that the "Bayesian" behavior wasn't just memorization.
Figure 5: The reasoning skills acquired through Bayesian teaching generalize to entirely different domains like Hotel Recommendation and Web Shopping.

Limitations and Future Work

  • Model Scale: Due to compute constraints, the authors only fine-tuned medium-sized models (up to 9B parameters). It remains to be seen if massive models (100B+) show the same plateauing behavior or if they can be "taught" even more effectively.
  • Discrete vs. Continuous: The synthetic tasks used discrete feature values. Real-world preferences are often continuous and multi-modal, which would require more complex Bayesian teachers.
  • Interpretability: While the models act like Bayesians, we don't yet know if they are building internal representations of probability distributions. The authors suggest "circuit analysis" as a promising future direction to peek under the hood.
  • Reasoning-in-Words: Future work could explore whether new "reasoning" models (like DeepSeek-R1) can perform this belief updating through explicit Chain-of-Thought without needing specific fine-tuning.

Summary updated

BibTeX
@inproceedings{qiu2026bayesian,
  author = {Linlu Qiu and Fei Sha and Kelsey Allen and Yoon Kim and Tal Linzen and Sjoerd van Steenkiste},
  title = {{Bayesian Teaching Enables Probabilistic Reasoning in Large Language Models}},
  booktitle = {Nature Communications},
  year = {2026},
  doi = {10.1038/s41467-025-67998-6},
}
Figure