When Does Aligning Across Time Help? A Causal-Distance Test for Temporal Adaptation

Models deployed on drifting data, such as loan defaults, electricity demand, or fraud, are usually patched in one of two ways. One is to retrain on recent data. The other is adversarial domain adaptation, which trains the model's internal features so that a separate classifier cannot tell old data from new. Alignment is the right fix when only the inputs have moved and the input-to-label relationship has stayed the same. It is the wrong fix when that relationship itself has changed, because forcing new data to look like old data then imposes the old, now-invalid relationship on the present. Practitioners usually cannot tell which case they are in, because the labels that would reveal it arrive weeks late.

This note proposes a way to tell the two cases apart before labels arrive, and to check that the method actually works. The method fits a causal graph, meaning a directed graph of which variables directly influence which, on each successive time window. It then measures how much the graph changed using a target-localized version of recent causal distance measures. These measures count how often the right set of variables to control for when estimating an effect on the label becomes wrong. The central claim is testable: this localized causal distance predicts the sign of the gain from adversarial alignment across a chronological split better than three simpler signals. Those signals are the domain classifier's own accuracy, structural edge counts, and change in the correlation matrix. If the claim holds, the distance can drive an adapt / retrain / hold policy that holds up better than error-based drift detectors when labels are delayed.

Core Claim

Let $G_t$ be the equivalence class of causal graphs (a CPDAG) estimated on window $t$, over features $X_1,\dots,X_p$ and label $Y$. For a past window $s$ and the current window $t$, define the localized adjustment distance $d_Y(G_s, G_t)$. It is the fraction of feature–label pairs $(X_j, Y)$ for which an adjustment set that is valid in one graph becomes invalid in the other, averaged over both directions because adjustment distances are not symmetric. An adjustment set is a set of variables whose control makes the effect of $X_j$ on $Y$ estimable. When $Y$'s labels are still delayed in window $t$, the distance is computed on the feature-only subgraph restricted to $Y$'s estimated ancestors from the last labeled window.

The hypothesis has two parts. When $d_Y$ is near its noise floor but feature distributions have moved, adversarial alignment across time, or simply training on all history, should beat retraining on the recent window alone. When $d_Y$ is large, alignment should cause negative transfer and retraining should win. A domain classifier cannot separate these two cases because it fires on any shift, harmless or not.

Where This Sits in Prior Work

The metric side comes from recent work that replaces edge counting with functional measures. Adjustment Identification Distance counts how many adjustment-based effect identifications a guessed graph gets wrong. It runs in polynomial time on CPDAGs through the gadjid library and assigns zero distance to supergraphs that only add redundant edges. Separation-Based Distance Measures for Causal Graphs compares which variables a graph says are independent given which others (its d-separation statements), and is invariant across Markov equivalence classes. We reuse both, and we change their use in two ways. The papers compare an estimate to a known truth on static synthetic graphs, whereas we compare two estimated graphs from different time windows. We also restrict the comparison to statements about the label.

The motivation is that functional metrics have never been tested on real chronological data. The Case for Evaluating Causal Models Using Interventional Measures and Empirical Data found that structural distance tracks interventional error only weakly, and that method rankings reversed between synthetic and empirical Postgres data. This is why our decisive evaluation uses realized adaptation gain on real splits and does not rely on graph accuracy against a truth we do not have. Equivalence-class invariance matters because each window is observational. Intersection-Validation shows that observational fit cannot distinguish Markov-equivalent graphs, so any per-window signal must be defined on equivalence classes, and both chosen metrics are.

Three papers constrain the design. CausalBench found that causal discovery on real perturbation data often loses to non-causal baselines. We therefore treat estimated graphs as noisy, bootstrap them, and calibrate a noise floor. On the Interventional Kullback-Leibler Divergence gives a distance with transfer guarantees, but it requires known intervention targets, which drifting deployment data never supplies. We therefore choose graph-only metrics. Interventional Domain Adaptation shows that adversarial alignment (DANN) loses 27.9% accuracy as spurious correlation grows on Colored Office-31. This is the failure we aim to predict in advance, in time-ordered data, where that paper only repaired it on static images.

The closest temporal work aligns or simulates distributions without asking whether the shift touches the label's mechanism. CODA forecasts the next window's correlation matrix and synthesizes training data from the forecast. IMPaCT GNN matches first and second moments across chronological graph splits. Time Series Domain Adaptation via Latent Invariant Causal Mechanism aligns latent Granger-causal structure between arbitrary domain pairs. None of the three decides whether to align, none uses adjustment validity, and none tests under labeling delays. Our evaluation protocol follows On the Impact of Industrial Delays when Mitigating Distribution Drifts, which shows that ignoring label and deployment delays overstates drift mitigation by up to 39.86%.

Research Program

The program has three steps.

The first step is the signal. On rolling chronological windows separated by a buffer gap, we run a standard equivalence-class learner (PC and GES) on each window, with 50 bootstraps per window. We compute $d_Y$ and its separation-based counterpart for every window pair with gadjid. The noise floor is the distribution of $d_Y$ between bootstrap pairs drawn from the same window, and only distance above this floor counts as a shift.

