Skip to main content
Ensuring reliable, accurate LLM responses is a core challenge in production AI. In high-stakes domains, hallucinations can be costly, and teams need a model-agnostic way to quantify uncertainty and triage risky answers. UQLM (Uncertainty Quantification for Language Models), developed by CVS Health, estimates the trustworthiness of an LLM response using SOTA black-box (consistency across sampled answers) and white-box (token-level logprobs) signals based on the latest research. It computes generation-time, response-level confidence scores in [0,1], helping you flag ambiguous, contradictory, or unreliable outputs. This guide shows how to integrate UQLM with Phoenix to systematically identify and improve low-quality LLM responses. By leveraging UQLM for automated uncertainty scoring and Phoenix for tracing, slicing, and visualization, you can build more robust and trustworthy AI applications.  Specifically, this tutorial covers:
  • Evaluating LLM responses for trustworthiness with UQLM (BlackBox & WhiteBox).
  • Scoring and flagging high-risk outputs using confidence and risk thresholds.
  • Tracing and visualizing UQLM evaluations in Phoenix (distributions, filters, span details).
More information about UQLM can be found in this paper. We will walk through the key steps in the documentation below. Check out the full tutorial here:

UQLM_Phoenix_Confidence_Example.ipynb

Key Implementation Steps for generating evals w/ UQLM

  1. Install Dependencies, Set up API Keys
  2. Create your Dataset
  3. Define your Task & run an experiment
  4. Manipulate your DataFrame to set up for definind UQLM
  5. Define UQLM adapter
  6. Run BlackBoxUQ scoring
That’s it! Congratulations, you have sucessfully run the Uncertainty Quantification for Language Models eval. Take it a step further by following the steps below.
  1. Generate-and-score with your LLM client
  1. WhiteBox scoring (token-level logprobs)