Calibrating Large Language Models Using Their Generations Only

Dennis Ulmer, Martin Gubri, Hwaran Lee, Sangdoo Yun, Seong Joon Oh · DOI

Abstract

As Large Language Models (LLMs) are increasingly deployed in high-stakes domains such as medicine and law, the ability to quantify the reliability of their outputs becomes paramount. Traditional calibration techniques often rely on internal model states, such as token-level log-probabilities, which are frequently inaccessible in commercial "black-box" APIs. This paper discusses APRICOT (Auxiliary PRediction of COnfidence Targets), a novel framework designed to calibrate LLMs using only their textual inputs and outputs. By leveraging question clustering to generate stable confidence targets and training an auxiliary model to predict these targets, APRICOT significantly outperforms standard calibration methods, including verbalized uncertainty and sequence likelihoods, particularly in black-box settings.

Introduction

A well-calibrated model is one where the predicted confidence aligns with the actual probability of correctness. For instance, if a model expresses 80% confidence across a set of answers, it should be correct approximately 80% of the time. However, modern LLMs face two primary hurdles in achieving this: the "Black-Box Barrier," where internal probabilities are hidden by API providers, and the "Linguistic Failure," where models struggle to provide nuanced or accurate self-assessments through natural language (verbalized uncertainty).

To address these challenges, the APRICOT method treats calibration as a secondary supervised learning task, allowing for robust confidence estimation without requiring access to the target model's internal architecture.

The APRICOT Framework

APRICOT introduces a four-stage pipeline to build a "confidence meter" for any target LLM:

  1. Data Generation: A "Target LLM" (e.g., GPT-3.5 or Vicuna) is prompted with thousands of domain-specific questions. The resulting answers are recorded alongside the original queries.
  2. Clustering for Targets: Rather than using binary (0/1) correctness labels—which can be noisy and unstable for training—the researchers embed questions into a latent space using Sentence-BERT. These embeddings are grouped using HDBSCAN. For each cluster, the LLM’s average accuracy is calculated. This "cluster accuracy" serves as a fine-grained ground-truth confidence target.
  3. Auxiliary Model Training: A smaller, "white-box" model, specifically DeBERTaV3, is trained to act as an observer. It takes the question and the LLM’s generated answer as input and learns to predict the previously calculated cluster accuracy.
  4. Inference: During deployment, when the Target LLM generates a new response, the auxiliary model evaluates the Q&A pair to provide a calibrated confidence score.

The researchers also explored the inclusion of Chain-of-Thought (CoT) reasoning. By providing the auxiliary model with the LLM's intermediate reasoning steps, the system can better detect structural inconsistencies or logical leaps that signal a likely hallucination.

Experimental Setup

The method was evaluated on two distinct benchmarks:

  • TriviaQA: A large-scale dataset for closed-book question answering.
  • CoQA: A conversational question-answering dataset used in an open-book format, where models are provided with a reference passage.

The experiments compared APRICOT against traditional baselines, including sequence likelihoods (when available) and verbalized uncertainty (asking the model "How sure are you?").

Key Insights

The Power of Similarity

The core innovation of APRICOT is the realization that LLM performance is often consistent across similar topics. By clustering questions, the authors create a more stable training signal than binary labels, allowing the auxiliary model to learn the "texture" of topics where the target LLM is likely to fail.

The Observer Effect

An auxiliary model can often detect when a primary model is struggling simply by analyzing the phrasing of the question and the structure of the generated answer. This suggests that the linguistic patterns of a hallucination are often distinct enough for a secondary model to identify, even without access to an external knowledge base.

The Fragility of Self-Assessment

The study confirms that LLMs are notoriously poor at verbalizing their own uncertainty. High-performing models like GPT-3.5 often exhibit extreme overconfidence, frequently defaulting to high confidence scores (e.g., 95%) regardless of actual accuracy. This brittleness makes verbalization an unreliable metric for safety-critical applications.

Results

APRICOT demonstrated superior performance in both misprediction detection and calibration error:

  • Misprediction Detection: APRICOT achieved the highest AUROC (Area Under the Receiver Operating Characteristic curve) in nearly all test cases. For the Vicuna model on TriviaQA, it reached an AUROC of 0.83, significantly outperforming sequence likelihoods (0.79) and verbalized uncertainty (0.62).
  • Calibration Accuracy: The method consistently lowered the Brier score (a measure of the mean squared difference between predicted probability and the actual outcome). On GPT-3.5, APRICOT achieved a Brier score of 0.12, compared to 0.15 for standard sequence likelihoods.
  • Black-Box Efficacy: The results for GPT-3.5 prove that a reliable confidence score can be generated for API-based models without any knowledge of their internal log-probabilities.

Limitations and Future Directions

While promising, APRICOT has specific requirements and limitations:

  • Data Intensity: The clustering phase requires a substantial volume of initial Q&A pairs to establish accurate targets, which may be difficult to obtain in niche or low-resource domains.
  • Distributional Shift: The auxiliary model's reliability is tied to the training data; if a user’s questions deviate significantly from the training distribution, the confidence scores may become less accurate.
  • Task Scope: The current research focuses on Question Answering. Extending APRICOT to more subjective tasks, such as summarization or creative writing, remains a challenge for future study.

Future work may involve integrating conformal prediction to provide formal confidence intervals, offering even more robust safety guarantees for LLM deployment.

Summary updated

BibTeX
@inproceedings{ulmer2024calibrating,
  author = {Dennis Ulmer and Martin Gubri and Hwaran Lee and Sangdoo Yun and Seong Joon Oh},
  title = {{Calibrating Large Language Models Using Their Generations Only}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.824},
}
Figure