Physics-Weighted Sequential Tests for Drift in High-Dimensional PDE Systems

Neural solvers that need no mesh can now approximate partial differential equations (PDEs) in 10 to 100 dimensions at a cost that grows polynomially, not exponentially, with dimension. Examples include parabolic models in finance and reaction-diffusion systems with many species. These solvers are trained once and then frozen. A deployed system, however, keeps receiving sparse, noisy point measurements of the true field, and the physics behind those measurements can quietly change: a reaction rate degrades, a source term moves, a coefficient drifts. Off-the-shelf drift detectors do not fit this setting. The fast incremental Kolmogorov-Smirnov test handles one variable at a time. Classifier-based two-sample tests compare raw input distributions, so they raise an alarm whenever sensors are moved, even if the physics is unchanged. None of these detectors uses the solver the operator already has.

We propose a detector built from that solver. Each new measurement is compared with the frozen solver's prediction at the same location. The resulting misfits are weighted by a small "witness" network that is trained online to find the spatial pattern in which the misfits line up. Under no drift, the weighted misfits form a fair game, so a running product of bets gives a false-alarm guarantee that holds at every time step simultaneously. When drift occurs, the witness finds it at a cost that grows polynomially in dimension. The witness plays the same role as the adversarial test function in weak PDE solvers. That gives a practical payoff: once an alarm fires, the trained witness can seed the re-solve.

Core Claim

The detector separates harmful concept drift, meaning a change in the physical law, from harmless covariate shift, meaning a change in where measurements are taken. For coherent but small drifts it should detect markedly faster than tests on the marginal distribution of misfits.

Setup. A solver $u_\theta$ is trained offline on the reference PDE. Measurements $y_i = u_t(x_i) + \text{noise}$ arrive at locations $x_i \sim P_t$ in $\mathbb{R}^d$. A short calibration window fits a small correction $\hat r_0(x)$ for the solver's own error. The corrected misfit is $r_i = y_i - u_\theta(x_i) - \hat r_0(x_i)$, clipped to a bounded range.

Test. The null hypothesis is that the conditional mean of $r_i$ given $x_i$ is zero, whatever $P_t$ is. A witness $\varphi_{i-1}$ with outputs in $[-1,1]$ is trained only on measurements before $i$ and accumulates the wealth

$$K_n = \prod_{i=1}^{n}\left(1 + \lambda_{i-1}\,\varphi_{i-1}(x_i)\,\frac{r_i}{c}\right),$$

where $c$ is the clipping bound and $\lambda_{i-1} \in [0, 1/2]$ is a bet size chosen from past data. Under the null, $K_n$ is a nonnegative martingale. By Ville's inequality, raising an alarm when $K_n \ge 1/\alpha$ keeps the probability of ever falsely alarming below $\alpha$.

This adapts the evaluate-then-train idea of Sequential Covariate Shift Detection Using Classifier Two-Sample Tests, where an online classifier predicts each sample before training on it. It differs from that work in two ways. First, it tests the conditional relation between location and value, not the input distribution. Second, its guarantee is uniform over time rather than per step. The file notes that per-step guarantees accumulate false alarms over long deployments.

Expected detection delay. Let $\delta(x)$ be the drift in the field and $\sigma$ the noise level. Define the effect size $\Delta = \sup_{\varphi} \mathbb{E}[\varphi(x)\,\delta(x)]/\sigma$, taken over witnesses in a spectral Barron class. We conjecture that the expected delay behaves like

$$\mathbb{E}[\tau] \lesssim \frac{\log(1/\alpha) + \mathrm{poly}(d)\cdot \mathrm{Reg}}{\Delta^2},$$

where $\mathrm{Reg}$ is the online-learning regret of the witness class.

The form follows from standard betting arguments: wealth grows at a rate of roughly $\Delta^2$ per sample, minus the cost of learning the witness online. The complexity bounds for Barron classes in A Priori Generalization Analysis of the Deep Ritz Method suggest that this learning cost grows polynomially in $d$. That paper proves dimension-free rates only for i.i.d. uniform sampling. We need the online, non-stationary analogue, which the file lists as open.

Why this should beat marginal tests. Consider a coherent drift of size $\varepsilon$ whose sign varies in space, for example $\varepsilon\sin(w\cdot x)$. The misfits keep mean zero and their variance changes only at order $\varepsilon^2$. A test on the marginal distribution, such as the incremental Kolmogorov-Smirnov test of Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test, therefore needs on the order of $\varepsilon^{-4}$ samples. A witness that tracks the sign pattern needs on the order of $\varepsilon^{-2}$. For a drift that simply shifts the mean, the two approaches should perform about the same, and we will report that case honestly.

Research Program

Theory. We will prove the false-alarm guarantee, which follows from the martingale property if the calibration correction is held fixed. We will then attempt the detection-delay bound for two-layer witnesses in spectral Barron spaces. A secondary aim is a bound on how solver error and the calibration correction's error outside its support inflate false alarms when sampling moves into regions the solver handles poorly. This is the main failure mode of the design.

Adaptation after an alarm. Once the detector fires, we re-solve the PDE with the Weak Adversarial Networks (WAN) method. WAN solves the weak form of a PDE as a game between a solution network and a test network that searches for large residuals. It scales roughly linearly in $d$ and reached 0.69% relative $L_2$ error at $d=25$, but only for static problems. The re-solve starts from $u_\theta$, and its test network is initialized from the trained witness. When the drift has a known parametric form, we first identify the new coefficient from the buffered measurements. This follows the inverse identification in DeepXDE, which recovered a diffusion coefficient of $1.98\times10^{-3}$ against a true value of $2\times10^{-3}$.

