Verbalized Probabilistic Graphical Modeling with Large Language Models

Hengguan Huang, Xing Shen, Songtao Wang, Dianbo Liu, Hao Wang · OpenReview

Abstract

Faced with complex problems, the human brain demonstrates a remarkable capacity to transcend sensory input and form latent understandings of perceived world patterns. However, this cognitive capacity is not explicitly considered or encoded in current large language models (LLMs). As a result, LLMs often struggle to capture latent structures and model uncertainty in complex compositional reasoning tasks. This work introduces a novel Bayesian prompting approach that facilitates training-free Bayesian inference with LLMs by using a verbalized Probabilistic Graphical Model (PGM). While traditional Bayesian approaches typically depend on extensive data and predetermined mathematical structures for learning latent factors and dependencies, our approach efficiently reasons latent variables and their probabilistic dependencies by prompting LLMs to adhere to Bayesian principles. We evaluated our model on several compositional reasoning tasks, both close-ended and open-ended. Our results indicate that the model effectively enhances confidence elicitation and text generation quality, demonstrating its potential to improve AI language understanding systems, especially in modeling uncertainty.

Introduction

While Large Language Models (LLMs) have become impressive reasoners, they frequently suffer from a lack of self-awareness regarding their own knowledge gaps. In complex agentic workflows—where models must integrate tools, web search results, or visual inputs—they often fall victim to surface-level correlations. If a tool provides irrelevant or incorrect information, a standard LLM agent often incorporates it blindly, leading to overconfident and incorrect answers.

The core challenge is the absence of a principled framework for uncertainty quantification and latent variable modeling. Humans naturally form "mental models" of hidden structures; standard LLMs do not. This research introduces Verbalized Probabilistic Graphical Modeling (vPGM), a framework that allows LLM agents to explicitly model latent variables and uncertainty, effectively giving them a "Bayesian brain."

Methodology

The proposed framework operates through a two-tier approach that bridges natural language reasoning with numerical Bayesian rigor.

1. vPGM (Verbalized Probabilistic Graphical Modeling)

In this stage, the LLM performs Graphical Structure Discovery. It is prompted to identify "latent variables" (hidden factors) and their dependencies for a specific task. For instance, in a multi-modal science question, a latent variable might be the "relevance of a retrieved search result" or the "accuracy of an image caption." The LLM then simulates Bayesian reasoning in natural language, generating "verbalized posteriors" (e.g., "The probability that this caption accurately reflects the context is low: 0.2").

2. BayesVPGM (Numerical Extension)

To move beyond qualitative "vibes," the authors introduce a numerical layer. The LLM's verbalized probabilities are treated as samples, and a Dirichlet prior is applied. A novel Differentiable Calibration Loss optimizes a hyperparameter (λ) to align the model’s internal confidence with its empirical accuracy. This ensures that if the model expresses 90% confidence, it is statistically likely to be correct 90% of the time.

Comparison of a standard agent (Chameleon) versus BayesVPGM. While the standard agent is misled by a hallucinated image caption ("wii game controller"), BayesVPGM identifies the discrepancy through latent variable reasoning and reaches the correct answer.

Key Insights: Latent Variables as "Noise Detectors"

The most significant advantage of vPGM is its ability to act as a filter for misinformation. By making "Information Relevance" an explicit node in its internal graph, the agent can discount noisy tool outputs rather than being led astray by them. This allows the LLM to use its vast general knowledge to architect graph structures on the fly, bypassing the need for expert-designed mathematical models.

Experimental Results

The framework was evaluated across benchmarks including ScienceQA, ChatCoach (medical dialogue), and a "noisy" version of A-OKVQA.

Performance and Calibration

On the ScienceQA benchmark, the baseline agent (Chameleon) exhibited significant overconfidence with an Expected Calibration Error (ECE) of 9.62. BayesVPGM reduced this to 1.05, representing a near-perfect alignment between confidence and accuracy.

Quantitative results on ScienceQA. BayesVPGM (Ours) demonstrates superior calibration (lower ECE) and improved accuracy compared to standard Chain-of-Thought and agentic baselines.

Robustness to Misinformation

In experiments involving intentionally noisy data (shuffled rationales), BayesVPGM maintained higher accuracy and significantly lower ECE than standard baselines. It correctly identified mismatched or noisy data with 87% accuracy. Furthermore, in the ChatCoach task, vPGM outperformed state-of-the-art methods like Generalized Chain-of-Thought (GCoT) in detecting medical inaccuracies, proving its utility in high-stakes, open-ended domains.

Conclusion and Future Work

BayesVPGM demonstrates that verbalizing the Bayesian inference process can significantly improve an LLM's "honesty" and reasoning quality. While the approach currently faces some computational overhead due to multiple sampling and complex prompting, it provides a vital path forward for creating more reliable and self-aware AI systems. Future work will explore scaling these graphical models to higher levels of complexity and extending numerical rigor to purely generative, long-form text outputs.

Summary updated

BibTeX
@inproceedings{huang2026verbalized,
  author = {Hengguan Huang and Xing Shen and Songtao Wang and Dianbo Liu and Hao Wang},
  title = {{Verbalized Probabilistic Graphical Modeling with Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i26.39347},
}
Figure