The second step is the predictive test. For every chronological split we measure the realized gain of CDAN-style conditional adversarial alignment (Conditional Adversarial Domain Adaptation) over retraining on the recent window alone, and the gain of DANN as well. We then ask how well each candidate signal predicts the sign and size of that gain.

The third step is the policy. We turn the signal into an adapt / retrain / hold rule with two thresholds tuned on early windows only. We run it under realistic label and deployment delays.

Baselines

The naive reference is a model trained once on the first period and never updated. Every policy must beat it, and how far it falls behind shows how much drift each dataset contains.

The strongest operational competitor is error-triggered retraining with the HDDM-W drift detector on a fixed sliding window with gradient-boosted trees (LightGBM). This is the top strategy in the industrial-delays study, which reports it reaching superior MCC with 32 retrainings against 136 for aggressive periodic retraining on BGL. That paper's summary gives no MCC values, so we report: no reported result found on Lacuna for HDDM-W MCC on LCLD or Electricity. We rerun it on the public LCLD and Electricity data under the same delays, the same learner, and the same hyperparameter budget. Beating it means higher mean MCC with no more retrainings, at label delays of at least two weeks.

The strongest temporal-generalization method is CODA. CODA reports 0.5% misclassification on Rotated 2-Moons against 3.2% for DRAIN. We run it with its LightGBM backend on the same windows. We do not expect to beat it on Rotated 2-Moons, where the drift is smooth and correlation-driven, and we say so. The test against CODA is on datasets with abrupt relationship changes. A further reference is always-on alignment, meaning DANN and CDAN applied at every window. This is the policy our signal is supposed to improve on by withholding alignment when it hurts.

Three ablations isolate the key ingredient. The first replaces $d_Y$ with the domain discriminator's held-out accuracy. The second replaces it with structural Hamming distance between window graphs. The third replaces it with the Frobenius change in the correlation matrix, which is CODA's proxy. A fourth ablation uses the global, unlocalized adjustment distance to test whether restricting to the label matters. Every signal gets the same threshold-tuning windows and the same downstream learners.

Why not just…?

Why not just use the domain discriminator's accuracy to decide when to adapt? This is the most natural alternative, because it is free and already part of the adversarial pipeline. Its weakness is structural. It measures how much the input distribution moved, not whether the input-to-label relationship broke. The Colored Office-31 result in Interventional Domain Adaptation is an instance where a large, detectable shift coexisted with alignment hurting. The synthetic experiment below settles this directly: it holds discriminator accuracy fixed while moving the shift between upstream mechanisms and the label's own mechanism. If discriminator accuracy predicts gain sign as well as $d_Y$ on the real splits, the causal machinery adds nothing and we will report that.

Why not just pick between adapting and retraining by validating on the most recent labeled window? This is a real threat, and with no label delay it probably wins, because it measures the outcome we care about directly. Its weakness is that under delay the most recent labeled window is stale by exactly the delay. We vary label delay from zero to eight weeks. We predict that delayed validation ties or wins at zero delay, and that the causal signal's advantage appears and grows with delay. If no crossover appears, the proposal fails on its central practical claim.

Why not just use edge counts or correlation change instead of an adjustment distance? Edge counts penalize harmless redundant edges and barely move when a single reversal reorganizes which adjustment sets are valid (Adjustment Identification Distance, Separation-Based Distance Measures). Correlation change cannot distinguish confounded paths from direct ones. Both are run as ablations under identical conditions, so the comparison is empirical rather than argued.

Why not just retrain trees on a sliding window and skip adaptation entirely? That is the HDDM-W baseline above. CausalBench and CODA's LightGBM results suggest simple tree learners are hard to beat, so all of our policies use the same LightGBM learner. The only thing that differs between policies is when and how they update.

Proposed Experiments

The first experiment is controlled synthetic chronology. We build sequences of 20 windows from random structural causal models with 15–40 variables. In each sequence the drift is placed in one of four locations: the marginals of the label's causes, the label's own mechanism, the mechanisms of the label's effects, or edge insertions and reversals. Discriminator accuracy is matched across conditions. Here the true graphs are known, so we can also check that estimated $d_Y$ tracks true $d_Y$. The prediction is that alignment gain is positive under shifts in the causes' marginals and negative when the label's mechanism changes. We measure Spearman correlation and the area under the ROC curve (AUROC) for predicting gain sign from each signal.

The second experiment uses real chronological splits on Electricity, LCLD, Online News Popularity, Shuttle, and Appliances Energy. It uses rolling windows, a buffer gap, and the delay protocol of the industrial-delays study. No ground-truth graphs are needed, because the target is realized gain measured on held-out future windows. The primary metrics are AUROC for gain sign, MCC, and the number of retrainings.

The decisive check has three parts. On real splits, $d_Y$ must predict alignment-gain sign with higher AUROC than discriminator accuracy, structural Hamming distance, and correlation change. The resulting policy must beat HDDM-W at nonzero delays. And the localized distance must outperform the global one. If the first part fails, the paper becomes a negative result about using estimated causal graphs as drift diagnostics on real data, which would still be informative given how little such evidence exists (Gentzel et al.).