Length Optimization in Conformal Prediction

Shayan Kiyani, George Pappas, Hamed Hassani
2/3/2026

No official code found. Best implementation: shayankiyani98/CP (8 stars, last commit 2024-07-01).

Abstract

Conditional validity and length efficiency are two crucial aspects of conformal prediction (CP). Conditional validity ensures accurate uncertainty quantification for data subpopulations, while proper length efficiency ensures that the prediction sets remain informative. Despite significant efforts to address each of these issues individually, a principled framework that reconciles these two objectives has been missing in the CP literature. In this paper, we develop Conformal Prediction with Length-Optimization (CPL) - a novel and practical framework that constructs prediction sets with (near-) optimal length while ensuring conditional validity under various classes of covariate shifts, including the key cases of marginal and group-conditional coverage. In the infinite sample regime, we provide strong duality results which indicate that CPL achieves conditional validity and length optimality. In the finite sample regime, we show that CPL constructs conditionally valid prediction sets. Our extensive empirical evaluations demonstrate the superior prediction set size performance of CPL compared to state-of-the-art methods across diverse real-world and synthetic datasets in classification, regression, and large language model-based multiple choice question answering. An Implementation of our algorithm can be accessed at the following link: https://github.com/shayankiyani98/CP.

View on arXivView PDF

Code Implementations(1)

shayankiyani98/CPCommunity100%
81Jupyter NotebookJul 1, 20242 years ago

Similar Papers

Cite this paper

@article{kiyani2026length,
  title  = {Length Optimization in Conformal Prediction},
  author = {Shayan Kiyani and George Pappas and Hamed Hassani},
  year   = {2026},
  eprint = {2406.18814},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.18814},
  url    = {https://arxiv.org/abs/2406.18814},
  journal = {NEURIPS 2024 2024}
}

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

Discussion