Abstract
Large Language Models (LLMs) are increasingly deployed in domains requiring probabilistic reasoning, yet their fundamental ability to model discrete distributions remains under-explored. This paper evaluates LLMs on tasks including mode identification, maximum likelihood estimation (MLE), and sample generation across joint and conditional distributions. Our findings reveal that while top-tier models exhibit strong generative intuition, they suffer from significant performance degradation when processing raw observations, struggle with conditional "slicing" of data, and show high sensitivity to label semantics.
Introduction
As LLMs are integrated into critical decision-making pipelines—from medical diagnostics to financial forecasting—understanding their capacity for probabilistic reasoning is paramount. While their logical and coding proficiencies are well-documented, their ability to interpret and manipulate the "math" of uncertainty remains a "black box." Most prior research focuses on Bayesian word problems; this study investigates a more foundational gap: can an LLM act as a statistical engine for discrete data? Specifically, given a set of observations, can it identify the mode, estimate underlying probabilities, or generate representative new samples?
Methodology
The authors developed a structured framework to probe LLMs across three core probabilistic tasks:
- Mode Identification: Identifying the most frequent outcome in a distribution.
- Maximum Likelihood Estimation (MLE): Predicting the exact probability of every possible outcome based on observed frequencies.
- Sample Generation: Producing a sequence of new samples that follow the provided distribution.
These tasks were evaluated in both Joint (analyzing the full dataset) and Conditional (analyzing a subset, e.g., $P(Y|X=A)$) settings. The study also compared two input formats: pre-calculated frequencies versus raw samples, the latter requiring the model to perform manual counting.
Experimental Setup
The evaluation utilized several datasets to test robustness:
- Synthetic Categorical Distributions: The primary benchmark, with joint space sizes (number of outcome combinations) ranging from 12 to 54.
- Mushroom Dataset: A real-world dataset characterized by highly skewed distributions.
- Label Sensitivity Tests: Abstract labels (e.g., A, B) were replaced with semantic categories (e.g., fruits, US states) to observe the impact of internal model biases.
Analysis of Probabilistic Capabilities
The "Counting" Tax and Context Length
A primary bottleneck identified is the LLM's inability to count accurately within long contexts. When provided with raw observations instead of frequencies, performance plummeted by over 60% as the number of samples increased. This suggests that the failure in probabilistic reasoning is often a failure of basic data processing rather than statistical logic.
The Conditional Reasoning Gap
Models that excelled at joint distribution analysis often failed when asked to "slice" data for conditional tasks. This indicates a significant difficulty in filtering and re-normalizing data on the fly, a core requirement for Bayesian inference.
Generative Intuition vs. Explicit Calculation
Interestingly, models like Llama 3.3-70B demonstrated a "generative intuition," where they were more capable of sampling from a distribution than calculating its exact MLE probabilities. However, statistical tests (Durbin-Watson) revealed that these generated samples often lacked true independence, frequently mirroring the ordering patterns found in the prompt.
Quantitative Results
Performance varied significantly with model scale. While smaller 8B models struggled, larger models like Llama 3.3-70B and GPT-4.1-mini achieved near-perfect accuracy on joint mode identification tasks.
The results in Figure 6 highlight the performance of various models on sampling tasks. Notably, GPT-4.1-mini maintains a consistently low Total Variation Distance across different joint space sizes, outperforming most other models in both joint and conditional sampling.
Conclusion and Future Work
This study highlights that while state-of-the-art LLMs possess surprising probabilistic intuition, they are hampered by counting errors, conditional reasoning gaps, and label sensitivity. The use of external tools, such as Python code interpreters, was shown to restore accuracy in raw-sample tasks to near 100%, suggesting that hybrid systems may be necessary for robust probabilistic applications. Future research should extend these evaluations to continuous distributions and more complex, high-dimensional state spaces.
Summary updated