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%.
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.
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.
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.
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.
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
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.
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\).
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}\).
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.
jax.vmap call per depth \(j\) (14×): SaT costs only 22% more than SFT with the same rollout.
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.
The loss interpolates between an on-policy dynamics term and an off-policy anchor term:
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:
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.
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.
| Method | Teacher | Policy | Signal | SaT loss case |
|---|---|---|---|---|
| SFT | Reference trajectories | Off-policy | Single-step loss to the reference state | — |
| PITA | PDE residuals (self-supervised) | On-policy | PDE residuals of the student's own rollout | — |
| OPD | Frozen, fine-tuned larger FM | On-policy | Teacher predictions at student-visited states | — |
| SaT-1 | Reference trajectories | Off-policy targets | Unrolled SFT against the reference trajectory | \(\alpha=1\) |
| SaT-.5 | Numerical solver + reference | Mixed | Solver correction + reference anchor | \(\alpha=0.5\) |
| SaT-0 | Numerical solver | On-policy | Solver correction at student-visited states | \(\alpha=0\) |
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).
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.
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 (––).
| Task | SFT | PITA | OPD | SaT-1 | SaT-.5 | SaT-0 |
|---|---|---|---|---|---|---|
| Burgers2D | 0.0378 ± 0.0298 | 0.0232 ± 0.0172 | 0.0193 ± 0.0096 | 0.0138 ± 0.0038 | 0.0141 ± 0.0097 | 0.0118 ± 0.0040 |
| KF2D | 0.9023 ± 0.4394 | 0.8017 ± 0.2627 | 0.7845 ± 0.2827 | 0.5884 ± 0.2246 | 0.7554 ± 0.3107 | 0.5409 ± 0.2089 |
| KS2D | 0.1187 ± 0.0784 | 0.1084 ± 0.0545 | 0.1016 ± 0.0422 | 0.0913 ± 0.0460 | 0.0844 ± 0.0489 | 0.0841 ± 0.0419 |
| Burgers3D | 0.0154 ± 0.0042 | –– | 0.0109 ± 0.0012 | 0.0082 ± 0.0015 | 0.0091 ± 0.0016 | 0.0080 ± 0.0014 |
| KF3D | 0.6987 ± 0.7455 | –– | 0.1423 ± 0.0143 | 0.1366 ± 0.0115 | 0.1328 ± 0.0136 | 0.1292 ± 0.0155 |
| KS3D | 2.2190 ± 2.8475 | –– | 0.3768 ± 0.2084 | 0.2893 ± 0.1132 | 0.2211 ± 0.0310 | 0.2238 ± 0.0440 |
| DT3D | 0.2554 ± 0.2923 | –– | 0.0398 ± 0.0171 | 0.0358 ± 0.0141 | 0.0374 ± 0.0147 | 0.0304 ± 0.0091 |
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.
| Task | SFT | PITA | OPD | SaT-1 | SaT-.5 | SaT-0 |
|---|---|---|---|---|---|---|
| Burgers2D-OOD | 0.0856 ± 0.0157 | 0.0770 ± 0.0079 | 0.0738 ± 0.0016 | 0.0727 ± 0.0014 | 0.0728 ± 0.0021 | 0.0723 ± 0.0010 |
| KS2D-OOD | 0.1373 ± 0.0310 | 0.1200 ± 0.0347 | 0.1262 ± 0.0282 | 0.1251 ± 0.0307 | 0.1069 ± 0.0261 | 0.1060 ± 0.0175 |
| KF2D-OOD | 2.4524 ± 0.2899 | 2.4685 ± 0.2256 | 2.4226 ± 0.2118 | 2.3316 ± 0.1738 | 2.4989 ± 0.2597 | 2.2652 ± 0.2140 |
| Burgers3D-OOD | 0.0175 ± 0.0024 | –– | 0.0143 ± 0.0020 | 0.0131 ± 0.0012 | 0.0141 ± 0.0020 | 0.0129 ± 0.0010 |
| KF3D-OOD | 1.0658 ± 1.1758 | –– | 0.2021 ± 0.0056 | 0.1988 ± 0.0042 | 0.1963 ± 0.0049 | 0.1929 ± 0.0045 |
| KS3D-OOD | 2.6798 ± 3.5134 | –– | 0.2897 ± 0.0961 | 0.2004 ± 0.0188 | 0.1956 ± 0.0168 | 0.1920 ± 0.0226 |
| DT3D-OOD | 0.2487 ± 0.2838 | –– | 0.0435 ± 0.0114 | 0.0425 ± 0.0063 | 0.0432 ± 0.0076 | 0.0370 ± 0.0028 |
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.
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.
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.
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.
| Model | SFT | OPD | SaT-1 | SaT-.5 | SaT-0 |
|---|---|---|---|---|---|
| DPOT-Ti | 0.4431 | 0.5252 | 0.4162 | 0.4138 | 0.4092 |
| MORPH-Ti | 0.6402 | 0.5776 | 0.5253 | 0.5192 | 0.5060 |
| P3D-S | 21.4909 | 0.8161 | 0.1388 | 0.0863 | 0.1022 |
| Mean ± std | 7.5247 ± 9.8759 | 0.6396 ± 0.1266 | 0.3601 ± 0.1627 | 0.3398 ± 0.1843 | 0.3391 ± 0.1721 |
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).
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.
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
@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}
}