Conformal Prediction with Large Language Models for Multi-Choice Question Answering

Bhawesh Kumar, Charles Lu, Gauri Gupta, Anil Palepu, David Remy Bellamy, Ramesh Raskar, Andrew BeamWorkshops @ ICML 2023 · DOI

TL;DR

This paper introduces conformal prediction, a method for quantifying uncertainty in Large Language Models (LLMs) for multiple-choice question answering. They demonstrate that the uncertainty estimates from conformal prediction strongly correlate with prediction accuracy, enabling selective classification and filtering of low-quality outputs. This work is crucial for building more trustworthy LLMs in safety-critical applications.

What Problem Does This Paper Address?

Large Language Models (LLMs) are rapidly advancing, but their deployment in high-stakes domains like healthcare and law is hindered by concerns about reliability and trustworthiness. A key issue is the tendency of LLMs to "hallucinate" – generate factually incorrect information with high confidence. This can lead users to draw wrong conclusions, eroding trust in the system. Existing methods for quantifying uncertainty in LLMs are often model-specific or require costly retraining. This paper aims to address this by exploring a model-agnostic and statistically robust uncertainty quantification technique, conformal prediction, specifically for the task of multiple-choice question answering (MCQA).

Methods

The core of this paper is the application of conformal prediction to LLMs for MCQA. Conformal prediction is a distribution-free framework that provides statistically guaranteed error rates for predictions. Instead of outputting a single answer, it generates a "prediction set" that is guaranteed to contain the correct answer with a user-specified probability (e.g., 90%).

The authors adapt conformal prediction by:

  1. Framing MCQA as classification: Each answer choice is treated as a potential class.
  2. Using LLM logits: The LLaMA-13B model's raw output scores (logits) for each answer choice are used. These logits are then converted into probabilities using the softmax function.
  3. Calibrating prediction sets: A calibration set of data is used to estimate a threshold. This threshold determines the size of the prediction set, ensuring the desired coverage guarantee (e.g., 90% of the time, the correct answer will be within the prediction set).
  4. Investigating exchangeability: The paper also examines the crucial assumption of exchangeability in conformal prediction, particularly when models are calibrated on one domain and evaluated on another (out-of-subject questions).

Datasets

The primary dataset used in this research is MMLU (Massive Multitask Language Understanding). This benchmark comprises multiple-choice questions across 57 diverse domains. For their experiments, the authors selected a subset of 16 MMLU subjects, categorized into "business," "medicine," and "computer science." They also utilized GPT-4 generated questions as an alternative source for one-shot examples, finding them to be comparable in performance to MMLU-based questions while being shorter.

Key Insights and Ideas

  • Uncertainty as a proxy for accuracy: The most striking insight is the strong correlation between the uncertainty quantified by conformal prediction (measured by the size of the prediction set) and the model's actual prediction accuracy. This suggests that when the model is highly uncertain (larger prediction sets), it's more likely to be wrong.
  • Selective classification is viable: This correlation opens the door for "selective classification." LLMs can be used to answer questions they are confident about and flag questions where they are uncertain for human review, improving overall system reliability.
  • Exchangeability matters: The paper highlights that the exchangeability assumption, crucial for conformal prediction's guarantees, can be violated when calibrating on one subject and evaluating on another. This leads to deviations from the desired coverage, especially between dissimilar domains.
  • Naive softmax is "reasonably" calibrated: While not perfect, the raw softmax outputs of the LLaMA-13B model showed reasonable calibration on average across subjects, though with significant Maximum Calibration Error (MCE), indicating under- or over-confidence at specific confidence levels.

Key Results

  • Coverage Guarantee: Conformal prediction successfully achieved the desired coverage guarantee (e.g., 90% for $\alpha=0.1$) across all subjects when calibration and evaluation data were from the same domain.
  • Uncertainty-Accuracy Correlation: Figures 5 and 6 visually demonstrate a robust negative correlation between prediction set size (uncertainty) and top-1 accuracy. Subjects with lower accuracy generally had larger prediction sets.
  • Out-of-Subject Performance: When exchangeability was violated (calibrating on one subject, evaluating on another), coverage deviations were observed. For instance, calibrating on "high school computer science" and evaluating on "business ethics" resulted in coverage around 83%, below the target 90%. However, domains with similar accuracy and subject matter showed smaller deviations.
  • LLaMA-13B Performance: The LLaMA-13B model, when used with one-shot prompting, achieved comparable accuracy to GPT-4 on the MMLU benchmark.

Limitations and Future Work

  • Limited Scope: The current study is limited to the MCQA task and the LLaMA-13B model on the MMLU dataset.
  • Exchangeability Violations: The paper acknowledges that the exchangeability assumption can be violated in real-world scenarios where data distributions differ significantly.
  • Future Directions: The authors suggest extending this work to multiple models and datasets. They also propose exploring conformal prediction for more general tasks like free-form text generation to control for inaccurate, biased, or harmful outputs. Investigating exchangeability conditions further, especially for out-of-distribution data, is also a promising avenue.

Summary updated

BibTeX
@misc{kumar2023conformal,
  author = {Bhawesh Kumar and Charles Lu and Gauri Gupta and Anil Palepu and David Remy Bellamy and Ramesh Raskar and Andrew Beam},
  title = {{Conformal Prediction with Large Language Models for Multi-Choice Question Answering}},
  year = {2023},
  eprint = {2305.18404},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.18404},
}
Figure