Solver-as-Teacher: Solver-Guided On-Policy Post-Training Framework for PDE Foundation Models

1Technical University of Munich   2UNC Chapel Hill   3Munich Center for Machine Learning
NeurIPS 2026
Solver-as-Teacher pipeline overview

SaT pipeline. The student rolls out autoregressively; the numerical solver branches multi-step correction targets from each student-visited state; the student is updated against these solver corrections.

Solver-as-Teacher (SaT) turns post-training of PDE foundation models from offline trajectory fitting into on-policy solver-guided correction: the student rolls out on its own, a numerical solver branches multi-step correction targets from each visited state, and the student learns to correct its own rollout dynamics. Across 7 PDE benchmarks and 6 pretrained backbones, a SaT variant achieves the lowest 50-step rollout RMSE in 23 of 24 in-distribution model–task pairs, and SaT-0 the lowest cross-model RMSE on all 7 out-of-distribution (OOD) parameter-shift tasks. The best SaT variant reduces cross-model RMSE over supervised fine-tuning (SFT) by up to 90%.


Abstract

PDE foundation models (PDE-FMs) promise general-purpose surrogate simulation, yet deploying a pretrained model to a new physical regime inevitably introduces distribution mismatch, demanding task-specific post-training. The dominant approach, supervised fine-tuning (SFT), is fundamentally off-policy: the model trains on pre-generated states but is evaluated autoregressively on its own. In chaotic regimes, this mismatch is catastrophic as per-step errors compound exponentially along the Lyapunov spectrum, and exact pointwise trajectory matching beyond the predictability horizon becomes an ill-posed training signal.

To resolve this, we introduce Solver-as-Teacher (SaT), an on-policy post-training framework for PDE-FMs. During training, the student rolls out autoregressively; a numerical solver branches multi-step correction targets from each student-visited state; and the student is updated against these solver corrections, learning to correct its own rollout dynamics. We instantiate SaT in a unified post-training suite with SFT, physics-informed temporal alignment, and learned-teacher on-policy distillation. Across seven 2D/3D PDE benchmarks and six pretrained PDE-FMs, SaT variants achieve the lowest 50-step rollout RMSE in 23 of 24 in-distribution model–task pairs. The best SaT variant reduces RMSE over SFT up to 90.0%, and SaT gives the lowest RMSE on all seven OOD parameter-shift benchmarks.


Why SFT Fails on PDE Foundation Models

A PDE foundation model is a learned time-stepper \(\mathcal{G}_\theta\colon u(t)\mapsto u(t{+}\Delta t)\), composed autoregressively at inference. Standard supervised fine-tuning trains \(\mathcal{G}_\theta\) on pre-generated reference trajectories — a fixed, off-policy state distribution. We identify three failure modes that emerge when this off-policy training meets a chaotic, autoregressive deployment.

F1. Distribution mismatch. The model trains on states drawn from a clean reference trajectory but is rolled out on states produced by its own previous predictions. As errors accumulate, the visited state distribution drifts away from the training distribution — exactly the regime where the model has not been supervised.
F2. Lyapunov error amplification. In chaotic systems, per-step errors are amplified as \({\sim}e^{\Lambda_{\max} k \Delta t}\) along the rollout. Small SFT residuals at \(k{=}1\) become arbitrarily large trajectory-level deviations at \(k{=}50\), so trajectories drift off the physical solution manifold and corrupt attractor statistics.
F3. Ill-posed pointwise targets. Beyond the predictability horizon, two physically valid trajectories can decorrelate pointwise while sharing the same governing dynamics. SFT keeps penalizing pointwise mismatch, demanding the impossible: an exact recovery of a specific trajectory rather than the correct dynamics.
Problem. SFT fits pre-generated states \(u_k\), but is deployed on its own predictions \(\hat{u}_k\).
SFT trains on the reference states u_k, but the model is deployed on its own rollout, which drifts away; the states between the two are never supervised.
Fix. The student rolls out; the solver branches \(m_k\) steps from every state it visits.
SaT rolls out the student; from each visited state the solver computes the target S(u_k), and the loss compares the student with it.

