Abstract
Conformal prediction is a popular, modern technique for providing valid predictive inference for arbitrary machine learning models. Its validity relies on the assumptions of exchangeability of the data, and symmetry of the given model fitting algorithm as a function of the data. However, exchangeability is often violated when predictive models are deployed in practice. For example, if the data distribution drifts over time, then the data points are no longer exchangeable; moreover, in such settings, we might want to use a nonsymmetric algorithm that treats recent observations as more relevant. This paper generalizes conformal prediction to deal with both aspects: we employ weighted quantiles to introduce robustness against distribution drift, and design a new randomization technique to allow for algorithms that do not treat data points symmetrically. Our new methods are provably robust, with substantially less loss of coverage when exchangeability is violated due to distribution drift or other challenging features of real data, while also achieving the same coverage guarantees as existing conformal prediction methods if the data points are in fact exchangeable. We demonstrate the practical utility of these new tools with simulations and real-data experiments on electricity and election forecasting.
Introduction
In machine learning, point predictions are often insufficient; practitioners require a measure of uncertainty. Conformal prediction (CP) has emerged as a gold standard, providing distribution-free prediction intervals that are guaranteed to contain the true value with a pre-specified probability (e.g., 90%). However, standard CP relies on the assumption of exchangeability—the idea that the order of data points does not affect their joint distribution.
In practice, exchangeability is frequently violated. Data distributions often drift over time (e.g., changing consumer habits), observations may be correlated (e.g., time series), or models may intentionally prioritize recent data. When exchangeability fails, standard CP intervals often lose coverage, becoming overly optimistic and failing to meet their theoretical guarantees. This paper introduces nonexchangeable conformal prediction, a framework designed to maintain valid prediction intervals even under distribution shift.
Methodology
The authors generalize split conformal, full conformal, and jackknife+ methods to address two primary challenges:
- Distribution Drift via Weighted Quantiles: Instead of treating all historical residuals equally, the method assigns weights $w_i$ to data points. By assigning higher weights to recent observations and lower weights to the distant past, the prediction interval becomes adaptive to the current data distribution.
- Nonsymmetric Algorithms via Random Swaps: Standard CP requires the model-fitting algorithm to be symmetric. To accommodate nonsymmetric algorithms—such as weighted regression or autoregressive models—the authors introduce a random swap technique. By randomly swapping the "tags" (order or weights) of the test point with a training point before model fitting, they preserve the necessary symmetry in a distributional sense, enabling the use of more flexible base models.
Experimental Evaluation
The proposed methods were evaluated across three distinct settings:
- Synthetic Simulations: Testing robustness against sudden changepoints and gradual distribution drift.
- ELEC2 Dataset: A real-world benchmark tracking electricity usage and pricing in Australia (1996–1999), characterized by significant distribution drift.
- 2020 US Election Data: Predicting county-level vote changes using a "biased split" (training on Eastern time zone counties and testing on others) to simulate a violation of exchangeability.
Key Insights
- Robustness at No Cost: If the data is indeed exchangeable, the weighted method yields the same coverage guarantees as standard CP. Robustness against drift is achieved without sacrificing performance in stable environments.
- Residual-Based Bounds: The authors prove that the "coverage gap" is bounded by the Total Variation (TV) distance between the distributions of residuals, rather than the raw data. This implies that if a model effectively captures the drift, the residuals may remain stable even if the underlying features drift.
- Synergy of Adaptation: The most efficient (narrowest) intervals are achieved by adapting both the model (using nonsymmetric, weighted training) and the residuals (using weighted quantiles).
Key Results
The nonexchangeable method demonstrates superior performance in maintaining target coverage levels compared to standard approaches.
On the ELEC2 electricity dataset, standard conformal prediction's coverage fell significantly below the 90% target during periods of distribution drift. In contrast, the proposed nonexchangeable method successfully maintained coverage near the target throughout the entire observation period. Similar improvements were noted in election forecasting, where the nonexchangeable version (NexCP+WLS) improved coverage from 74.3% to 84.0% in a biased split scenario.
Limitations and Future Directions
While the framework is robust, several areas remain for future research:
- Weight Selection: The current theory assumes weights are fixed a priori. Automatically determining optimal decay rates or drift magnitudes from the data is an open question.
- Swap Stability: For highly sensitive models, the random swap step may introduce instability in predictions, necessitating further investigation into "swap-robust" algorithms.
- Adaptive Drift Estimation: Future work could explore methods for adaptively estimating drift to set weights dynamically.
Summary updated