Large language model validity via enhanced conformal prediction methods

John Cherian, Isaac Gibbs, Emmanuel CandesNeurIPS 2024

Large Language Models (LLMs) are notorious for hallucinating facts. To safely deploy them in high-stakes domains like medicine or law, researchers have increasingly turned to conformal prediction—a statistical framework that provides mathematical guarantees on model outputs. Recent methods apply this by parsing an LLM's response into individual claims, scoring each claim's likelihood of being true, and filtering out low-scoring ones until the remaining text is guaranteed to be factual with high probability (e.g., 90%).

However, existing conformal filtering methods suffer from two major practical flaws:

  1. Guarantees are only "marginal": A 90% accuracy guarantee might hold on average across all prompts, but fail systematically on hard or rare topics. For instance, the filter might be 99% accurate on common trivia but only 50% accurate on niche medical questions.
  2. Low claim retention: Because LLM confidence scores are noisy, achieving a strict 90% guarantee often requires deleting almost the entire response. A highly factual output is useless if it has been censored down to a single sentence.

Proposed Methods: Adaptive Guarantees and Conditional Boosting

To make conformal filtering practical for LLMs, the authors propose two novel techniques:

1. Level-Adaptive Conformal Prediction: Instead of forcing a fixed 90% guarantee—which might require deleting the whole response—this method dynamically adapts the confidence level ($\alpha$) to the specific prompt. The goal is to preserve a target percentage of the original claims (e.g., 70%). The system then outputs a calibrated probability of correctness for that specific filtered text. For example, instead of returning a heavily censored text with a 90% guarantee, it returns a mostly intact text and honestly reports, "There is a 63% chance this contains zero errors."

2. Conditional Boosting: To improve how many claims survive the filter, the authors combine multiple heuristic LLM confidence scores into one optimal score. However, the conformal filtering threshold is determined by a complex quantile regression, which is normally non-differentiable. The authors introduce a novel algorithm that backpropagates through the conditional conformal procedure by exploiting the "optimal basis" of the underlying linear program. This allows them to use gradient descent to train a scoring function that explicitly maximizes claim retention.

Key Results and Insights

The authors evaluated their methods on two main benchmarks: MedLFQA (a compilation of medical datasets including HealthSearchQA, K-QA, LiveQA, and MedicationQA) and a dataset of Wikipedia Biographies generated by GPT-3.5-Turbo.

The results demonstrate significant improvements in both the utility and reliability of the filtered LLM outputs:

  • Massive Boost in Claim Retention: On the MedLFQA dataset, using "conditional boosting" to optimally combine four different LLM confidence scores increased the mean claim retention from 24% (baseline) to 39% at a fixed error rate. When combined with the level-adaptive method targeting 70% retention, the system successfully preserved the vast majority of useful information.
  • Accurate Adaptive Guarantees: The level-adaptive method successfully outputted calibrated probabilities. If the system claimed a filtered response had a 70-75% chance of being perfectly factual, empirical testing showed it actually was factual 70-75% of the time.
Calibration and Claim Retention Results
  • Robustness to Topic Obscurity: On the Wikipedia biographies dataset, the baseline marginal method severely under-covered (hallucinated more than guaranteed) on rare entities. The authors' conditional method maintained the exact target coverage across all popularity tiers, from top-tier celebrities to highly obscure individuals.

Limitations and Future Work

While these methods represent a significant leap forward—particularly the realization that one can differentiate through the conditional conformal algorithm's threshold—they are not without limitations.

First, the theoretical guarantees assume the prompt-response data is independent and identically distributed (i.i.d.). If user interactions shift over time (e.g., users start asking fundamentally different types of questions), the guarantees may degrade. Second, the conformal filter is ultimately a wrapper. If the underlying LLM confidence scores are completely uncorrelated with actual factuality, the method will just output vacuous guarantees (e.g., "I am 0% confident"). The system's success relies on the continued development of better hallucination-detection features.

Summary updated

BibTeX
@inproceedings{cherian2024large,
  author = {John Cherian and Isaac Gibbs and Emmanuel Candes},
  title = {{Large language model validity via enhanced conformal prediction methods}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=JD3NYpeQ3R},
}
Figure