arXiv:2610.33594cs.AIOct 2026

Manuscript Offprint

arXiv:2610.33594

Counterfactual Model Testing Under Distribution Shift

Joran Leest, Ilias Gerostathopoulos, Claudia Raibulet, Patricia Lago

JORAN LEEST, Vrije Universiteit Amsterdam, The Netherlands

ILIAS GEROSTATHOPOULOS, Vrije Universiteit Amsterdam, The Netherlands

CLAUDIA RAIBULET, Università' degli Studi di Milano-Bicocca, Italy

PATRICIA LAGO, Vrije Universiteit Amsterdam, The Netherlands

Deployed machine learning (ML) models can degrade as the distribution of their input data shifts. Such shifts can result from changes in the population or from data integrity issues in the pipeline that materializes model features, two sources that operate through different mechanisms. Because labels are often absent or delayed, it is common practice to track shifts in the data instead, but a detected shift does not indicate how it affects the model. We formulate this problem as online model testing under distribution shift. Testing requires reproducing the shift on a controlled baseline with known labels. Since the same shift can come from either source, doing so requires knowing which mechanism changed. We propose a methodology that reproduces observed changes in both mechanisms to estimate current performance and the potential gain from repairing observed data integrity issues. Experiments on real-world datasets with simulated faults show that separating the two sources generally improves both estimates, supporting this formulation. A churn prediction case illustrates how these tests can support monitoring and repair prioritization.

1 Introduction

Machine learning (ML) models provide software applications with capabilities such as product ranking, fraud detection, and churn prediction. Once trained, a model is deployed under the assumption that the distribution it encounters remains stationary [27, 43]. However, deployment exposes the model to two sources of change that break this assumption. The population (e.g., the mix of users and their behavior) changes continuously through events, trends, and seasonality [37, 75], and data integrity issues are introduced as the pipelines producing the model's features change, break, or become stale [15, 37, 59, 60]. Both introduce distribution shifts that can degrade performance until predictions are no longer reliable for the decisions they support. Deployment therefore begins an ongoing process of monitoring and response [37, 60].

In practice, engineers track feature and data integrity metrics on dashboards and follow on-call processes to investigate alerts and respond to incidents [37, 60]. The challenge of monitoring production ML can therefore be understood as answering two recurring questions (Figure 1a).

Q1: How well is the model performing right now, and has performance declined? Performance monitoring requires labels for recent predictions, but in many domains this feedback is delayed or incomplete. Fraud may be confirmed only after a manual investigation, customer report, or later chargeback [18]; churn only after a period of inactivity [53]; and loan default only months after a lending decision [41]. Practitioners therefore rely on feature drift and data integrity metrics as proxies for performance degradation, despite their weak correlation with actual performance loss [37, 60]. They need reliable performance estimates to decide whether to intervene – e.g., by switching to a fallback and warning downstream consumers of the model's predictions.

Q2: How do the flagged issues affect model performance, and what is worth repairing? Responding to an observed shift requires understanding both its source and its effect on model performance. Feature drift alone does not identify the source. The population may have changed (e.g., a different mix of customers), or a data integrity issue may have changed how that population is recorded (e.g., a failed table join introducing missing values) [37, 60]. These sources can produce

Authors' Contact Information: Joran Leest, Vrije Universiteit Amsterdam, The Netherlands, j.g.leest@vu.nl; Ilias Gerostathopoulos, Vrije Universiteit Amsterdam, The Netherlands, i.g.gerostathopoulos@vu.nl; Claudia Raibulet, Università' degli Studi di Milano-Bicocca, Italy, claudia.raibulet@unimib.it; Patricia Lago, Vrije Universiteit Amsterdam, The Netherlands, p.lago@vu.nl.

Joran Leest, Ilias Gerostathopoulos, Claudia Raibulet, and Patricia Lago

