ReViT: Rotational-equivariant Vision Transformers for Neural PDE Solvers
SAI replication review · Referee report
Summary
ReViT proposes a Vision Transformer that is rotationally equivariant on grid-based physical fields — an under-explored corner of the equivariance literature, which has focused mostly on point clouds and molecular graphs. The core move is local canonicalization: from each patch derive an frame from macroscopic reference fields (mean velocity and vorticity in 3D; image gradients on RotMNIST) via a light analytical construction (AOV) or a strain-tensor eigendecomposition (BOA), project vector features into that frame to obtain invariant tokens, run standard multi-head self-attention, and lift back through at the decoder. A hierarchical Swin-style backbone is made compatible via a "reference basis pyramid" that globalises features before pooling/interpolation and re-localises afterward, plus a rebased relative positional encoding that keeps directional anisotropy while remaining invariant to global rotations. The design cleanly separates equivariance from feature learning and is architecture-agnostic — a genuine conceptual contribution beyond canonicalization work that has mostly lived in the graph/point-cloud world.
The empirical range is strong (RotMNIST, 2D advection vs graph baselines, 2D Kolmogorov flow, 3D MHD, 3D turbulent channel flow), and the exact-equivariance backbone reproduces cleanly: the released ReViT code recovers a rotational-equivariance defect at float64 noise () across the chiral octahedral group , and ReViT-side MSE on MHD and TCF replicates within a few percent. The main methodological limitation is that the "exact equivariance" story is more fragile than the paper acknowledges: the non-equivariant fallback for collinear/quiescent patches, the underspecified frame of the decoder's canonical query grid, and the reliance on a bespoke basis-aware self-attention for RotMNIST all undercut the strictness claim. The 3D continuous-rotation story is inferred rather than tested, several headline percentages do not reconcile with the appendix tables, and the release ships no competing baselines — every "ReViT beats X" ranking currently depends on paper-supplied numbers. The idea is a real contribution, but the paper trades away rigor at the very seams where the equivariance guarantee matters most.
Strengths
- Conceptual contribution. Bringing local canonicalization into grid-based Vision Transformers, and doing it in a way that keeps the standard optimized multi-head self-attention intact, is a genuinely useful move. The construction is architecture-agnostic and the reference basis pyramid is an elegant way to make merging/expansion compatible with per-patch bases.
- Clear diagnostic of why standard ViTs fail. Section 3.1's separation into the tokenization barrier, positional-encoding failure, and Schur-lemma representational mismatch usefully organises the equivariance problem for vector fields on grids and would be citable in its own right.
- Exact equivariance holds up under execution. Running the shipped
scripts/test_equivariance.pyon the released ReViT-3D checkpoint yields a rotational-equivariance defect of (worst relative error ) over all 24 elements of ; the per-angle rollout MSE on MHD (0.0079) and TCF (0.00179) is identical to significant figures across every rotation, exactly as perfect equivariance predicts. The invariant-embedding claim (MSE for rebased features) similarly reproduces at . - Breadth of empirical evaluation. RotMNIST, 2D advection, 2D KF, 3D MHD, and 3D TCF span classification, scalar rollout, and vector rollout, plus a comparison surface that includes group-equivariant ViTs, GNN-equivariant baselines, L-GATr, and modern PDE transformers. The KF orthogonal-pair analysis (Figure 5) is a particularly clean lens on equivariance vs augmentation.
- Theoretical framing of the approximate-vs-exact story. Proposition G.1 and the / separation give the reader a clear vocabulary for what is guaranteed and what is not, and the KF sweep at increments actively investigates that gap rather than hiding behind grid-aligned rotations.
- Compute-favourable design. Avoiding the group-lifting that inflates GSA/GE-ViT memory (1.81 GB vs 95.5 GB reported for ) is a real practical advantage, and — with the caveats on capacity control below — the 3D results with a M parameter model are notably compact.
Weaknesses
- Non-equivariant fallback silently breaks the exactness claim. The Axis Fallback for collinear/Beltrami patches (Appendix C.1.3) crosses with a globally fixed axis (then ), which does not co-rotate with the input. On any patch where the fallback triggers, fails and the exactness guarantee ceases to hold — yet the paper's summary and Proposition 4.1 never restrict the claim to non-degenerate patches. This is the biggest gap between the story ("hard-coded equivariance") and the algorithm as pseudocoded.
- Underspecified decoder equivariance. The claim that is invariant requires the fixed canonical grid to live in the patch-local frame. The text never states this; if is in the global frame the whole equivariant-decoding argument collapses. This is a Section 4.4 detail that is doing load-bearing work and should not be implicit.
- Basis-aware self-attention is a hidden ingredient for the RotMNIST result. Table 1 uses an additional RoPE-style rebasing that is only described in Appendix F.1 and never ablated. The main-body architectural comparison therefore conflates ReViT-proper with a benchmark-specific extension.
- Fair-comparison problems in the empirical suite. The RotMNIST baselines are reported at 44.67k parameters while ReViT is 2.75M (); L-GATr is reduced from 3.4M to 0.034M () before being called "suboptimal"; UNet3D is capped at 3.5M based on an unsupported convergence claim while other 3D baselines run at M; and the advection comparison evaluates ReViT on a bilinearly-interpolated regular grid while GNN baselines run on the native mesh. Individually each choice is defensible; collectively they mean the accuracy contrasts are not parameter- or representation-controlled.
- 3D continuous-rotation robustness is not evaluated. All 3D results use the grid-aligned group , exactly where ReViT is mathematically forced to . The approximate- story is only tested in 2D (KF, sweep). It is not clear whether the "hard constraint" narrative survives non-grid-aligned rotations in 3D, especially given the fallback issue above.
- Statement/table inconsistencies undermine the numbers. The Schur's Lemma statement is not universally valid for the 2D vector representation over ; the formula's denominator is degenerate as written; Table 1's GSA-Nets timings are non-monotonic in against the paper's own argument; the KF2D " MSE reduction" does not reconcile with Table 7's (); the coincidence of as both a runtime overhead and an accuracy improvement warrants a double-check; P3D appears at both M and M parameters; TCF improvement is quoted at both and without a shared baseline label. None fatal in isolation, collectively they erode trust.
- Boundary-effect mitigation is asserted, not shown. The shifted-window attention "averaging out" and hierarchical merging "absorbing" boundary inconsistencies (Section 4.5) is intuition rather than a controlled measurement; the bound in Appendix G is about interpolation, not patch-boundary crossings.
- Minor conceptual and wording overreach. "First Transformer natively rotationally equivariant for grid-based scalar and vector fields" ignores GSA/GE-ViT on the scalar side (which the paper itself concedes); the conclusion characterises ReViT as enforcing symmetry "as a hard constraint" without qualifying that continuous rotations are only approximately equivariant; the example claimed as "maximising" grid mismatch contradicts Figure 17 (which peaks at offsets); the AViT axial-attention description conflates spatial axes with channels; "same parameter count (M vs M)" is internally contradictory.
- Missing displayed equations in Appendix C. Multiple sentences in Appendix C.2 and C.3 end with a colon that would ordinarily introduce a displayed formula (strain tensor definition, patch averaging, eigendecomposition, projection, chirality enforcement, structure tensor construction, mean-gradient AOG basis), but no formula appears in the rendered text — if these are genuinely absent from the PDF, the mathematical specification of BOA and the scalar-field adaptations is incomplete.
Reproducibility & code
Execution was based on the real implementation at github.com/tum-pbs/revit; the paper's project-website workspace itself contains only static assets, but the linked repo does run once the gaps below are patched. Overall, ReViT's own numbers reproduce closely; the missing pieces are all on the comparative-baseline side.
- Equivariance backbone reproduces at machine precision.
scripts/test_equivariance.pyconfirms across all 24 elements of for ReViT-3D (defect ), and the shipped ReViT-3D checkpoint yields per-angle rollout MSE across every MHD rotation and across every TCF rotation (spread ). The BOA/AOV rebasing is likewise numerically zero to . - ReViT's own accuracy reproduces closely; baseline halves do not. Reproduced ReViT-3D MSE tracks the paper within a few percent (MHD vs ; TCF vs , in units), and using the paper's AViT baseline the MHD-headline arithmetic recomputes to . But no baseline (AFNO, P3D, UNet3D, Swin3D, AViT, PDEArena UNet, GSA-Nets, GE-ViT, PDETrans/PDETrans-Aug, L-GATr) is included in the release, so every "ReViT beats X" ranking — Table 2's leaderboard, the vs polar figure, the "up to " and " over AViT" headlines, the PDEArena-UNet comparison, and the KF augmentation studies — is only checkable on ReViT's side.
- RotMNIST comparison is not turnkey. The repository has no training entry point for classification;
Train_rollout.pyhandles only rollout tasks, and a standalone classification driver had to be written around the shippedEqVisionTransformerClassificationmodule. That from-scratch driver reached (paper ; pp gap consistent with training-recipe drift), which drops ReViT just below GE-ViT () and GSA-Nets () if the paper's baseline numbers are trusted. The memory/speed comparison (, ) could not be exercised at all — no baseline code, no profiling harness. - KF2D training data is only shipped for angle 0. The KF2D trainer hard-requires pre-rotated data files (
{base}_{split}_V_{angle}.npy) at every augmentation angle, but the HuggingFace release provides only angle 0; without a data-prep script (written in this run using the repo's ownrotate_vector_field), the trainer fails out of the box. This blocks Table 3 / Figure 5 for a naive reproducer. - 2D Advection data is unreleased. The config helper points to
adv_*_uniform_grid.pklfiles absent from HuggingFace (README marks them "coming soon", confirmed via the HF API), so no ADV_2D number in Section 5.3 — the MSE reduction over PDETrans, the compute overhead, the stability curve, and the graph-vs-transformer comparison — can be exercised end-to-end. - KF2D augmentation policy is opaque. "Random augmentation angle" leaves undefined the distribution, sampling frequency, and effective dataset size; Table 7's column is likewise ambiguous. Since PDETrans-Aug is the main non-equivariant comparison, none of the KF-augmentation claims are reproducible without this policy in code or a table.
- KF equivariance-error metric is not written down. The "relative difference in MSE" that drives the , , and headline numbers in Section 5.4 is defined only in prose; a reader cannot reproduce or interpret the sign convention.
- Per-seed variance is under-documented. Table 2 lists ReViT std as on both MHD and TCF; the reproduced per-angle MSE is genuinely constant to significant figures on a single checkpoint, but the paper does not say whether is rounding or a genuine near-machine-precision seed spread. Releasing per-seed values would resolve this.
- ReViT-3D configuration is not derivable from the text. "Halve the depth configuration " alone does not land on the reported M parameters — widths, decoder capacity, and heads matter. A tabulated per-stage configuration is needed for anyone reimplementing.
- 3D efficiency and architectural-variant sweeps are un-runnable. Table 8 (3D benchmark efficiency) and Table 10 (Tri/LQ att/mean ) rely on timing/memory/GFLOPs for ReViT and every baseline; the release ships no profiling harness and no baseline checkpoints, so none of those cells can currently be reproduced.
Recommended Changes
Essential
- Fix the fallback so exactness is not silently violated. Replace the fixed-global-axis Axis Fallback (Appendix C.1.3) with an equivariant tie-break (e.g., a strain eigenvector, or a rotation-equivariant projection derived from another co-rotating field). If this is not possible, restrict Proposition 4.1 and every "exact -equivariance" statement to the non-degenerate patch set and report the fraction of patches that trigger the fallback on each benchmark.
- State the frame of the decoder's canonical query grid. In Section 4.4, add a sentence (and, if needed, an equation) making it explicit that and its Fourier features live in the patch-local frame; the equivariance of hinges on this and it is currently implicit.
- Ablate and disclose the basis-aware self-attention on RotMNIST. Report Table 1 accuracy both with and without the RoPE-style mechanism, and either introduce it in the main-body architecture or clearly label it a RotMNIST-specific extension.
- Fix the metric equation. Rewrite the denominator so it is not — use (or state the intended definition explicitly) in both Section 4.5 and Appendix H.
- Reconcile the tables/numbers that don't match. In particular: KF2D " MSE reduction" vs Table 7's ; TCF "" vs ""; P3D M vs M; whether the 2D coincidence is genuine. Please either fix or state the baseline explicitly for each percentage.
- Level the empirical comparisons. Report parameter-matched RotMNIST (either scale baselines up or ReViT down); run L-GATr at a competitive parameter budget on Adv (or explicitly caveat the reported L-GATr is smaller); run UNet3D at M with evidence for the "convergence difficulties" claim, or explain why M is fair; and quantify the bilinear-interpolation error floor on the Adv regular-grid pipeline so the reader can separate representation from architecture.
- Add a 3D continuous-rotation evaluation. Test MHD (which is periodic) at non-grid-aligned angles with periodic domain expansion analogous to KF, and report either an isotropy-averaged metric or a sweep. Without this, the "hard constraint" narrative in 3D rests entirely on grid-aligned rotations where equivariance is mathematically forced.
- Release the baseline models and the missing scientific tooling. Add (i) ReViT baseline implementations/checkpoints (AFNO, P3D, UNet3D, Swin3D, AViT, GSA-Nets, GE-ViT, PDETrans/PDETrans-Aug, L-GATr, PDEArena UNet) needed for Tables 1, 2, and Figure 3; (ii) a
train_classification.py(or equivalent) so the RotMNIST result is reachable without an ad-hoc driver; (iii) the ADV_2D.pklinputs (or a deterministic preparation script from the REMUS mesh data); (iv) a data-prep script that produces the pre-rotated KF2D{base}_{split}_V_{angle}.npyfiles the trainer requires; and (v) an inference/train-time profiling harness for Tables 8 and 10.
Suggested
- Document the PDETrans-Aug policy and Table 7 x-factor. Tabulate the angle distribution, sampling frequency, periodic-padding treatment, and effective dataset size for each augmentation variant.
- Release per-seed metric values behind Table 2's std. If the near-zero spread is genuine, that is independently notable and worth foregrounding rather than hiding behind rounding.
- Tabulate the full ReViT-3D configuration. Per-stage depths, embed dims, heads, and decoder settings, so the M parameter count is independently derivable.
- Qualify or drop the "first for grid-based scalar and vector fields" claim. Restrict to vector fields (which is the real contribution) or to "the first grid-based Transformer that is equivariant while natively handling both scalar and vector inputs."
- Rewrite the Schur's Lemma paragraph. State that is the real-type case (); note that the 2D vector representation of is of complex type with a two-parameter commutant . The broader "unconstrained breaks equivariance" argument is unaffected.
- Correct the absolute-PE equation. Replace with the intended non-equality, since the equality as written implies the opposite of the sentence's conclusion.
- Support or downgrade the boundary-effect claim. Replace "averaging out" and "absorbing" with a controlled measurement (e.g., equivariance defect as a function of hierarchical depth or window shift), or explicitly label the paragraph as intuition.
- Soften the "proving" and "hard constraint" language. Replace "proving that hard-coded equivariance is effective for grid-based neural PDE solvers" with "demonstrating on KF that..." and qualify the conclusion's "hard constraint" to reflect the exact- / approximate- split.
- Clarify the intra-patch set-attention aggregator. State explicitly that the local set-attention omits positional encoding, and clarify whether it is a distinct block from the main W-MSA.
- State the 3D handedness convention explicitly. Write in the main body — the sign convention is load-bearing.
- Write down the KF equivariance-error metric formula in Section 5.4 so the , , and percentages can be interpreted and reproduced.
- Fix the smaller nits. Correct the example in Section E.2 (Figure 17 peaks at offsets); fix the AViT parenthetical "(channels)" to "(spatial axes)"; adjust "same parameter count (M vs M)" to "comparable"; either state explicitly in the main body or move Algorithm 1 up into Section C.1.4 where the text refers to it; reconcile the BOA singularity criteria in Section C.2.3 with what Algorithm 1 actually checks; verify the displayed equations in Appendix C.2/C.3 render in the compiled PDF; cite the actual originators of invariant graph networks (Maron et al.) and Tensor Field Networks (Thomas et al.); and exclude AFNO from the "" statement given its std.
- Report the fallback activation fraction and a sensitivity analysis to . The magnetic-vs-velocity difference is drawn from a single MHD regime; documenting how the degenerate-patch fraction varies with , (and other flow regimes) strengthens the generality argument and directly interacts with the exactness fix above.