Optimal transport-based conformal prediction

Gauthier Thurin, Kimia Nadjahi, Claire Boyer

Introduction

Conformal Prediction (CP) has emerged as the "gold standard" for quantifying uncertainty in machine learning. Instead of outputting a single point estimate, CP produces a prediction set that is mathematically guaranteed to contain the true value with a user-defined probability (e.g., 95%).

However, standard CP faces a significant "dimensionality problem" when dealing with multivariate outputs, such as multi-output regression or multiclass classification. Most traditional methods rely on a scalar non-conformity score, which essentially squashes complex, multi-dimensional errors into a single number. This reduction loses vital information about how different output variables correlate. While some multivariate CP methods exist, they often force prediction sets into rigid, predefined shapes like boxes or ellipsoids. If a model's error distribution is "banana-shaped" or otherwise non-convex, these rigid geometric constraints result in prediction sets that are unnecessarily large and inefficient.

To address this, researchers have introduced OT-CP, a novel Conformal Prediction framework that uses Optimal Transport to handle multivariate outputs. By leveraging Monge-Kantorovich ranks and quantiles, OT-CP constructs flexible, non-convex prediction regions that adapt to the true geometry of the data while maintaining rigorous finite-sample coverage guarantees.

Methodology: Moving Beyond 1D Sorting

The core innovation of OT-CP is transitioning from 1D sorting to multivariate "ranking" using Optimal Transport (OT).

  1. Monge-Kantorovich (MK) Ranks: In one dimension, finding quantiles is as simple as sorting numbers. In higher dimensions, however, "sorting" is not well-defined. OT-CP utilizes Monge-Kantorovich theory to map multivariate non-conformity scores onto a "reference" distribution (such as a uniform distribution on a unit ball). This mapping allows the algorithm to define "inner" and "outer" regions in a multi-dimensional space in a principled way.
Monge-Kantorovich ranks applied to a non-convex distribution of scores.
  1. Flexible Shapes: Because the method does not assume a specific geometry (like an ellipse or a rectangle), the resulting prediction regions can be entirely non-convex. They dynamically adapt to the actual distribution of the model's residuals, capturing complex uncertainty patterns.
  2. OT-CP+ (The Adaptive Version): The authors also extend the method to handle conditional coverage. By employing a k-nearest neighbors (k-NN) approach on the calibration set, OT-CP+ can adjust the size and shape of the prediction region based on the specific input $X$. This ensures that the uncertainty estimate is locally accurate, rather than just accurate on average across the whole dataset.
  3. Theoretical Guarantees: Crucially, the paper proves that OT-CP maintains the "distribution-free" property of classical CP. The coverage guarantees hold regardless of the underlying data distribution or the specific black-box model being used.

Key Insights and Results

The authors evaluated OT-CP across simulated data, six real-world multi-output regression datasets from the Mulan library, and multiclass classification tasks (MNIST and Fashion-MNIST).

  • Geometry is Efficiency: The primary advantage of OT-CP is that by allowing prediction sets to be non-convex, it can achieve the target 95% coverage with a much smaller "volume" than traditional methods.
  • Capturing Confusion in Classification: In classification tasks, OT-CP evaluates the entire probability vector as a multivariate score rather than just looking at the top predicted class. This allows it to capture the "confusion structure" of the model. If a model frequently confuses a '3' and an '8', the prediction set will naturally reflect that specific correlation.
  • The Power of the Reference Distribution: The choice of the reference distribution allows practitioners to toggle between "center-outward" ordering (ideal for regression errors) and "left-to-right" ordering (better suited for probability simplexes in classification).
Performance of OT-CP vs. baselines, showing flexible prediction sets, valid coverage, and reduced volume.

In empirical tests, OT-CP consistently produced prediction sets with smaller volumes than ellipsoidal (ELL) or rectangular (RECT) methods while perfectly maintaining the target marginal coverage. Furthermore, on real-world datasets, the adaptive OT-CP+ significantly outperformed existing adaptive ellipsoidal methods on "worst-set coverage," meaning it is much less likely to under-cover specific, difficult subsets of the data.

Limitations and Future Work

While highly effective, the OT-CP framework has a few limitations that present opportunities for future research:

  • Computational Complexity: Solving Optimal Transport problems is computationally heavier than simple 1D sorting. The complexity is roughly $O(n^3)$ relative to the calibration set size. The authors suggest that entropic regularization could be a viable path to scaling the method to massive datasets.
  • Reference Distribution Tuning: The "best" reference distribution for a given task isn't always obvious. Choosing more tailored reference distributions could further improve performance in specific, niche regression scenarios.
  • High-Dimensional Scaling: While OT-CP works exceptionally well for a handful of outputs, scaling the optimal transport mapping to extremely high-dimensional output spaces (such as image-to-image translation) remains an open challenge.

Summary updated

BibTeX
@inproceedings{thurin2025optimal,
  author = {Gauthier Thurin and Kimia Nadjahi and Claire Boyer},
  title = {{Optimal transport-based conformal prediction}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=kEAyffH3tn},
}
Figure