SPUQ: Perturbation-Based Uncertainty Quantification for Large Language Models

Xiang Gao, Jiaxin Zhang, Lalla Mouatadid, Kamalika Das
3/4/2024
cs.CLcs.AI

No official code found. Best implementation: intuit-ai-research/SPUQ (17 stars, Apache-2.0, last commit 2024-06-24).

Abstract

In recent years, large language models (LLMs) have become increasingly prevalent, offering remarkable text generation capabilities. However, a pressing challenge is their tendency to make confidently wrong predictions, highlighting the critical need for uncertainty quantification (UQ) in LLMs. While previous works have mainly focused on addressing aleatoric uncertainty, the full spectrum of uncertainties, including epistemic, remains inadequately explored. Motivated by this gap, we introduce a novel UQ method, sampling with perturbation for UQ (SPUQ), designed to tackle both aleatoric and epistemic uncertainties. The method entails generating a set of perturbations for LLM inputs, sampling outputs for each perturbation, and incorporating an aggregation module that generalizes the sampling uncertainty approach for text generation tasks. Through extensive experiments on various datasets, we investigated different perturbation and aggregation techniques. Our findings show a substantial improvement in model uncertainty calibration, with a reduction in Expected Calibration Error (ECE) by 50\% on average. Our findings suggest that our proposed UQ method offers promising steps toward enhancing the reliability and trustworthiness of LLMs.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

SPUQ: Perturbation-Based Uncertainty Quantification for Large Language Models

174Python, Jupyter NotebookApr 29, 20242 years agoApache-2.0
confidence-scorelarge-language-modelsuncertainty-quantification

Similar Papers

Cite this paper

@article{gao2024spuq,
  title  = {SPUQ: Perturbation-Based Uncertainty Quantification for Large Language Models},
  author = {Xiang Gao and Jiaxin Zhang and Lalla Mouatadid and Kamalika Das},
  year   = {2024},
  eprint = {2403.02509},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.02509v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.02509.svg)](https://codeofpaper.com/paper/2403.02509)

Discussion