TL;DR
Conformal prediction provides rigorous uncertainty quantification, but often produces prediction sets that are unnecessarily large or fail to hold across specific data subpopulations. This paper introduces Conformal Prediction with Length-Optimization (CPL), a framework that minimizes the average size of prediction sets while guaranteeing conditional coverage validity under various covariate shifts. CPL achieves state-of-the-art length efficiency across classification, regression, and LLM question-answering tasks without sacrificing statistical guarantees.
What Problem Does This Paper Address?
Conformal Prediction (CP) is a popular framework for generating prediction sets with a guaranteed coverage probability (e.g., a 90% chance of containing the true label). However, standard CP faces two main practical challenges: conditional validity and length inefficiency.
Marginal coverage guarantees only hold on average across an entire dataset. This means a model might severely under-cover specific subgroups (e.g., certain demographic groups or high-variance regions of the input space) while over-covering others. While recent methods offer relaxations of full conditional coverage to fix this, they often result in excessively large, uninformative prediction sets. This paper addresses the fundamental tension between keeping prediction sets small (length efficiency) and ensuring they remain valid across different subpopulations (conditional validity).
Methods
The authors propose Conformal Prediction with Length-Optimization (CPL). Instead of using a fixed global threshold on conformity scores, CPL optimizes a covariate-adaptive threshold function $h(x)$ to directly minimize the expected prediction set size.
The pipeline operates at the final stage of the standard CP workflow:
The core formulation is a foundational minimax optimization problem: the outer minimization navigates the space of conditionally valid prediction sets (satisfying coverage constraints under a class of covariate shifts), while the inner maximization finds the most length-efficient sets within that space.
To make this practical for finite samples, the authors introduce a smoothed version of the objective function using Gaussian smoothing (since indicator functions are non-differentiable) and solve it using gradient descent-ascent (GDA) methods. They prove that in the infinite-sample regime, strong duality holds, meaning the relaxed minimax problem perfectly recovers the length-optimal, conditionally valid prediction sets. For finite samples, they provide PAC-style conditional coverage validity guarantees.
Datasets
The method is evaluated across three distinct modalities:
- Regression: 11 real-world datasets from the UCI Machine Learning Repository and MEPS (including MEPS-19, MEPS-20, MEPS-21, blog feedback, protein tertiary structure, bike sharing, communities and crime, STAR, concrete compressive strength, and Facebook comment volume variants). A synthetic regression dataset is also used for group-conditional coverage evaluation.
- Multiple-Choice Text Data (LLMs): TruthfulQA, MMLU, OpenBookQA, PIQA, and BigBench using Llama 2.
- Image Classification: The RxRx1 dataset from the WILDS repository (cell images across 51 experiments with covariate shifts) and CIFAR-10 (using ResNet-32).
Key Insights and Ideas
- Structure Matters: The optimal prediction set size depends heavily on the structural properties of the covariates ($X$). Standard split-conformal methods ignore this structure, leading to suboptimal set sizes.
- The Duality Perspective: The paper shows that the problem of finding the shortest valid prediction set can be framed as a dual problem to level-set estimation of the conditional density $p(y|x)$.
- Decoupled from Score Generation: CPL operates at the final stage of the CP pipeline. It doesn't require retraining the underlying machine learning model or changing how conformity scores are calculated; it simply optimizes the thresholding mechanism on top of existing scores.
Key Results
- Regression: In real-world regression tasks, combining CPL with Conformalized Quantile Regression (CQR+CPL) reduced the average prediction interval length to 1.16, compared to 1.40 for standard CQR+SC, while maintaining the target 90% coverage.
- Large Language Models: For LLM multiple-choice question answering, CPL significantly reduced the mean prediction set size compared to standard split conformal baselines across all five benchmarks, bringing the set size closer to 1–2 options instead of 3–4.
- Covariate Shifts: On the WILDS RxRx1 image dataset, CPL maintained valid conditional coverage across general covariate shifts while achieving substantially smaller prediction set sizes than the state-of-the-art Conditional Calibration method.
Limitations and Future Work
- Finite-Dimensional Constraints: Currently, the theoretical framework and algorithm only handle conditional coverage derived from finite-dimensional classes of covariate shifts. Extending this to infinite-dimensional classes remains an open challenge.
- Finite-Sample Length Optimality: While finite-sample coverage is rigorously guaranteed, proving finite-sample length optimality is theoretically difficult because distributional continuity assumptions break down. The authors point to "length stability" as a promising direction for future finite-sample analysis.
Summary updated