Efficient Conformal Prediction under Data Heterogeneity

Vincent Plassier, Nikita Kotelevskii, Aleksandr Rubashevskii, Fedor Noskov, Maksim Velikanov, Alexander Fishkov, Samuel Horváth, Martin Takác, Eric Moulines, Maxim Panov

Abstract

Conformal prediction (CP) stands out as a robust framework for uncertainty quantification, which is crucial for ensuring the reliability of predictions. However, common CP methods heavily rely on the data exchangeability, a condition often violated in practice. Existing approaches for tackling non-exchangeability lead to methods that are not computable beyond the simplest examples. In this work, we introduce a new efficient approach to CP that produces provably valid confidence sets for fairly general non-exchangeable data distributions. We illustrate the general theory with applications to the challenging setting of federated learning under data heterogeneity between agents. Our method allows constructing provably valid personalized prediction sets for agents in a fully federated way. The effectiveness of the proposed method is demonstrated in a series of experiments on real-world datasets.

Introduction

Standard Conformal Prediction (CP) provides reliable uncertainty estimates by producing prediction sets with a guaranteed average coverage. However, these guarantees traditionally rely on the exchangeability assumption—the premise that training and test data are drawn from the same distribution. In real-world scenarios, particularly in Federated Learning (FL), this assumption is frequently violated. Different agents often possess heterogeneous data distributions (e.g., varying environmental conditions for sensors), leading to distribution shifts that break classical CP.

While "Weighted CP" methods exist to handle such shifts, they often involve intractable combinatorial calculations over $N!$ permutations, rendering them impractical for large-scale deep learning. This paper introduces a computationally efficient weighting scheme that bridges the gap between theoretical validity and practical utility in heterogeneous environments.

Efficient Weighting for Non-Exchangeable Data

The core innovation is a new weighting scheme that replaces complex permutation-based weights with a straightforward density-ratio approach.

Visualization of prediction intervals under distribution shift between training ($P^{train}$) and test ($P^{test}$) data.

Instead of intractable weights, the authors propose weights $p_k$ proportional to the likelihood ratio $\lambda_k$ between the test distribution and the calibration distribution. They prove that this simplified scheme provides "high-probability" coverage guarantees, ensuring validity for the specific calibration set in use rather than just on average across all possible datasets.

In a federated setting, density ratios are estimated using Gaussian Mixture Models (GMMs) on feature embeddings. Agents share GMM parameters—means and covariances—rather than raw data, preserving privacy while allowing agents to "re-weight" shared calibration data to match their local distributions.

Experimental Evaluation

The method was evaluated on several benchmarks, including synthetic 1D regression, CIFAR-10/100, and ImageNet-C/R. Heterogeneity was induced through varying levels of corruption (e.g., Gaussian blur) or different renditions of classes.

Comparison of coverage (a) and set size (b) across varying degrees of corruption. Our method maintains target coverage with competitive set sizes.

Key Results

  • Robust Coverage: As shown in Figure 4(a), the proposed method ("Ours") consistently maintains coverage near the 90% target across different degrees of corruption. In contrast, unweighted global methods often fail to adapt, and weighted global resampled methods exhibit higher variance.
  • Efficiency and Precision: The method produces smaller, more precise prediction sets (Figure 4(b)) than local-only baselines by effectively leveraging data from other agents through importance weighting.
  • Fast Convergence: The approach converges quickly to the target coverage as the calibration dataset grows, outperforming "Unweighted Global" approaches that struggle with local shifts.

Conclusion and Future Work

By moving away from permutation-based weights, this work makes non-exchangeable CP viable for deep learning. The use of feature-space density estimation via GMMs provides a practical path for federated uncertainty quantification. Future research may explore handling label shifts more deeply and improving density estimation in cases where neural network embeddings are less discriminative.

Summary updated

BibTeX
@inproceedings{plassier2024efficient,
  author = {Vincent Plassier and Nikita Kotelevskii and Aleksandr Rubashevskii and Fedor Noskov and Maksim Velikanov and Alexander Fishkov and Samuel Horváth and Martin Takác and Eric Moulines and Maxim Panov},
  title = {{Efficient Conformal Prediction under Data Heterogeneity}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
  url = {https://openreview.net/forum?id=Jw4rVOFzRs},
}
Figure