cvs-health/uqlm
[JMLR 2026] "UQLM: A Python Package for Uncertainty Quantification in Large Language Models"
What it solves
UQLM is designed to detect hallucinations in Large Language Model (LLM) outputs by quantifying the uncertainty of the generated responses. It provides a standardized way to assign confidence scores (0 to 1) to LLM outputs, allowing users to identify potentially erroneous or unreliable information.
How it works
The library implements several categories of uncertainty quantification (UQ) techniques:
- Black-Box Scorers: Measure consistency across multiple generated responses to the same prompt without needing internal model access.
- White-Box Scorers: Use token probabilities from the model to estimate uncertainty; these are faster and cheaper but require access to the model's internal states.
- LLM-as-a-Judge: Employs one or more separate LLMs to evaluate the reliability of the original response.
- Ensemble Scorers: Combine multiple individual scorers using weighted averaging, which can be used off-the-shelf or tuned using ground-truth data.
- Long-Text Scorers: Break down long responses into individual claims or sentences and score each one, enabling the removal of low-confidence claims to refine the response.
- CodeGenUQ: A specialized interface for predicting the functional correctness of generated code without executing it.
Who it’s for
This tool is for developers and AI researchers who need to monitor and mitigate hallucinations in LLM applications, particularly those requiring high factual precision or those using LangChain chat models.
Highlights
- Broad Compatibility: Works with any LangChain Chat Model.
- Diverse Methodology: Supports a wide range of state-of-the-art techniques including Semantic Entropy and Semantic Density.
- Granular Control: Offers claim-level scoring for long-form text to enable automated response refinement.
- Flexible Trade-offs: Provides options ranging from zero-cost white-box scorers to high-accuracy ensemble and black-box methods.
Related
- Dispatch
- Project
- Project
- Project
- Project