The takeaway:

Post-training for PDE-FMs should not only fit reference trajectories, but learn to recover physically meaningful dynamics from the states produced by the model's own rollout. This is what SaT does.


Methodology of SaT

At every training iteration: (1) the student rolls out \(K\) steps autoregressively from \(u_0\) producing \(\hat{u}_1,\dots,\hat{u}_K\); (2) the numerical solver \(\mathcal{S}\) branches forward \(m_k\) steps from each visited state \(\hat{u}_k\) producing per-state correction targets \(\mathcal{S}^j(\hat{u}_k)\); (3) the student is updated to minimize the discrepancy between its rollout predictions and the solver-induced dynamics. The teacher is a black-box oracle: no gradient flows through it, so the solver does not need to be differentiable.

SaT pipeline: rollout, multi-step solver branching, and two vectorization strategies.

Figure 1. Left: the student rolls out on-policy states from \(u_0\); the solver branches multi-step targets \(\mathcal{S}^j(\hat{u}_k)\) from each visited state. Center: the unified loss combines an on-policy dynamics term (student vs. solver chains) with an off-policy anchor term (student vs. reference trajectory). Right: two vectorization strategies — solver vectorization (one instance per branch) and state vectorization (one batched solver call per depth level).

Interactive: gradient training flow

Loss Pairings & Gradient Depth

Each solver target \(\mathcal{S}^j(\hat{u}_k)\) is compared against the student’s own prediction \(\hat{u}_{k+j}\) — not the state directly below it, but the one diagonally to the right. This diagonal connection is the key: the index formula state_idx = k + j means deeper branches train further-ahead student predictions. Toggle between BPTT (full gradient chain, depth k+j Jacobians) and DAgger/detach (detached rollout, depth-1 re-forward) to see how gradient information flows.

All branches · 15 loss terms
student state \(\hat{u}_k\) solver target \(\mathcal{S}^j(\hat{u}_k)\) loss pairing \(\ell(\hat{u}_{k{+}j},\,\mathcal{S}^j(\hat{u}_k))\) gradient flow (BPTT) detached (DAgger)
solver targets total15
gradient depthBPTT depth 1–6 Jacobians
loss terms 15 / 15 active

1. On-Policy Rollout

At each iteration the student generates \(\hat{u}_1,\dots,\hat{u}_K\) from \(u_0\) by chained forward passes of \(\mathcal{G}_\theta\). During training the horizon \(K\) grows on a curriculum. Backpropagation through time (BPTT) provides inter-step gradient signal, so a parameter change at step 0 affects the loss at step \(K\). The DAgger/detach mode gives up this signal for memory that stays constant in \(K\).

2. Multi-Step Solver Branching

From each visited state \(\hat{u}_k\) the solver computes a chain of targets \(\mathcal{S}^{j}(\hat{u}_k)\) for \(j=1,\dots,m_k\), with the natural truncation \(m_k=\min(m_{\max},\,K-k)\). Longer lookahead is used early (where the student is still close to the manifold), shorter near the end (where drift has already accumulated). The solver is treated as a black-box oracle — no gradient flows through \(\mathcal{S}\).

3. Efficient Solver Dispatch

SaT supports two complementary vectorization strategies: solver vectorization assigns each branch to an independent solver instance and runs its full chain in parallel (works with any black-box time-stepper); state vectorization iterates over depth level \(j\) and concatenates all active branches into a single batched solver call (e.g. via jax.vmap; 12.7–14.2× faster than sequential execution in our benchmark). State vectorization is the default backend.

Problem. Branching adds \(\sum_k m_k\) solver calls per step: run one by one, they take 80%+ of it.
Solver time per training step on KF2D at 160 squared with K = 10 and m_max = 5: sequential 464 ms, solver-vectorized 102 ms (4.6 times faster), state-vectorized 33 ms (14 times faster).
Fix. One jax.vmap call per depth \(j\) (14×): SaT costs only 22% more than SFT with the same rollout.
Time per training step with PDE-S on KF2D: SFT with S = 5 takes 172 ms, SaT with K = 5 takes 210 ms (22% more), SFT with S = 15 takes 504 ms, and OPD with K = 5 takes 805 ms, 88% of it in the FM teacher.

