Introduction
Large Language Models (LLMs) have demonstrated remarkable capabilities across diverse domains, yet they remain prone to overconfidence and hallucinations. As these models are increasingly integrated into high-stakes environments such as healthcare, law, and software engineering, the ability to quantify the uncertainty of their outputs—knowing when to trust a model—becomes paramount. This paper formalizes and validates the Consistency Hypothesis: the principle that if a model generates semantically similar answers across multiple independent attempts, those answers are significantly more likely to be correct.
The Challenge of Black-Box Uncertainty Quantification
Traditional "white-box" methods for Uncertainty Quantification (UQ) rely on internal model states, such as token-level probabilities or hidden layer activations. However, as the industry shifts toward proprietary, API-based models (e.g., GPT-4, Claude), these internal metrics are often inaccessible. This necessitates "black-box" UQ methods that rely solely on the generated text.
While many researchers have intuitively used "generation consistency" as a proxy for confidence, this assumption has lacked a formal mathematical framework and large-scale empirical validation. This research bridges that gap by providing a rigorous statistical foundation for the relationship between consistency and correctness.
Formalizing the Consistency Hypothesis
The authors decompose the intuition of consistency into three distinct mathematical hypotheses:
- Sim-Correct (Hypothesis #2): A correct generation exhibits higher average similarity to other correct generations than an incorrect generation does.
- Sim-Separate (Hypothesis #3): Correct generations are more similar to each other than incorrect generations are to one another.
- Sim-Any (Hypothesis #1): A correct generation is more similar to any other generation (regardless of its correctness) than an incorrect one is.
Of these, Sim-Any is identified as the most "actionable" for real-world applications. Because the ground truth is unknown at inference time, Sim-Any allows practitioners to estimate confidence by simply measuring how much a single output resembles its "peers" in a sample set.
Methodology and Statistical Framework
To validate these hypotheses, the authors developed a statistical procedure (Algorithm 1) utilizing t-tests to determine the significance of similarity differences across various datasets. A key innovation in their approach is the exploration of similarity aggregation. Rather than relying solely on the arithmetic mean, the authors investigated geometric and harmonic means. These "conservative" aggregators are more sensitive to outliers and disagreements among samples, making them more effective at flagging potential hallucinations or low-confidence outputs.
Experimental Setup
The study's breadth is a significant contribution, covering 8 benchmark datasets across three distinct task categories:
- Question Answering (QA): CoQA, TriviaQA, and Natural Questions (NQ).
- Text Summarization: CNN/DailyMail and XSum.
- Text-to-SQL: Spider, Spider-Realistic, and BIRD.
The hypotheses were tested against a diverse suite of state-of-the-art models, including Granite 13B, LLaMA 2/3, Mistral 8x7B, and CodeLlama 34B.
Key Insights
Semantic Clustering
Through t-SNE projections, the researchers visualized the "semantic space" of model outputs. They observed that correct answers tend to form tight, dense clusters. In contrast, incorrect answers often appear as scattered outliers or form loose, disparate groups. This visual evidence reinforces the idea that there are many ways to be wrong, but "truth" in a model's latent space often converges.
Task Sensitivity
The Consistency Hypothesis holds most strongly in tasks with constrained output spaces, such as QA and Text-to-SQL. In Text Summarization, the signal is slightly weaker. This is attributed to the inherent linguistic diversity of summaries; multiple "correct" summaries can be semantically similar but structurally different, which naturally lowers similarity scores and introduces noise into the UQ signal.
Performance Gains
The proposed black-box UQ methods consistently outperformed standard baselines. For example, on the TriviaQA dataset, using a geometric mean aggregation method achieved an AUROC of 0.80. This is a marked improvement over the common baseline of averaging token probabilities (avg. prob), which achieved only 0.74.
Limitations and Future Directions
While powerful, the consistency-based approach has a notable computational cost. Calculating consistency requires generating multiple samples (the authors utilized 30 per query), which increases latency and API costs compared to a single generation. Furthermore, the strength of the UQ signal is dependent on the choice of similarity metric (e.g., Jaccard, SBERT, or ROUGE).
Future research will likely focus on optimizing the number of required samples to reduce overhead and developing more sophisticated similarity metrics for complex, multi-step reasoning tasks where simple semantic overlap may not suffice.
Conclusion
By formalizing the Consistency Hypothesis, this work provides a robust framework for black-box Uncertainty Quantification. The finding that Sim-Any serves as a reliable proxy for correctness allows for the implementation of safer LLM systems, even when internal model weights remain hidden.
Summary updated