Resolving the single-pass tension. The guarantee requires one training update per sample, while PDE solvers need thousands of iterations. Keeping the solver frozen while monitoring, and adapting only after an alarm, removes this conflict. The witness itself takes one step per sample.

Benchmarks. We will build drifting versions of three static problems from the file:

  1. The nonlinear elliptic problem at $d=10$ and $d=25$ and the diffusion-reaction problem at $d=10$ from WAN.
  2. The $d=100$ Poisson problem from Deep Ritz.
  3. The 2D heat and Allen-Cahn streams of Continual Learning of Physical Systems via Derivative Distillation, as a low-dimensional sanity check.

In each problem, the source term or a coefficient drifts abruptly, gradually, or locally with a sign pattern. Separately, the sampling distribution $P_t$ shifts with the physics unchanged, to measure false alarms.

Baselines

Do nothing. The naive reference is the frozen solver with no monitoring. It sets the error floor that drift produces.

Periodic re-solve. WAN is re-solved every $k$ measurements without any detection. The value of $k$ is tuned so the total solver iterations match ours. This shows whether detection saves compute at equal accuracy.

Marginal misfit monitoring. The incremental Kolmogorov-Smirnov test, or a cumulative-sum test, is applied to the same corrected misfits $r_i$. It uses the same calibration window and the same false-alarm target. This baseline isolates the key ingredient, the learned spatial witness. Beating it means a shorter mean detection delay at matched empirical false-alarm rate on drifts whose sign varies in space. On pure mean shifts we expect a tie and will report one if it occurs.

Joint two-sample classifier test. The strongest existing detector is the sequential classifier test of Jang et al., run on joint location-value pairs against the reference window. It uses a classifier of the same size and the same learning-rate tuning budget as our witness. The file reports it reaching 80% detection with 190 shifted samples on ImageNet, versus 640 to 720 or more for data-splitting baselines, with false positives below 1%. There is no reported result on Lacuna for any detector on high-dimensional PDE streams. Beating it means a comparable or shorter delay under concept drift and a false-alarm rate near $\alpha$, rather than near-certain alarms, under pure covariate shift.

Physics without a learned witness. An ablation replaces the learned witness with a fixed one: the sign of a smoothed misfit estimate from the previous window. This tests whether online witness learning is needed.

Adaptation baselines. After an alarm, we compare four ways of re-solving: a warm start with a random test network, our witness-initialized warm start, a solve from scratch, and the derivative-distillation regularizer of Gentili et al. applied to the PINN version. Derivative distillation reported $1.13\times10^{-3}$ error on 2D heat, against $2.64\times10^{-3}$ for joint training.

Why not just…?

Why not just monitor the scalar misfit with a fast univariate test? This is the most serious alternative, and the proposal is designed to test it directly. For drifts that shift the mean, it will likely match our test at lower cost, and we will say so. Our argument concerns small, coherent drifts whose sign varies in space. For these, the change in the marginal distribution appears only at second order. Beyond Euclidean Summaries makes the general point that low-dimensional summaries hide changes in shape. If sweeping the drift size does not show the predicted $\varepsilon^{-4}$ versus $\varepsilon^{-2}$ gap in delay, the learned witness is not worth having.

Why not just run the classifier two-sample test on the raw measurements? That test asks whether the joint distribution of locations and values changed. Moving sensors changes that distribution without changing the physics, so the test would trigger needless re-solves. It also learns in $d+1$ dimensions without the solver's prediction, so it must rediscover the physics in order to see a change. The covariate-shift experiment settles the first point. Delay curves at increasing $d$ settle the second.

Why not skip detection and fine-tune continuously with derivative distillation? Derivative distillation beats fine-tuning, replay, and elastic weight consolidation in 2D: $8.96\times10^{-4}$ versus $7.65\times10^{-3}$ for elastic weight consolidation on Allen-Cahn. However, its task boundaries were given externally, and it was never run beyond $d=2$. In 25 dimensions a WAN solve takes about 20,000 iterations, so continuous adaptation is expensive. The file also notes that derivative penalties grow costly and noisy in high dimensions. The compute-matched periodic re-solve baseline measures this directly. If continuous adaptation matches our accuracy at equal compute, detection is unnecessary, and that would be a negative result worth reporting.

Proposed Experiments

Decisive check 1: delay against drift size. For each of $d \in \{2, 10, 25, 100\}$, we plot mean detection delay against drift size $\varepsilon$ on log axes, for our test and for the marginal-misfit test, on spatially oscillating drifts at $\alpha = 0.01$. Our prediction is a slope near $-2$ for our test and $-4$ for the marginal test, with delay growing at most polynomially in $d$.

Decisive check 2: false alarms over long runs. We run 10,000-step streams with no change in physics, under both stationary and shifted sampling, and record the empirical rate of ever alarming. The target is at most 0.01 for our test. We expect a much higher rate for the joint classifier test under sampling shift. We also measure how solver error inflates this rate when sampling moves outside the calibration support.

Decisive check 3: accuracy and compute. We track relative $L_2$ error over the whole stream against total solver iterations, for each adaptation scheme. This tests whether the witness-initialized re-solve recovers WAN-level error, 0.69% at $d=25$ in the static case, in fewer iterations than a random-start warm start.

Success criterion. The proposal succeeds if checks 1 and 2 hold at $d \ge 25$. It fails informatively if the marginal misfit test ties ours across all drift types.