Both measured on KF2D (\(160^2\)) with batch size 4 on one NVIDIA L40S; the training-step chart uses the PDE-S student. SFT with \(S{=}15\) unrolls as many steps as SaT with \(K{=}5\) makes solver calls.

4. Unified Training Objective

The loss interpolates between an on-policy dynamics term and an off-policy anchor term:

$$\mathcal{L} \;=\; (1{-}\alpha)\,\mathcal{L}_{\mathrm{dyn}}\;+\;\alpha\,\mathcal{L}_{\mathrm{anchor}}, \qquad \mathcal{L}_{\mathrm{dyn}} \;=\; \frac{1}{W_{\mathrm{dyn}}}\sum_{k=0}^{K-1}\sum_{j=1}^{m_k}\gamma^{k}\lambda^{j-1}\,\ell\bigl(\hat{u}_{k+j},\,\mathcal{S}^{j}(\hat{u}_k)\bigr)$$

Here \(\hat{u}_0=u_0\), \(\gamma,\lambda\in(0,1]\) decay the weights with the rollout position and the branch depth, and \(W_{\mathrm{dyn}}\) is the sum of the weights. \(\mathcal{L}_{\mathrm{anchor}}\) compares the rollout with the reference trajectory.

\(\alpha=0\) is SaT-0, pure on-policy solver correction; \(\alpha=0.5\) is SaT-.5; and \(\alpha=1\) is SaT-1, unrolled supervised fine-tuning with no on-policy correction signal. We recommend SaT-0 as the default, especially for chaotic systems. The per-step loss combines a pointwise \(L^2\) error and a Sobolev \(H^s\) spectral term, computed via Parseval's identity:

$$\ell(\hat{u}, u^{\mathcal{S}}) \;=\; \beta_1\,\|\hat{u} - u^{\mathcal{S}}\|_{L^2(\Omega)}^2 \;+\; \beta_2\sum_{\mathbf{k}} (1 + |\mathbf{k}|^2)^s\bigl|\hat{f}(\mathbf{k}) - \hat{f}^{\mathcal{S}}(\mathbf{k})\bigr|^2$$

where \(\hat{f},\hat{f}^{\mathcal{S}}\) are the orthonormal Fourier coefficients of the student and solver outputs and \(\mathbf{k}\) is the normalized frequency in cycles per grid cell (\(|k_i|\le 1/2\)). In the code both terms are averaged over the grid and the channels.

Mechanism, in one sentence:

SaT converts post-training from static trajectory fitting into solver-guided correction of the model's own rollout dynamics — supervision is provided exactly where the student actually goes, by a teacher that follows the governing PDE up to discretization and time-stepping error.


A Unified Post-Training Suite

SaT is one element of a unified suite that instantiates four complementary post-training objectives within the same trainer, configuration, and evaluation engine — differing only in the teacher and the loss. This enables the first systematic comparison of post-training strategies for PDE-FMs.

MethodTeacherPolicySignalSaT loss case
SFTReference trajectoriesOff-policySingle-step loss to the reference state—
PITAPDE residuals (self-supervised)On-policyPDE residuals of the student's own rollout—
OPDFrozen, fine-tuned larger FMOn-policyTeacher predictions at student-visited states—
SaT-1Reference trajectoriesOff-policy targetsUnrolled SFT against the reference trajectory\(\alpha=1\)
SaT-.5Numerical solver + referenceMixedSolver correction + reference anchor\(\alpha=0.5\)
SaT-0Numerical solverOn-policySolver correction at student-visited states\(\alpha=0\)

Results

Setup

