△ Mechanism confirmed, baseline not beaten 2026

Symplectic Hamiltonian Optimizer

Implementation & benchmark of arXiv:2607.09549 — Backward error analysis for matrix discretizations of 2-D Euler equations

Usefulness6/10
Difficulty4/10
Novelty4/10

Source paper: Backward error analysis for matrix discretizations of 2-D Euler equations arXiv:2607.09549 ⓘ · analyzed Aug 30, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Augment neural-network parameters with momentum variables and update the pair using a symplectic map generated by a Hamiltonian. The optimizer approximately preserves a modified Hamiltonian, reducing systematic energy drift and potentially making long unrolled optimization more stable.

Formulas

$$\dot{y}=X_H(y),\qquad X_H=J^{-1}\nabla H,\qquad J=\begin{bmatrix}0&-I\\ I&0\end{bmatrix}.$$
$$a(\tau\to\gamma)+a(\gamma\to\tau)=a(\tau)a(\gamma)\quad\text{for }\tau,\gamma\in T.$$
$$\Phi_h(y)=y+B_f(a)(y)=y+B_{\tilde f_h}(1/\gamma)(y).$$
$$\tilde f_h=J^{-1}\nabla\tilde H_h,\qquad \tilde H_h=H+h^pH_p+\mathcal O(h^{p+1}).$$

Mathematical statement

The paper starts from a Hamiltonian system $\dot{y}=X_H(y)$, where $y$ is a phase-space state, $H$ is the Hamiltonian, and in canonical coordinates $X_H=J^{-1}\nabla H$ with $J=\begin{bmatrix}0&-I\\ I&0\end{bmatrix}$. A symplectic Runge–Kutta method has coefficient map satisfying $a(\tau\to\gamma)+a(\gamma\to\tau)=a(\tau)a(\gamma)$ for rooted trees $\tau,\gamma$. Backward error analysis represents the discrete map as an exact flow of a modified vector field, $\Phi_h(y)=y+B_f(a)(y)=y+B_{\tilde f_h}(1/\gamma)(y)$, where $h$ is the step size, $B_f(a)$ is a Butcher-series increment, $\gamma$ is the tree factorial, and $\tilde f_h$ is the modified vector field. For a Hamiltonian system, $\tilde f_h=J^{-1}\nabla\tilde H_h$ for a modified Hamiltonian $\tilde H_h$. We use this invariant-preserving construction for a parameter–momentum optimizer and measure the resulting energy drift empirically.

Implementation notes

Integrate this at the optimizer-update level. For parameters $\theta\in\mathbb R^d$, maintain momentum $p\in\mathbb R^d$ and define $H(\theta,p)=L(\theta)+\frac12p^\top M^{-1}p$, where $L$ is the minibatch loss and $M=\operatorname{diag}(m_i)$ is a positive mass vector. Use leapfrog: (1) compute $g=\nabla_\theta L(\theta)$ and set $p\leftarrow p-(h/2)g$; (2) set $\theta\leftarrow\theta+hM^{-1}p$; (3) recompute the gradient at the new parameters; (4) set $p\leftarrow p-(h/2)g$. This is a symplectic splitting of the canonical Hamiltonian dynamics. Compare against SGD with momentum and AdamW using the same number of gradient evaluations. Estimate the leading modified-energy behavior from pilot runs by recording $H_t$ and fitting $\Delta H_t=H_t-H_0$ against $h^p$ for $p\in\{1,2,3,4\}$. The mathematical structure is exact for the leapfrog map; the useful constants and stable step range must be estimated empirically. Initially omit weight decay, then test decay as a separate post-step operation. Use a two-layer MLP on MNIST or CIFAR-10, ten seeds, matched parameter count and gradient evaluations, and sweep $h$ and scalar masses. Measure loss versus optimizer steps, final validation accuracy, gradient norms, parameter oscillation, and divergence frequency. Success is lower long-horizon energy and gradient drift, fewer divergent runs, or better accuracy at equal compute.

Verification

Mechanism confirmed, baseline not beaten

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Confirmed ✓

Stage 2 · Practical benchmark result: Significantly worse ✗

Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works

Stage 1 — Mechanism check agent confidence 8/10

Built a PyTorch leapfrog parameter-momentum optimizer and compared it with SGD-momentum and AdamW on a small standardized digits MLP. On the harmonic oscillator, leapfrog preserved phase-space volume to numerical precision and its energy oscillation scaled as h^2 (slope 1.9999), while explicit Euler showed catastrophic energy growth. However, at 240 gradient evaluations the optimizer reached 0.9489 validation accuracy versus 0.9622 for SGD-momentum and 0.9644 for AdamW, so no practical training win was observed.

Agent confidence
8/10
Baseline
SGD-momentum: val accuracy 0.9622, val loss 0.1402; AdamW: val accuracy 0.9644, val loss 0.1341; 240 gradient evaluations
Idea
Leapfrog: val accuracy 0.9489, val loss 0.2772, 120 optimizer steps using 240 gradient evaluations; harmonic energy-range scaling slope 1.99993 and Jacobian determinant approximately 1.0

Limitations: Only one small digits dataset, one seed, one leapfrog step size/mass, and 240 gradient evaluations were tested. No ten-seed study, step-size/mass sweep, long-horizon neural energy measurement, weight-decay variant, FLOP-normalized timing study, or MNIST/CIFAR experiment was performed.

How to run: python3 verify.py && /home/maxwelhelp/main/bin/python3 experiment.py

Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.09549)

Significantly WORSE than the tuned baseline (+816.5%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Tabular regression (Friedman)
Model
mlp_tiny
Paired seeds
8
Baseline mean
20.8748
Idea mean
191.3271
Effect (Δ)
170.4523 (+816.5%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
n/a
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 6 configs
Limitations:

Only tabular/mlp_tiny was tested, with 8 epochs and mass=1.0. No longer-horizon, larger-model, vision, or dynamics run was performed; leapfrog weight decay was not separately tested.

How to run: python3 stage2_bench.py

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Stage 2 — Benchmark latest Failed ✗

Agent confidence: 10/10

Implemented leapfrog parameter-momentum updates and compared them with tuned Adam on the structurally appropriate tabular Friedman#1 benchmark using identical mlp_tiny systems and eight paired seeds. The trained-model energy signature confirmed approximately quadratic energy oscillation scaling, but leapfrog test MSE was much worse, so no practical benchmark win was observed.

Baseline
Adam lr=0.003, weight_decay=0.0; 8-seed test MSE mean=20.874786, std=4.428642
Comparison
paired delta idea-baseline=+170.452267; idea wins=0/8; permutation p=0.0081
Idea
Leapfrog h=0.006, mass=1.0; 8-seed test MSE mean=191.327053, std=10.504083

Benchmark result

Significantly WORSE than the tuned baseline (+816.5%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Tabular regression (Friedman)
Model
mlp_tiny
Paired seeds
8
Baseline mean
20.8748
Idea mean
191.3271
Effect (Δ)
170.4523 (+816.5%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
n/a
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 6 configs
Limitations:

Only tabular/mlp_tiny was tested, with 8 epochs and mass=1.0. No longer-horizon, larger-model, vision, or dynamics run was performed; leapfrog weight decay was not separately tested.

How to run: python3 stage2_bench.py

Artifacts

Implementation overview ⬇ Download all as ZIP 8 files · code, reports and structured results