Multicalibration for Confidence Scoring in LLMs

Gianluca Detommaso, Martin Bertran, Riccardo Fogliato, Aaron Roth

TL;DR

Standard calibration ensures a Large Language Model's (LLM) confidence scores are accurate on average, but fails when its performance varies wildly across different topics. This paper introduces multicalibration for LLMs, ensuring confidence scores are trustworthy simultaneously across multiple overlapping groups of prompts (e.g., by topic or difficulty). By introducing a new algorithm, Iterative Grouped Linear Binning (IGLB), the authors mitigate overfitting and deliver substantial improvements in both calibration error and downstream classification accuracy.

What Problem Does This Paper Address?

LLMs have a notorious tendency to fabricate information—a phenomenon known as "hallucination." To deploy these models safely in high-stakes domains, we need reliable confidence scores that tell us exactly how risky a given output is.

Traditional calibration methods ensure marginal calibration: if a model claims 80% confidence over a large dataset, it will be correct 80% of the time on average. However, this guarantee is too weak for LLMs because their performance is highly heterogeneous. A model might be 100% correct on simple geography trivia but only 60% correct on complex medical questions, yet still average out to an apparently "calibrated" 80% confidence score.

To solve this, the authors adapt multicalibration, a concept from the algorithmic fairness literature. Multicalibration demands that confidence scores remain accurate not just overall, but conditionally across many intersecting, non-disjoint groups of data simultaneously.

Methods

The core challenge of applying multicalibration to LLMs is the lack of explicit, pre-defined features (like demographic attributes in tabular data) to group the prompts. The authors propose two novel Grouping Strategies:

  1. Clustering: Generating semantic prompt embeddings using an off-the-shelf text encoder (UAE-Large-V1), reducing dimensions via UMAP, and clustering them using a Gaussian Mixture Model (GMM).
  2. Self-Annotation: Querying the LLM itself with binary yes/no questions about the prompt (e.g., "Does the following question require at least high school level knowledge?" or "Is the following prompt ambiguous?").

The IGLB Algorithm

Standard Iterative Grouped Histogram Binning (IGHB) updates model predictions by calculating label means on tiny, intersecting subsets of data, which quickly leads to severe overfitting. To remedy this, the authors introduce Iterative Grouped Linear Binning (IGLB), which incorporates three key improvements:

  • Cumulative Bins (Upper and Lower Sets): Instead of conditioning on exact probability bins ($f(x) = p$), the algorithm conditions on intervals ($f(x) \le p$ or $f(x) \ge p$). This ensures larger sample sizes per update step and drastically reduces variance.
  • Linear Scaling: Instead of applying a constant shift patch to a bin, IGLB applies a logistic regression patch (similar to Platt scaling) within the selected group.
  • Early Stopping: The algorithm splits the calibration data into calibration and validation sets, halting iterations when the Mean Squared Error (MSE) on the validation set stops decreasing.

Datasets

The authors evaluated their approach across a diverse suite of question-answering benchmarks using multiple state-of-the-art LLMs (including StableBeluga-13B, Flan-T5-base, Bloomz-7b1, and Mistral-7B-v0.1):

  • MMLU (Massive Multitask Language Understanding)
  • BigBench
  • OpenBookQA
  • TruthfulQA
  • MathQA
  • TriviaQA (processed into a multiple-choice format via LLM generations)

Key Insights and Ideas

  • Calibration Enhances Accuracy: A key property of multicalibration is that enforcing it is purely accuracy-enhancing. Minimizing calibration error across groups systematically drives down the overall Mean Squared Error (Brier score).
  • Fixing the Overfitting Trap: Vanilla multicalibration algorithms fall apart on text data because intersecting groups become too sparse. Shifting from probability density bins to cumulative distribution function (CDF) intervals provides the statistical power needed to make robust updates.
  • LLMs as Self-Categorizers: LLMs are remarkably adept at generating their own intersecting group features through binary self-annotation, creating easily interpretable categories that correlate strongly with their propensity to hallucinate.

Key Results

The proposed IGLB algorithm consistently outperformed uncalibrated scores and standard marginal calibration techniques (like Histogram Binning and Linear Scaling) across all datasets.

As shown in the cluster calibration curves, multicalibration methods align group accuracies tightly along the perfect diagonal:

Figure 2. Average scores against accuracies across various clusters, for each method, on MMLU for StableBeluga-13B. Colors represent the groups, and the size of the points reflects their size. Multicalibration methods exhibit significantly superior alignment with the diagonal compared to standard calibration methods. In agreement with the results in Table 2, IGLB and GCULR stand out as the top performers.
  • MSE Reduction: On the TruthfulQA dataset, IGLB reduced the uncalibrated MSE from 0.4762 down to 0.2016.
  • Accuracy Boost: By applying a standard threshold of $0.5$ to the calibrated probabilities, classification accuracy saw massive gains. For instance, on the MathQA dataset, binary accuracy jumped from an uncalibrated 31.31% to 77.79% post-calibration.
  • Group Calibration (gASCE): IGLB achieved the lowest group average squared calibration error across almost all MMLU topics, outperforming Group-Conditional Unbiased Logistic Regression (GCULR), which only guarantees group unbiasedness but not intra-group calibration.

Limitations and Future Work

  • In-Distribution Assumption: The provable guarantees of multicalibration only hold if the deployment prompts come from the same distribution as the calibration dataset. The authors explicitly note that these guarantees do not hold for adversarially generated prompts.
  • Computational Latency: The self-annotation strategy requires re-prompting the LLM with multiple yes/no questions at inference time, which increases computational overhead and deployment latency.
  • Future Directions: The authors highlight that designing more sophisticated, semantically meaningful grouping strategies remains an open and promising pathway to further push the boundaries of LLM reliability.

Summary updated

BibTeX
@inproceedings{detommaso2024multicalibration,
  author = {Gianluca Detommaso and Martin Bertran and Riccardo Fogliato and Aaron Roth},
  title = {{Multicalibration for Confidence Scoring in LLMs}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=6Wauue8pWd},
}
Figure