Diffeomorphic gauge-fixing layer
Implementation & benchmark of arXiv:2607.06536 — The Right Space for Dynamics: Numerics with Diffeomorphism Equivariance
Source paper: The Right Space for Dynamics: Numerics with Diffeomorphism Equivariance arXiv:2607.06536 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Insert a differentiable spatial canonicalization module before a neural dynamics model. It estimates a smooth invertible coordinate transformation that places each input field in a common gauge relative to a reference template, predicts the next state in that gauge, and maps predictions back to the original coordinates. The module should reduce the need for the dynamics network to relearn identical laws under many smooth spatial reparameterizations.
Formulas
Mathematical statement
The paper considers states u belonging to C∞(M, Rᵈ), where M is the spatial manifold and d is the number of field channels. A diffeomorphism g in Diff(M) acts on a state by a(g, u) = u ∘ g⁻¹, so the transformed field at location x is u(g⁻¹(x)). The dynamics du/dt = F(u) are equivariant when F(a(g, u)) = a(g, F(u)), meaning that transforming coordinates before applying the vector field gives the same result as applying the vector field first and transforming afterward. The adaptation estimates a warp gᵤ by minimizing E(g; u, r) = ||u ∘ g⁻¹ − r||²₂ + λR(g), where r is a reference field, λ > 0 is a regularization weight, and R(g) = ∫ₘ ||∇(g(x) − x)||²_F dx + ε∫ₘ ||Δg(x)||²₂ dx. Here id(x) = x is the identity coordinate map, ∇ is the spatial Jacobian, Δ is the componentwise Laplacian, and ε > 0 discourages oscillatory warps. The canonical state is z = a(gᵤ, u) = u ∘ gᵤ⁻¹. A predictor H is trained in canonical coordinates, and the original-frame prediction is reconstructed as ûₜ₊₁ = a(gᵤ⁻¹, H(a(gᵤ, uₜ))). The useful property is commutation of prediction with coordinate changes.
Implementation notes
1. Integration point: wrap a CNN, U-Net, neural operator, or latent world model whose input is a spatial tensor uₜ with shape batch × channels × height × width. Add a small WarpNet that predicts a stationary velocity field vᵤ(x) with two spatial components. Convert it to a smooth warp gᵤ = exp(vᵤ) using scaling-and-squaring. For a first MVP, use the simpler bounded map gᵤ(x) = x + α tanh(vᵤ(x)), with α less than one eighth of the smaller image dimension. 2. Pseudocode: v = WarpNet(u, reference); g = exp_velocity(v); z = grid_sample(u, inverse(g)); z_next = DynamicsNet(z); u_hat = grid_sample(z_next, g); loss = MSE(u_hat, target) + λ times warp_smoothness(g) + η times cycle_error(g, inverse(g)). The alignment loss is mean squared error between z and reference, plus the displayed Jacobian and Laplacian penalties. 3. Use bilinear grid sampling for both warps. With stationary velocities, approximate the inverse by exp(−v). Compute the mathematical components explicitly: the group action, inverse composition, smoothness energy, and equivariance consistency. Estimate the reference field as either a learnable tensor or the batch mean, and learn WarpNet and DynamicsNet jointly. For augmentation consistency, sample a random smooth warp h and add MSE(Predict(h(u)), warp(Predict(u), h)). 4. First experiment: generate two-dimensional advection or reaction-diffusion trajectories, then apply independent smooth Fourier displacement fields or thin-plate-spline warps to each trajectory. Compare a U-Net dynamics baseline, a conventional spatial-transformer baseline, and this model at matched parameter count. Evaluate one-step MSE, 20- to 50-step rollout error, accuracy on unseen warp amplitudes, and normalized equivariance error ||P(a(h,u)) − a(h,P(u))||₂ divided by ||P(u)||₂ plus 10⁻⁸. A successful result is lower long-horizon error and better accuracy with fewer training trajectories, while the extra WarpNet costs less than approximately 10 percent of baseline inference FLOPs.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a self-contained PyTorch MVP with differentiable grid-sampled gauge transforms, a learned bounded translation gauge, canonical-space dynamics, and explicit group-action checks. Composition and inverse-cycle errors were small but nonzero due to bilinear interpolation and zero padding. The gauge model improved equivariance error (0.0272 vs 0.0333) but worsened one-step MSE (1.45e-5 vs 8.59e-6) and 20-step rollout MSE (0.0296 vs 0.0294), with higher runtime and parameter count; the claimed overall win was not observed.
- Agent confidence
- 9/10
- Baseline
- one-step MSE 8.5903e-06; 20-step MSE 0.0294243; equivariance error 0.0332526; 17.88 s; 2,881 parameters
- Idea
- one-step MSE 1.4466e-05; 20-step MSE 0.0295656; equivariance error 0.0271641; 20.74 s; 3,107 parameters
- Math sanity
- translation composition absolute error 0.001642; inverse-cycle absolute error 0.002603
Limitations: This tests a small translation-only proxy rather than a full 2D stationary-velocity diffeomorphism with scaling-and-squaring, Jacobian/Laplacian regularization, or a U-Net. Only one seed and one toy advection law were tested; no warp-amplitude sweep, sample-efficiency study, FLOP accounting, or repeated-seed analysis was performed. CUDA grid sampling failed in the shared environment, so the run used CPU fallback.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 5.7 KB View Raw
- report.md 1.5 KB View