3D protein structure from sequence, with accuracy close to experimental in CASP14.
Jumper et al., Nature 2021
\gdef\R{\mathbb{R}} \gdef\E{\mathbb{E}} \gdef\N{\mathcal{N}} \gdef\prox{\operatorname{prox}} \gdef\argmin{\operatorname*{arg\,min}} \gdef\argmax{\operatorname*{arg\,max}} \gdef\cR#1{{\color{cc0000}#1}} \gdef\cB#1{{\color{1155cc}#1}} \gdef\cG#1{{\color{38761d}#1}}
\gdef\P{\mathbb{P}} \gdef\Ch{\hat C} \gdef\qh{\hat\lambda} \gdef\fh{\hat f} \gdef\MisCov{\operatorname{MisCov}} \gdef\Dcal{\mathcal{D}_{\mathrm{cal}}}
Conformal Prediction
How to build predictors with uncertainty
Jeremias Sulam
2nd Spring School of Deep Learning
ICC, CONICET–UBA · November 2026
3D protein structure from sequence, with accuracy close to experimental in CASP14.
Jumper et al., Nature 2021
Magnetic susceptibility tensors of the brain (MRI) reconstructed from fewer acquisition orientations.
DeepSTI: Fang et al., MedIA 2023
10-day weather forecasts, better than the ECMWF operational system on 90% of 1380 evaluated targets.
Lam et al., Science 2023
Language models answering 86.5% of medical exam questions correctly (MedQA).
Singhal et al., Nature Medicine 2025
Small perturbations in the measurements produce false structures (arrow) in deep-network reconstructions.
Univ. of Cambridge, May 12, 2020 · Antun et al., PNAS 2020
Commercial sepsis model: AUC 0.63 on external validation; it missed 67% of cases.
MedCity News, June 23, 2021 · Wong et al., JAMA Intern. Med. 2021
COVID-19 classifiers on chest X-rays use spurious signals and fail at new hospitals.
GeekWire, June 3, 2021 · DeGrave, Janizek & Lee, Nat. Mach. Intell. 2021
A legal brief cited six nonexistent court decisions generated by an LLM.
The New York Times, May 27, 2023 · Mata v. Avianca, S.D.N.Y. 2023
Predictors usually give us only a predicted value.
How can we attach a rigorous measure of uncertainty to these predictions?
Training data (X_i, Y_i)\sim P, \ i=1,\dots,n, and a loss \ell: \fh = \argmin_{f\in\mathcal F}\ \frac1n\sum_{i=1}^n \ell\big(f(X_i),Y_i\big) \quad\approx\quad f^\star=\argmin_f\ \E\big[\ell(f(X),Y)\big]
Regression: \ Y\in\R
f^\star(x)=\E[Y\mid X=x] squared loss \ \ell=(f(x)-y)^2
Classification: \ Y\in[K]
f^\star_k(x)=\P(Y=k\mid X=x) cross-entropy; \ \hat y(x)=\argmax_k \fh_k(x)
X = age and sex. \ Y = weight (kg).
Test error |y-\fh(x)|: on average 2.6 kg for ages 0–5 and 17 kg for ages 18–39.
The error depends on x. What is the uncertainty of each prediction?
[NHANES 2009–2012, n = 6,724; Pruim, 2015]
Q1: How do we build precise uncertainty intervals?
Q2: How does it generalize, and where is it used?
Around any predictor: C_\lambda(x) = \big[\fh(x)-\lambda,\ \fh(x)+\lambda\big]
How do we choose \lambda so that \quad \P\big[Y\in C_\lambda(X)\big]\ \ge\ 1-\alpha\ ?
How do we choose \lambda so that \quad \P\big[Y\in C_\lambda(X)\big]\ \ge\ 1-\alpha\ ?
Weight vs. age: test residuals are skewed and heavy-tailed (skewness 1.3, excess kurtosis 3.5).
None guarantees finite-sample 1-\alpha coverage without assumptions.
[Gal & Ghahramani, 2016][Lakshminarayanan et al, 2017]
How do we choose \lambda so that \quad \P\big[Y\in C_\lambda(X)\big]\ \ge\ 1-\alpha\ ?
Requirement: n labeled, “exchangeable” calibration data points.
Input: an already trained predictor \fh (trained on other data, or accessible only through an API) and n calibration data points (X_i,Y_i).
1. Compute the scores \ s_i = |Y_i-\fh(X_i)|, \ i=1,\dots,n.
2. \qh = empirical quantile of level \ \dfrac{\lceil (n+1)(1-\alpha)\rceil}{n}\ of \ s_1,\dots,s_n.
3. For a new x: \qquad \Ch(x)=C_{\qh}(x)=\big[\fh(x)-\qh,\ \fh(x)+\qh\big]
[Papadopoulos, Proedrou, Vovk & Gammerman, 2002]
How do we choose \lambda so that \quad \P\big[Y\in C_\lambda(X)\big]\ \ge\ 1-\alpha\ ?
1. Calibration scores
s_i=|Y_i-\fh(X_i)|,\ \ n=1681
→
2. Quantile of the scores
\qh=28.0 kg
→
3. Test intervals
\Ch(x)=\big[\fh(x)-\qh,\ \fh(x)+\qh\big]
Theorem [Vovk et al, 2005; Lei et al, 2018]
If (X_1,Y_1),\dots,(X_{n+1},Y_{n+1}) are exchangeable, then \P\big(Y_{n+1}\in\Ch(X_{n+1})\big)\ \ge\ 1-\alpha
The probability is over the calibration data and the test point (X_{n+1},Y_{n+1}).
Exchangeable: with Z_i=(X_i,Y_i), for every permutation \pi, (Z_1,\dots,Z_{n+1})\ \overset{d}{=}\ (Z_{\pi(1)},\dots,Z_{\pi(n+1)}). For example, i.i.d. data.
Let s_{n+1}=|Y_{n+1}-\fh(X_{n+1})| be the test score.
By exchangeability, the rank of s_{n+1} among s_1,\dots,s_{n+1} is uniform on \{1,\dots,n+1\}.
With k=\lceil (n+1)(1-\alpha)\rceil and \qh=s_{(k)} (the k-th smallest): \P\big(Y_{n+1}\in\Ch\big) = \P\big(s_{n+1}\le \qh\big) = \P\big(\text{rank}(s_{n+1}) \le k\big) = \tfrac{k}{n+1} \ge 1-\alpha \quad \square
The proof uses neither \fh nor the law of (X,Y): distribution free.
Coverage on the 1681 test people: 89.4%
\P\big(Y_{n+1}\in\Ch(X_{n+1})\big)\ \ge\ 1-\alpha
\{Y_{n+1}\in\Ch(X_{n+1})\} is a random event.
With the calibration fixed: \P\big(Y_{n+1}\in\Ch(X_{n+1})\mid\mathcal D_{\rm cal}\big)\ \sim\ \mathrm{Beta}(n+1-l,\ l) with l=\lfloor(n+1)\alpha\rfloor (scores without ties)
Summary (so far):
Citations per year on Google Scholar (2026: through Nov.).
US elections (2020–2024). On election night, The Washington Post publishes conformal intervals for the votes not yet counted.
Cherian, Bronner & Candès, 2024
COVID-19 deaths (CDC forecast). The official forecast (without conformal) publishes 80% intervals 4 weeks ahead; during the 2020–21 winter wave they covered 2 of 10 weeks. Corrected with online conformal: 7 of 10.
Angelopoulos, Candès & Tibshirani, 2023
Q1: How do we build precise uncertainty intervals?
Q2: How does it generalize, and where is it used?
Q2: How does it generalize, and where is it used?
\P\big(Y\in\Ch(X)\big)\ge 1-\alpha \qquad\not\Rightarrow\qquad \P\big(Y\in\Ch(X)\mid X=x\big)\ge 1-\alpha
Conformal is very flexible: any heuristic measure of uncertainty can be used as a score. For example:
Estimate the 5% and 95% quantiles of Y given X: regression with the pinball loss \ell_\tau,
\hat q_\tau=\arg\min_{q}\ \sum_{i}\ell_\tau\big(Y_i,\,q(X_i)\big)
[Romano, Patterson & Candès, 2019]
Score: signed distance to the interval s(x,y) = \max\big\{\hat q_{0.05}(x) - y,\ y-\hat q_{0.95}(x)\big\}
\Ch(x)=\big[\hat q_{0.05}(x)-\qh,\ \hat q_{0.95}(x)+\qh\big]
[Romano, Patterson & Candès, 2019]
Estimated quantiles: 81.3%. Conformalized (\qh=5.0 kg): 90.1%.
Q2: How does it generalize, and where is it used?
Now Y\in\{1,\dots,K\} is a label (ImageNet: K=1000 classes).
The model outputs probabilities \fh_1(x),\dots,\fh_K(x) (softmax) and the usual prediction is \ \arg\max_y \fh_y(x).
Conformal gives a set of labels \ \Ch(x)\subseteq\{1,\dots,K\}\ with \P\big(Y\in\Ch(X)\big)\ \ge\ 1-\alpha
1. Calibration scores s_i=1-\fh_{Y_i}(X_i)
→
2. Quantile of the scores \qh = quantile of level \tfrac{\lceil (n+1)(1-\alpha)\rceil}{n}
→
3. Test sets \Ch(x)=\big\{y:\ \fh_y(x)\ge 1-\qh\big\}
The only thing that changes is the score.
Theorem. [Vovk et al, 2005; Lei et al, 2018] If (X_1,Y_1),\dots,(X_{n+1},Y_{n+1}) are exchangeable, then \ \P\big(Y_{n+1}\in\Ch(X_{n+1})\big)\ge 1-\alpha.
Theorem. [Vovk et al, 2005; Lei et al, 2018] If (X_1,Y_1),\dots,(X_{n+1},Y_{n+1}) are exchangeable, then \ \P\big(Y_{n+1}\in\Ch(X_{n+1})\big)\ge 1-\alpha.
[Sadinle, Lei & Wasserman, 2019][Angelopoulos & Bates, 2023]
Q2: How does it generalize, and where is it used?
Conformal guarantees marginal coverage, not conditional coverage:
\P\big(Y\in\Ch(X)\big)\ge 1-\alpha \qquad\not\Rightarrow\qquad \P\big(Y\in\Ch(X)\mid X=x\big)\ge 1-\alpha
Without further assumptions, coverage conditional on X is “impossible”.
It is possible by groups.
[Vovk, 2012][Lei & Wasserman, 2014][Foygel Barber et al, 2021]
90% on average, but 12% of the classes fall below 80%.
1. Scores per class \{s_i:\ Y_i=y\} for each class y
→
2. One quantile per class \qh_y = quantile of level \tfrac{\lceil (n_y+1)(1-\alpha)\rceil}{n_y}
→
3. Test sets \Ch(x)=\big\{y:\ \fh_y(x)\ge 1-\qh_y\big\}
Theorem. [Vovk et al, 2005; Vovk, 2012] If the data are exchangeable, for each class y, \ \P\big(Y_{n+1}\in\Ch(X_{n+1})\mid Y_{n+1}=y\big)\ge 1-\alpha.
1. Scores per class \{s_i:\ Y_i=y\} for each class y
→
2. One quantile per class \qh_y = quantile of level \tfrac{\lceil (n_y+1)(1-\alpha)\rceil}{n_y}
→
3. Test sets \Ch(x)=\big\{y:\ \fh_y(x)\ge 1-\qh_y\big\}
More generally, with disjoint groups g(X,Y)\in\{1,\dots,G\} fixed in advance, and one \qh_g per group (exchangeable data), then:
\P\big(Y_{n+1}\in\Ch(X_{n+1})\ \big|\ g(X_{n+1},Y_{n+1})=g\big)\ \ge\ 1-\alpha \quad\text{for each } g
Examples: the class (g=y), age groups, demographic groups, hospital, scanner type.
[Vovk et al, 2005][Vovk, 2012]
All classes between 84% and 95%.
Price: larger sets.
[Ding, Angelopoulos, Bates, Jordan & Tibshirani, 2023]
Q2: How does it generalize, and where is it used?
Measurements
Reconstruction
X=AY+\epsilon,\ \ \epsilon\sim\mathcal N(0,\sigma^2\mathbb I)
\hat Y=f_\theta(X)\in\mathbb R^d
What does it mean to “cover” an image with d pixels?
\P\big(Y\notin C_{\qh}(X)\big)=\E\big[\mathbf 1\{Y\notin C_{\qh}(X)\}\big]\le\alpha
Split conformal controls the expected value of an indicator:
\P\big(Y\notin C_{\qh}(X)\big)=\E\big[\mathbf 1\{Y\notin C_{\qh}(X)\}\big]\le\alpha
Replace it with a loss \ L\big(C_\lambda(X),Y\big)\in[0,B], non-increasing in \lambda:
Y (ground truth)
X (measurement)
\hat l(X)-\qh
\hat u(X)+\qh
width
One data point = one image.
[Teneggi, Stayman & S., MICCAI 2025]
L\big(C_\lambda(X),Y\big): fraction of pixels of Y outside \big[\hat l_j-\lambda,\ \hat u_j+\lambda\big]
How do we choose \lambda so that \quad \E\big[L\big(C_{\qh}(X),Y\big)\big]\le\epsilon\ ?
\hat\lambda = \inf\Big\{\lambda:\ \hat R_n(\lambda)\le \epsilon-\tfrac{B-\epsilon}{n}\Big\}, \qquad \hat R_n(\lambda)=\frac1n\sum_{i=1}^n L_i(\lambda)
Theorem. If L_1,\dots,L_{n+1} are exchangeable, \quad \E\big[L_{n+1}(\hat\lambda)\big]\le\epsilon.
With high probability (RCPS): with L_i i.i.d. in [0,1], replace \hat R_n by an upper confidence bound, e.g. \ \hat R^+(\lambda)=\hat R_n(\lambda)+\sqrt{\log(1/\delta)/(2n)}, and choose \ \hat\lambda=\inf\{\lambda:\ \hat R^+(\lambda')<\epsilon\ \ \forall\lambda'\ge\lambda\}. Then
\P\big(R(\hat\lambda)\le\epsilon\big)\ge 1-\delta, \qquad R(\lambda)=\E\big[L_{n+1}(\lambda)\mid\text{calibration}\big]
Probability over the calibration data. Price: a correction \sim\sqrt{\log(1/\delta)/n} instead of B/n. [Bates, Angelopoulos, Lei, Malik & Jordan, 2021]
[Angelopoulos, Bates, Fisch, Lei & Schuster, 2024]
1. High dimension. A single \lambda for all d\approx 10^5 pixels widens them all equally: easy regions end up with needlessly wide bands.
2. Heterogeneity. Background, bone, liver, pancreas: the model error depends on the content, and the position of each organ changes from patient to patient.
One \lambda per type of content: one \lambda_k per organ.
A segmentation model s(X) assigns each pixel j to an organ k:
One \lambda_k per organ: \quad\big[\hat l_j(X)-\lambda_{s(X)_j},\ \hat u_j(X)+\lambda_{s(X)_j}\big]
L_k(\lambda) = fraction of pixels of organ k outside the band. Calibrate each \hat\lambda_k as before: \E\big[L_k(\hat\lambda)\big]\le\epsilon \quad\text{for each organ } k
[Teneggi, Stayman & S., MICCAI 2025]
Per-pixel width: more uncertainty in the aorta, pancreas, liver.
Risk by organ: only one \hat\lambda_k per organ (red) gives \le\epsilon in each.
[Teneggi, Stayman & S., MICCAI 2025]
Q2: How does it generalize, and where is it used?
Hourly bike rentals (Washington DC). At each hour t:
1. X_t arrives (hour, day, weather) and we publish \ C_t=\big[\hat Y_t-\tau_t,\ \hat Y_t+\tau_t\big]
2. Y_t is observed: we cover if \ S_t=|Y_t-\hat Y_t|\le\tau_t \qquad 3. we update \tau_{t+1}
Groups \ c_j(X)\in[0,1]: rush hour, night, weekend, rain; \ \ T_j=\sum_{t\le T}c_j(X_t)
Goal, for any sequence: \ \ \frac1T\sum_{t\le T}\mathbf 1\{S_t\le\tau_t\}\ \longrightarrow\ 1-\alpha
No assumptions on the data (exchangeability, independence, distribution).
Hourly bike rentals (Washington DC). At each hour t:
1. X_t arrives (hour, day, weather) and we publish \ C_t=\big[\hat Y_t-\tau_t,\ \hat Y_t+\tau_t\big]
2. Y_t is observed: we cover if \ S_t=|Y_t-\hat Y_t|\le\tau_t \qquad 3. we update \tau_{t+1}
Groups \ c_j(X)\in[0,1]: rush hour, night, weekend, rain; \ \ T_j=\sum_{t\le T}c_j(X_t)
Goal, for each group j: \ \ \frac{1}{T_j}\sum_{t\le T}c_j(X_t)\,\mathbf 1\{S_t\le\tau_t\}\ \longrightarrow\ 1-\alpha
No assumptions on the data (exchangeability, independence, distribution).
Trained in winter, and usage triples: ~90% per group,
POGO with no parameters to choose (“parameter-free”).
| method | coverage per group | mean width |
|---|---|---|
| ACI (one radius) | 75–100% | 583 |
| group ACI, \eta=1 | 85–96% | 450 |
| group ACI, \eta=10 | 90% | 458 |
| group ACI, \eta=100 | 90% | 498 |
| POGO (no \eta) | 88–92% | 445 |
March 2011 – December 2012; 5 groups (all, rush hour, night, weekend, rain). Width in bikes.
[Gibbs & Candès, 2021][Bharti, Pal, Teneggi & S., 2026]
To get started:
Angelopoulos & Bates, A Gentle Introduction to Conformal Prediction and Distribution-Free UQ, 2023
Angelopoulos, Barber & Bates, Theoretical Foundations of Conformal Prediction, 2024
Vovk, Gammerman & Shafer, Algorithmic Learning in a Random World, 2005
Thanks:
Jacopo Teneggi · Beepul Bharti · Ambar Pal
Funding: NSF CAREER CCF-2239787 · NIH R01CA287422
jsulam.github.io · jsulam1@jhu.edu