the same observed shift but require different responses: a population change may require retraining or recalibration, while a data integrity issue may require repairing the affected table or pipeline [37]. Data integrity metrics, instrumentation, and lineage can help identify specific issues and the affected artefacts [10, 45, 61]. Even when the source is identified, the magnitude of an observed shift or data integrity violation does not determine how much it affects the model [37, 60] – a join failure making an entire group of columns missing might have little effect, while a short freshness lag in another feature may substantially degrade performance. Engineers thus need to prioritize repairs by their potential recovery of model performance [60].

Both questions require testing how distribution shifts observed in production affect model performance without relying on current label feedback. We study this problem as online model testing under distribution shift, referred to simply as online model testing throughout this paper. We use these tests to estimate the current model performance (Q1) and the performance gain from repairing individual production issues (Q2). Existing methods typically reproduce distribution shifts under assumptions about their source, such as changes in the population or data integrity issues [16, 21]. As these sources can occur together in production, representing only one can lead to inaccurate performance estimates when the observed shift also reflects the other (Section 3).

To address this, we examine what must be observed about changes in the population and data pipeline and how these changes can be reproduced in controlled tests. We illustrate the problem and our approach throughout with a churn prediction case for a music streaming service, based on a public dataset [32], in which a model predicts whether a user will stop renewing their subscription. Figure 1 uses this case to provide an overview of the monitoring setting (Figure 1a), our framing of the problem of online model testing (Figure 1b), and the proposed methodology for constructing these tests (Figure 1c). Specifically, this paper makes three contributions.

We formulate the problem of online model testing under distribution shift (Section 3). We distinguish changes in the underlying data-generating process from changes in how the data pipeline materializes the observed features and represent them as separate mechanisms (Figure 1b). This formulation makes explicit that an observed feature shift does not by itself identify which mechanism changed, and that testing its performance effect therefore depends on what can be observed about the underlying mechanism changes and how these changes can be tested.

We instantiate this formulation through a methodology for constructing online model tests (Section 4). We show how observability of materialization mechanisms can be used to reproduce data integrity issues on labeled reference data and how the effect of changes in the population can be tested despite these issues. We instantiate the methodology for data integrity issues across missingness, freshness, and consistency, specifying what must be observed and how the corresponding changes can be reproduced. Combining these changes provides tests for current model performance (Q1) and the potential gain from repairing a data integrity issue (Q2).

We empirically test the proposed formulation through this methodology under controlled mechanism changes (Sections 5-7). We introduce known materialization changes into real-world datasets with population differences, providing ground truth for their occurrence and performance effects. Across datasets, models, and failure modes, we test whether representing population and materialization changes together improves current performance estimation and whether representing the current population improves repair gain estimation. We additionally assess sensitivity to partial mechanism observability and illustrate the resulting tests in a churn prediction case.

The rest of the paper is organized as follows. Section 2 positions these contributions with respect to prior work. Following the contribution sections, Section 8 discusses the findings, implications and directions for future work, Section 9 the threats to validity, and Section 10 concludes.

Q1: How well is the model performing now?

Figure

Q2: Which issues should we prioritise for repair?

Figure

(a) Monitoring a deployed model. Labels are absent in E, so current performance V cannot be measured (Q1); data integrity metrics show shifts between R and E, but not their effects on model performance (Q2).

Features X

Data-Generating Process G

Materialization Process M

X1X_{1}: User Attributes

X2X_{2}: User Activity

X3X_{3}: User Payments

Figure

Churn Prediction

Model

(b) Sources of distribution shift. The data-generating process G determines population feature values X, while materialization mechanisms MjM_j produce the observed values Xj∗X_j^*. Feature drift can reflect changes in either process, while data integrity metrics indicate changes in specific materialization mechanisms.

Q1: Performance Estimation

Figure

Q2: Repair Gain Estimation

Figure

(c) Online model testing. We reproduce combinations of mechanism changes observed in E on labeled reference data R to estimate current performance (Q1) and the gain from repairing each observed issue (Q2).

Fig. 1. Overview of our contributions, illustrated throughout with a churn prediction example: (a) the motivating setting, (b) our framing of the problem (Section 3), and (c) our methodology (Section 4).

References (11)