Seven PDE tasks — Burgers2D, KS2D, KF2D (\(160^2\) on \([0,2\pi]^2\)) and Burgers3D, KS3D, KF3D, DT3D (\(64^3\) on \([0,2\pi]^3\)) — covering shocks, spatiotemporal chaos, forced turbulence, and decaying turbulence. Six pretrained PDE-FM backbones: PDE-S (Swin U-Net), MPP-B (axial ViT), DPOT-Ti (AFNO), Poseidon-T (SwinV2), P3D-S (Conv3D + windowed Transformer), MORPH-Ti (4D axial attention). All methods share the same trainer and evaluation engine, and every model is scored on 50-step autoregressive rollouts. The teacher solver is Exponax, a JAX-based ETDRK pseudo-spectral solver bridged into the PyTorch training loop. A second solver family, the finite-volume solver PICT, is used for wall-bounded turbulent channel flow (TCF3D).

In-Distribution: SaT Dominates Long Rollouts

Across 24 model–task pairs (12 in 2D, 12 in 3D), a SaT variant achieves the best per-model 50-step rollout RMSE in 23 of 24 cases; the exception is MORPH-Ti on DT3D, where OPD is slightly lower. On the cross-model aggregate, SaT-0 is best on 6 of 7 tasks, with SaT-.5 marginally better on KS3D (0.2211 vs. 0.2238). Relative to SFT the best SaT variant reduces cross-model RMSE by up to 68.8% on 2D (Burgers2D) and up to 90.0% on 3D (KS3D).

How much comes from the solver? Unrolled training (SaT-1) accounts for most of the improvement over SFT. Replacing its reference targets with solver targets (SaT-0) lowers RMSE further in 22 of 24 model–task pairs and on every task's cross-model mean, by 2.4% (Burgers3D) to 22.6% (KS3D). SaT-0 is the best method in 9 of 12 3D pairs; SaT-.5 is the best in 6 of 12 2D pairs, where the reference trajectory stays informative for longer.

In-distribution 2D rollout RMSE across architectures.
In-distribution rollout RMSE on 2D tasks averaged across four architectures.
In-distribution 3D rollout RMSE across architectures.
In-distribution rollout RMSE on 3D tasks averaged across three architectures. SaT-0 achieves the lowest cross-model RMSE on six of seven tasks; SaT-.5 is best on KS3D.

Cross-Model Aggregate Diagnostics (50-Step Rollout)

RMSE, mean ± std across evaluated architectures (4 for 2D, 3 for 3D); lower is better. Best per row bolded. PITA does not support 3D tasks (––).

TaskSFTPITAOPDSaT-1SaT-.5SaT-0
Burgers2D0.0378 ± 0.02980.0232 ± 0.01720.0193 ± 0.00960.0138 ± 0.00380.0141 ± 0.00970.0118 ± 0.0040
KF2D0.9023 ± 0.43940.8017 ± 0.26270.7845 ± 0.28270.5884 ± 0.22460.7554 ± 0.31070.5409 ± 0.2089
KS2D0.1187 ± 0.07840.1084 ± 0.05450.1016 ± 0.04220.0913 ± 0.04600.0844 ± 0.04890.0841 ± 0.0419
Burgers3D0.0154 ± 0.0042––0.0109 ± 0.00120.0082 ± 0.00150.0091 ± 0.00160.0080 ± 0.0014
KF3D0.6987 ± 0.7455––0.1423 ± 0.01430.1366 ± 0.01150.1328 ± 0.01360.1292 ± 0.0155
KS3D2.2190 ± 2.8475––0.3768 ± 0.20840.2893 ± 0.11320.2211 ± 0.03100.2238 ± 0.0440
DT3D0.2554 ± 0.2923––0.0398 ± 0.01710.0358 ± 0.01410.0374 ± 0.01470.0304 ± 0.0091

Out-of-Distribution Zero-Shot: SaT Generalizes to Shifted Physics

We perturb physical parameters: stronger nonlinear coupling for KS, stronger turbulence for KF, higher viscosity for DT3D, weakened diffusion and convection for Burgers. SaT-0 achieves the lowest cross-model RMSE on all 7 OOD tasks, with the largest gains in 3D: 81.9% on KF3D-OOD, 92.8% on KS3D-OOD, 85.1% on DT3D-OOD relative to SFT. The models are not retrained: they are post-trained on the original parameters only. During that training the student sees its own rollout states, including states that have drifted from the reference data, and the solver provides dynamically consistent supervision at each of them.

