Abstract
While Large Language Models (LLMs) have mastered many mathematical domains, they continue to struggle with probabilistic reasoning over natural language. This paper introduces the Bayesian Linguistic Inference Dataset (BLInD) and evaluates a neuro-symbolic approach to bridge this gap. By prompting LLMs to translate text into formal symbolic representations—such as Python code or ProbLog—researchers demonstrate that models like GPT-4 can achieve near-perfect accuracy on complex Bayesian inference tasks that previously caused them to fail.
Introduction: The Challenge of Bayesian Inference
Uncertainty is a fundamental part of human communication, yet LLMs frequently hallucinate or fail to apply the mathematical rules of probability (such as Bayes' Theorem) when values are embedded in text. Even state-of-the-art models that excel at standard math benchmarks like GSM8K struggle when asked to perform inference on a complex chain of events.
The challenge is two-fold: the model must first extract the variables and their dependencies (the "Bayesian Network") from the text, and then perform the correct multi-step calculations without losing track of the logic. As the number of variables increases, the performance of standard prompting methods typically drops to near zero.
Neuro-Symbolic Methods
The authors propose a neuro-symbolic approach that treats the LLM as a translator rather than a calculator. Instead of asking for a direct answer, the model is prompted to generate a formal intermediate representation that can be executed by an external tool. Three main strategies were explored:
- Program-aided Language Models (PAL): The LLM writes a Python script to perform direct arithmetic calculations.
- Monte Carlo Inference: The LLM generates a Python
simulate()function that uses direct sampling to estimate probability, providing more robustness for complex, interconnected networks. - Probabilistic Logical Solver (ProbLog): The LLM translates the problem into ProbLog, a specialized probabilistic logic programming language, offloading the entire mathematical burden to a dedicated solver.
Datasets and Evaluation
The study utilized two primary benchmarks:
- BLInD (Bayesian Linguistic Inference Dataset): A new dataset containing 900 instances with Bayesian Networks ranging from 2 to 10 variables.
- CLADDER (Adapted): An existing causal reasoning dataset adapted to test these methods on more "natural-sounding" templates, ensuring the findings were not artifacts of specific formatting.
Key Results and Insights
The performance gains using symbolic mapping are dramatic. On the BLInD dataset, GPT-4's accuracy soared from 14% using Basic QA to 98% using ProbLog. Similar improvements were seen in Llama3-70B (8% to 89%) and GPT-3.5 (7% to 62%).
Key insights from the research include:
- The "Calculator" Paradigm: LLMs are much better at being "translators" than "calculators." Their internal reasoning for probability is poor, but their ability to map natural language to code is excellent.
- Complexity Scaling: Symbolic methods maintain high accuracy regardless of network size, whereas standard Chain of Thought (COT) methods fail as complexity grows.
- Monte Carlo Robustness: For larger networks, generating a simulation is often more successful than writing a direct arithmetic script, as the simulation structure is easier for the LLM to generate consistently.
Limitations and Future Work
Despite these gains, limitations remain. The primary failure mode for smaller models is syntax sensitivity—errors in the generated code or ProbLog scripts ruin the entire computation. Additionally, as Bayesian Networks grow, the required code can hit context window limits. Future work will explore how these methods handle the messier, more ambiguous probabilistic information found in real-world communication.
Summary updated