A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification

Anastasios N. Angelopoulos, Stephen Bates
7/15/2021
cs.LGcs.AImath.ST

Official code: aangelopoulos/conformal-prediction (1,091 stars, MIT, last commit 2025-11-14).

Abstract

Black-box machine learning models are now routinely used in high-risk settings, like medical diagnostics, which demand uncertainty quantification to avoid consequential model failures. Conformal prediction is a user-friendly paradigm for creating statistically rigorous uncertainty sets/intervals for the predictions of such models. Critically, the sets are valid in a distribution-free sense: they possess explicit, non-asymptotic guarantees even without distributional assumptions or model assumptions. One can use conformal prediction with any pre-trained model, such as a neural network, to produce sets that are guaranteed to contain the ground truth with a user-specified probability, such as 90%. It is easy-to-understand, easy-to-use, and general, applying naturally to problems arising in the fields of computer vision, natural language processing, deep reinforcement learning, and so on. This hands-on introduction is aimed to provide the reader a working understanding of conformal prediction and related distribution-free uncertainty quantification techniques with one self-contained document. We lead the reader through practical theory for and examples of conformal prediction and describe its extensions to complex machine learning tasks involving structured outputs, distribution shift, time-series, outliers, models that abstain, and more. Throughout, there are many explanatory illustrations, examples, and code samples in Python. With each code sample comes a Jupyter notebook implementing the method on a real-data example; the notebooks can be accessed and easily run using our codebase.

View on arXivView PDF

Code Implementations(1)

MIT

Lightweight, useful implementation of conformal prediction on real data.

1,091128MATLAB, PythonDec 25, 202111 months agoMIT
computer-visionconformalconformal-inferenceconformal-predictiondistribution-shift+6 more

Similar Papers

Cite this paper

@article{angelopoulos2021gentle,
  title  = {A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification},
  author = {Anastasios N. Angelopoulos and Stephen Bates},
  year   = {2021},
  eprint = {2107.07511},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.07511}
}

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/2107.07511.svg)](https://codeofpaper.com/paper/2107.07511)

Discussion