TaskSFTPITAOPDSaT-1SaT-.5SaT-0
Burgers2D-OOD0.0856 ± 0.01570.0770 ± 0.00790.0738 ± 0.00160.0727 ± 0.00140.0728 ± 0.00210.0723 ± 0.0010
KS2D-OOD0.1373 ± 0.03100.1200 ± 0.03470.1262 ± 0.02820.1251 ± 0.03070.1069 ± 0.02610.1060 ± 0.0175
KF2D-OOD2.4524 ± 0.28992.4685 ± 0.22562.4226 ± 0.21182.3316 ± 0.17382.4989 ± 0.25972.2652 ± 0.2140
Burgers3D-OOD0.0175 ± 0.0024––0.0143 ± 0.00200.0131 ± 0.00120.0141 ± 0.00200.0129 ± 0.0010
KF3D-OOD1.0658 ± 1.1758––0.2021 ± 0.00560.1988 ± 0.00420.1963 ± 0.00490.1929 ± 0.0045
KS3D-OOD2.6798 ± 3.5134––0.2897 ± 0.09610.2004 ± 0.01880.1956 ± 0.01680.1920 ± 0.0226
DT3D-OOD0.2487 ± 0.2838––0.0435 ± 0.01140.0425 ± 0.00630.0432 ± 0.00760.0370 ± 0.0028
OOD 2D RMSE across architectures.
Zero-shot OOD RMSE on 2D tasks (perturbed physical parameters), averaged across four architectures.
OOD 3D RMSE across architectures.
Zero-shot OOD RMSE on 3D tasks, averaged across three architectures. SaT-0 has the lowest cross-model RMSE on all seven OOD tasks.

SaT Rescues Temporally Under-Specified Backbones

The gains are largest for backbones whose temporal signal is weakest under SFT. P3D-S is a single-frame transformer with no temporal-history input or encoding — the weakest 3D model under SFT on all four tasks. With SaT-0 it becomes the best 3D model on Burgers3D and DT3D, with up to 97.4% RMSE reduction (DT3D: 0.6687 → 0.0175). SaT-0 reduces KF3D RMSE by 91.6% (1.7530 → 0.1478) and SaT-.5 reduces KS3D RMSE by 95.9% (6.2459 → 0.2534). The 2D sibling PDE-S shows the same pattern, with up to 73.1% on Burgers2D. Visually, SFT collapses to diffuse or sparse fields; SaT-0 recovers coherent volumetric structure aligned with the solver reference.

Volumetric fields after 50 autoregressive rollout steps.
Volumetric fields after 50 autoregressive rollout steps. Left block: DPOT-Ti on DT3D and KS3D. Right block: P3D-S on Burgers3D and KF3D. SFT collapses to diffuse, sparse, or underdeveloped structures; OPD partially improves morphology but can still miss the solver reference; SaT-0 recovers coherent volumetric structure closely matching the reference.

On-Policy Correction Removes Architecture-Specific Artifacts

Beyond aggregate metrics, on-policy solver correction repairs failure modes that are architectural fingerprints. MPP-B's SFT predictions show a pronounced \(10\times10\) grid of blocky artifacts — an architectural fingerprint of its independent per-patch sparse output projection, which reconstructs each patch without cross-patch convolution or overlap. SFT exacerbates this because the model never sees its own patchwise artifacts. SaT corrects the same failure at its source: the on-policy rollout exposes these boundary inconsistencies to the loss, and dense solver corrections force the next-step map back to a spatially coherent field.

2D predicted fields after 50 rollout steps: MPP-B and PDE-S.
Predicted 2D fields after 50 autoregressive rollout steps. MPP-B (left) and PDE-S (right) on Burgers2D and KF2D. The solver reference is shown at the center. MPP-B's SFT exhibits pronounced blocky artifacts that SaT-0 eliminates. PDE-S's Swin U-Net decoder already provides smoother SFT fields; SaT further sharpens the prediction toward the reference.

Solver Teachers Are More Reliable than Learned Teachers

