This paper, "Efficient and Differentiable Conformal Prediction with General Function Classes," presents a significant step forward in making uncertainty quantification both more flexible and more efficient. By bridging the gap between the rigorous guarantees of conformal prediction and the power of modern gradient-based optimization, the authors provide a framework for learning prediction sets that are as small as possible without sacrificing reliability.
TL;DR
The authors introduce CP-Gen, a framework that generalizes conformal prediction from tuning a single parameter to optimizing complex, multi-parameter function classes. By using differentiable surrogate losses and a Lagrangian formulation, CP-Gen allows researchers to directly minimize prediction set size (efficiency) while maintaining rigorous, distribution-free coverage guarantees.
What Problem Does This Paper Address?
In many critical machine learning applications, a point prediction isn't enough; we need a prediction set that contains the true label with high probability (e.g., 90%). Conformal Prediction (CP) is the gold standard for this because it provides "valid coverage" guarantees regardless of the underlying data distribution.
However, standard CP has a major limitation: it is usually "passive." It typically takes a pre-trained model, calculates a "non-conformity score," and then finds a single global threshold to form the set. This doesn't allow for optimizing the efficiency of the sets—making them as small or "tight" as possible. For instance, in regression, we want the shortest possible intervals. Existing methods often rely on manual trial-and-error or specific architectural tricks to improve efficiency. There hasn't been a unified, principled way to optimize any efficiency metric over any class of prediction sets.
Methods
The authors re-frame the conformalization step as a constrained Empirical Risk Minimization (ERM) problem: minimize the expected size of the prediction set subject to a coverage constraint.
- CP-Gen Framework: Instead of a single threshold $t$, they consider a function class $C_{\theta,t}$ with multiple learnable parameters $\theta$.
- Differentiable Optimization: The coverage constraint involves a zero-one loss (did the set cover the label or not?), which is non-differentiable and has zero gradients almost everywhere. To solve this, the authors replace the zero-one loss with a differentiable hinge loss surrogate.
- Lagrangian Formulation: They solve the resulting constrained problem using a primal-dual approach, optimizing the parameters $(\theta, t)$ and a penalty multiplier $\lambda$ via Stochastic Gradient Descent-Ascent (SGDA).
- CP-Gen-Recal: Because the differentiable surrogate is an approximation, the authors introduce a practical variant that includes a final re-conformalization step on a held-out "recalibration" dataset. This ensures that the final model achieves exact finite-sample coverage guarantees, even if the optimization was performed on an approximation.
Datasets
The authors evaluated their approach across three distinct domains:
- Regression: 9 real-world datasets (e.g., MEPS, Facebook, BlogData) focusing on minimizing interval length.
- Multi-output Regression: Next-state prediction tasks for Reinforcement Learning environments (Cartpole, Ant, Humanoid, etc.) from the D4RL benchmark, focusing on minimizing the volume of box-shaped prediction sets.
- Image Classification: ImageNet-Val and ImageNet-V2, focusing on minimizing the cardinality (number of labels) in the prediction sets by learning optimal ensemble weights for 9 pre-trained models.
Key Insights and Ideas
- Conformal Prediction is ERM: The "aha moment" is realizing that vanilla conformal prediction is just a special case of constrained ERM with one parameter. This insight allows the application of standard learning theory and optimization tools to the field of conformal prediction.
- Pushing the Efficiency Frontier: As shown in Figure 1, standard CP is restricted to a single curve on the coverage-vs-efficiency plot. By introducing more parameters, CP-Gen explores a much larger region, allowing it to "push" the frontier toward better efficiency for the same level of coverage.
- Surrogates + Recalibration = Best of Both Worlds: The combination of differentiable surrogates (for efficient search) and a final recalibration step (for rigorous guarantees) provides a robust path for fine-tuning uncertainty estimates in deep learning.
Key Results
- Shorter Intervals: In regression tasks, CP-Gen-Recal systematically outperformed the popular Conformalized Quantile Regression (CQR) baseline, reducing interval lengths across all 9 datasets while maintaining the target 90% coverage.
- Smaller Volumes: For multi-output regression, CP-Gen achieved significantly smaller volumes than coordinate-wise conformalization. On the 'Ant' task, for example, the volume was reduced by more than 50% compared to the baseline.
- Better Ensembles: On ImageNet, by learning optimal weights to ensemble multiple models, CP-Gen produced smaller label sets than either the best single model or a simple uniform ensemble.
Limitations and Future Work
- Computational Overhead: Solving the min-max Lagrangian problem is more computationally intensive than the simple quantile calculation used in vanilla CP.
- Conditional Coverage Trade-offs: The authors noted that while marginal coverage is guaranteed, optimizing for global efficiency can sometimes lead to worse conditional coverage (e.g., the model might under-cover certain specific types of inputs while over-covering others to meet the global average).
- Surrogate Gap: While the hinge loss works well in practice, there is still a theoretical gap between the surrogate and the true coverage loss that could be further explored.
Future work could involve applying this framework to more complex structured prediction tasks or developing more sophisticated differentiable surrogates tailored to specific efficiency metrics.
Summary updated