Inv-Entropy: A Fully Probabilistic Framework for Uncertainty Quantification in Language Models

Haoyi Song, Ruihan Ji, Naichen Shi, Fan Lai, Raed Al Kontar

Introduction

Large Language Models (LLMs) have transformed natural language processing, yet they remain prone to "hallucinations"—generating factually incorrect information with high confidence. To deploy these models in critical domains, we must be able to quantify their uncertainty accurately. Traditional methods often fail because they either rely on internal model probabilities (unavailable in black-box models like GPT-4) or simple response replication, which can be misled by a model that is "confidently wrong."

The Challenge of Hallucination

Current Uncertainty Quantification (UQ) methods face three primary hurdles. First, many are heuristic rather than grounded in probability theory. Second, the "Black-Box Problem" prevents access to token-level log-likelihoods. Finally, the "Replication Trap" occurs when a model consistently provides the same incorrect answer to the same prompt, appearing certain when it is actually brittle.

LLM inconsistency under semantic perturbation.

As shown in Figure 1, an LLM might answer a question correctly in one phrasing but fail completely when the question is slightly perturbed. This sensitivity suggests that true uncertainty is found not just in the variety of answers, but in how the model reacts to semantic shifts in the input.

The Inv-Entropy Framework

The researchers propose Inv-Entropy, a framework built on dual random walks and an "inverse perspective." Instead of asking "Given this input, how many different outputs do I get?", Inv-Entropy asks: "Given this output, how diverse is the set of inputs that could have produced it?"

This approach models inputs and outputs as separate Markov chains. By defining transition probabilities based on semantic similarity, the framework captures the semantic asymmetry of LLMs. Ideally, a stable model should produce the same answer for a wide variety of semantically equivalent prompts.

GAAP: Probing with Genetic Algorithms

To effectively probe the model's stability, the authors developed the Genetic Algorithm-based Adversarial Perturbation (GAAP). Unlike simple paraphrasing, GAAP uses an evolutionary approach to generate a diverse population of semantically equivalent prompts.

The Genetic Algorithm-based Adversarial Perturbation (GAAP) process.

As illustrated in Figure 6, GAAP initializes with a prompt and iteratively evolves it through:

  • Sampling: Identifying key terms for replacement.
  • Crossover: Swapping segments between different prompt versions.
  • Mutation: Replacing words with synonyms, hyponyms, or hypernyms.

This rigorous process ensures that the resulting perturbations are semantically identical to the original question but linguistically diverse enough to challenge the model's internal consistency.

Evaluation and Results

The framework was tested across five benchmarks (TriviaQA, Natural Questions, SciQ, MMLU, and GSM8K) using models like GPT-3.5-Turbo and LLaMA-3.1-8B.

Key Performance Metrics

  • State-of-the-Art Accuracy: Inv-Entropy achieved significantly higher AUROC (Area Under the Receiver Operating Characteristic) scores than existing methods. On the MMLU dataset, it reached an AUROC of 0.780, compared to approximately 0.65 for standard Semantic Entropy.
  • Temperature Sensitivity of Uncertainty (TSU): The authors introduced TSU, a novel metric that evaluates UQ methods without needing ground-truth labels. It measures how consistently a UQ score increases as the model's "temperature" (randomness) rises.
  • Efficiency: Despite its mathematical depth, Inv-Entropy is computationally efficient during post-processing, requiring significantly less GPU memory than competing methods (86MB vs. 3575MB for Semantic Entropy).

Conclusion

Inv-Entropy represents a shift toward a more robust, theoretically grounded approach to LLM uncertainty. By flipping the perspective from output diversity to input sensitivity and utilizing genetic algorithms for perturbation, it provides a clearer signal of when a model is hallucinating. While the computational cost of multiple API calls remains a challenge, future work on adaptive perturbation strategies promises to make this high-precision UQ framework more accessible for real-time applications.

Summary updated

BibTeX
@inproceedings{song2025inv,
  author = {Haoyi Song and Ruihan Ji and Naichen Shi and Fan Lai and Raed Al Kontar},
  title = {{Inv-Entropy: A Fully Probabilistic Framework for Uncertainty Quantification in Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=KMbl8lg5Rv},
}
Figure