OPD swaps the solver for a larger, fine-tuned PDE-FM as on-policy teacher. It closes the distribution gap but inherits the teacher's own approximation errors. On KF2D, OPD degrades DPOT-Ti relative to SFT (0.2316 → 0.4018) and PDE-S (1.0938 → 1.1566). Where OPD improves over SFT, the solver teacher still gives a lower cross-model RMSE (KS3D: OPD 0.3768 vs. SaT-.5 0.2211; DT3D: OPD 0.0398 vs. SaT-0 0.0304). Beyond accuracy, the solver teacher is also substantially cheaper: on KS3D, SaT-0 finishes training in ~3.1–5.9 h, while OPD needs ~33–37 h end-to-end (including ~14.5 h of teacher preparation), about 6–11× the SaT-0 wall-clock time.

A Second Solver: Wall-Bounded Turbulent Channel Flow

TCF3D is turbulent channel flow at \(\mathrm{Re}_\tau=180\) on a \(64\times65\times64\) grid with no-slip walls. The teacher is PICT, a PyTorch finite-volume solver with an implicit pressure projection. It shares no component with Exponax, and SaT uses it through the same solver interface. A SaT variant gives the lowest velocity RMSE after 50 steps on all three backbones, and SaT-0 the lowest cross-model RMSE.

ModelSFTOPDSaT-1SaT-.5SaT-0
DPOT-Ti0.44310.52520.41620.41380.4092
MORPH-Ti0.64020.57760.52530.51920.5060
P3D-S21.49090.81610.13880.08630.1022
Mean ± std7.5247 ± 9.87590.6396 ± 0.12660.3601 ± 0.16270.3398 ± 0.18430.3391 ± 0.1721
TCF3D velocity magnitude after 50 rollout steps for the reference, SFT, OPD, SaT-1, SaT-.5 and SaT-0.
TCF3D, velocity magnitude at t = 50 (P3D-S). SFT has diverged and OPD loses the layered channel-flow profile. All three SaT variants keep the profile and the near-wall streaks; SaT-.5 and SaT-0 remain closest to the reference.

Full 3D Rollouts

Volumetric snapshots at \(t\in\{1,10,20,30,40,50\}\) (rows) for the solver reference, the pretrained backbone, SFT, OPD and SaT-0 (columns).

DT3D, DPOT-Ti, 50-step autoregressive rollout.
DT3D, DPOT-Ti, 50-step autoregressive rollout.

Limitations

SaT needs a reliable numerical solver at training time, and its targets are accurate only up to the governing equation and its discretization. The teacher's dynamics must remain valid at the states the student visits: on KS2D, coarsening the teacher from \(128^2\) to \(80^2\), where it diverges after 36 steps, raises the student's cross-model RMSE from 0.090 to 0.268. Equations that are known to be incomplete, complex geometries and unstructured meshes are not yet tested, and the efficiency of SaT depends on successful solver parallelization.


Code

The repository covers SaT-0, the variant we recommend by default, on 3D Kolmogorov flow (KF3D): P3D-S as the student and Exponax as the teacher.

git clone https://github.com/tum-pbs/Solver-as-Teacher
cd Solver-as-Teacher
pip install -e '.[solver,models]'

# evaluate the released weights
sat-download-weights kf3d-sat0
sat-download-data --subsets kf3d --splits test
python examples/kolmogorov/evaluate.py examples/kolmogorov/kf3d_sat0.yaml \
  --checkpoint Weights/released/p3d_s_kf3d_sat0.pt

# or train them yourself
sat-download-weights p3d                     # pretrained P3D-S
sat-download-data --subsets kf3d             # KF3D data
sat-train --config examples/kolmogorov/kf3d_sat0.yaml
python examples/kolmogorov/evaluate.py examples/kolmogorov/kf3d_sat0.yaml

BibTeX

@inproceedings{wei2026sat,
  title     = {Solver-as-Teacher: Solver-Guided On-Policy Post-Training
               Framework for {PDE} Foundation Models},
  author    = {Hao Wei and Shangzhe Li and Nils Thuerey},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2026}
}