Conformal Risk Minimization with Variance Reduction

Sima Noorani, Orlando Romero, Nicolo Dal Fabbro, Hamed Hassani, George J. Pappas

TL;DR

Training models to directly produce smaller conformal prediction sets—known as Conformal Training (ConfTr)—often suffers from severe instability and failure to converge. This paper proves that ConfTr’s gradient estimator possesses non-vanishing, $\Omega(1)$ variance that fails to decrease with larger batch sizes due to differentiating directly through empirical sample quantiles. To solve this, the authors introduce VR-ConfTr, which decouples quantile estimation from quantile differentiation using an adaptive, sample-efficient gradient estimator, yielding faster convergence and tighter prediction sets.

What Problem Does This Paper Address?

Conformal Prediction (CP) equips machine learning models with rigorous uncertainty quantification by outputting prediction sets $C(X)$ that contain the true label with guaranteed probability (e.g., $1 - \alpha$). While CP is traditionally applied post-hoc to frozen models, recent research in Conformal Risk Minimization (CRM) seeks to optimize the model’s internal weights $\theta$ during training to minimize the expected size of these prediction sets (length efficiency).

The leading technique, ConfTr (Stutz et al., 2022), simulates CP inside the training loop by calculating empirical conformity score quantiles and differentiating through them. However, practitioners consistently observe that ConfTr is painfully unstable and struggles to converge. This paper investigates:

  1. What causes training instability in ConfTr?
  2. Can we design a provably sample-efficient gradient estimator with vanishing variance?

Methods

Theoretical Root Cause: Non-Diminishing Variance

Under the chain rule, differentiating the conformal risk requires computing the gradient of the quantile threshold $\tau(\theta)$ with respect to $\theta$: $$\frac{\partial}{\partial \theta} \ell(\theta, \hat{\tau}_n(\theta), Z) = \frac{\partial \ell}{\partial \theta} + \frac{\partial \ell}{\partial \tau} \frac{\partial \hat{\tau}_n}{\partial \theta}$$ The authors show that while the empirical quantile $\hat{\tau}_n(\theta)$ consistently estimates the population quantile $\tau(\theta)$, its direct gradient $\frac{\partial \hat{\tau}_n}{\partial \theta}(\theta)$ converges in distribution to $\left.\frac{\partial E}{\partial \theta}(\theta, Z)\right|_{E_\theta(Z)=\tau(\theta)}$. Because $Z = (X, Y)$ is high-dimensional, this gradient remains a non-degenerate random variable—its covariance does not vanish as $n \to \infty$, leaving an $\Omega(1)$ variance bottleneck in the loss gradient.

Proposed Solution: VR-ConfTr

The authors observe from Hong (2009) that the true population quantile gradient is a conditional expectation: $$\frac{\partial \tau}{\partial \theta}(\theta) = \mathbb{E}\left[\left.\frac{\partial E}{\partial \theta}(\theta, X, Y)\right| E_\theta(X, Y) = \tau(\theta)\right]$$ Instead of differentiating through the sample quantile, VR-ConfTr introduces a decoupled "plug-in" pipeline:

  1. $\varepsilon$-Threshold Estimator: Estimate $\frac{\partial \tau}{\partial \theta}(\theta)$ by averaging conformity score gradients over samples whose conformity scores fall within an $\varepsilon$-band around $\hat{\tau}(\theta)$. The estimator's variance decays as $\mathcal{O}\left(\frac{1}{p_\varepsilon(\theta) n}\right)$.
  2. Adaptive $m$-Ranking: Since a fixed scalar $\varepsilon$ varies unpredictably over training iterations, the authors fix an integer $m$, sort samples by distance $|E_\theta(X_i, Y_i) - \hat{\tau}(\theta)|$, and average the top $m$ closest conformity score gradients.
  3. Plug-In Step: Replace $\frac{\partial \hat{\tau}_n}{\partial \theta}$ in the generalized chain rule with this smoothed estimate, maintaining the exact same computational complexity as ConfTr.

Datasets

The authors benchmarked on both synthetic and real-world classification tasks:

  • Synthetic 2D Gaussian Mixture Model (GMM): Used to validate theoretical bias-variance trade-offs.
  • Vision Benchmarks: MNIST, Fashion-MNIST, Kuzushiji-MNIST (KMNIST), and CIFAR-10.
  • Biomedical Benchmark: OrganAMNIST (abdominal CT image slices).

No new datasets were introduced; standard benchmark splits and pre-processing protocols were followed.

Key Insights and Ideas

  • Quantile differentiation $\neq$ Quantile estimation: Differentiating a consistent empirical estimator does not yield a consistent estimator of the true gradient. ConfTr failed because the gradient of the $k$-th order statistic tracks only a single borderline sample's sensitivity, effectively ignoring sample size growth.
  • Averaging conditional sensitivities restores sample efficiency: Formulating the quantile derivative as a conditional expectation allows mini-batch averaging across $m$ near-threshold samples, re-establishing classical $1/n$ variance reduction.
  • The $m$-ranking heuristic sidesteps complex hyperparameter schedules: By setting $m$ (e.g., $m \in \{4, 6\}$) rather than a continuous metric threshold $\varepsilon$, the algorithm automatically adapts $\varepsilon$ across changing loss landscapes and parameter scales.

Key Results

Evaluated using the standard threshold (THR) conformal predictor post-training:

  • Smaller Prediction Sets: Across all datasets, VR-ConfTr achieved smaller prediction sets than both Baseline cross-entropy training and standard ConfTr at matching coverage guarantees ($\alpha = 0.01$ or $0.1$):
  • MNIST (Linear): Set size reduced to 3.688 (vs. 3.990 for ConfTr and 4.122 for Baseline; +8% improvement over ConfTr).
  • Fashion-MNIST (MLP): Set size reduced to 2.795 (vs. 3.048 for ConfTr; +9% improvement).
  • OrganA-MNIST (ResNet-18): Set size reduced to 4.776 (vs. 6.362 for ConfTr; a +33% improvement where standard ConfTr degraded catastrophically relative to baseline).
  • CIFAR-10 (ResNet-20 linear probing): Set size reduced to 2.508 (vs. 2.806 for ConfTr; +10% improvement).
  • Faster Convergence: On MNIST, VR-ConfTr achieved lower loss in $10\times$ fewer epochs than ConfTr; on Fashion-MNIST, it achieved targeted set size efficiency in one-third the epochs.

Limitations and Future Work

  • Bias-Variance Tuning: The number of neighborhood points $m$ introduces a trade-off: larger $m$ reduces variance but introduces bias towards the unconditional expectation $\mathbb{E}[\nabla_\theta E]$. Choosing $m$ currently relies on grid searches over a small set of candidate integers.
  • Continuous Score Requirement: The theoretical formulation assumes continuous probability density functions for scores and gradients, precluding tie-heavy discrete scores without tie-breaking perturbations.
  • Future Directions: Developing theoretical rules for dynamically scheduling $m$ during training, and extending this variance-reduced plug-in framework to other CRM settings such as graph neural networks, regression prediction bands, and conditional coverage constraints.

Summary updated

BibTeX
@inproceedings{noorani2025conformal,
  author = {Sima Noorani and Orlando Romero and Nicolo Dal Fabbro and Hamed Hassani and George J. Pappas},
  title = {{Conformal Risk Minimization with Variance Reduction}},
  booktitle = {R2-FM @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=y2hYL7y8T9},
}
Figure