Lie-Poisson Hamiltonian latent block
Implementation & benchmark of arXiv:2607.21813 — The two momenta of an elastic rod: a Hamiltonian picture on framed Lie groups
Source paper: The two momenta of an elastic rod: a Hamiltonian picture on framed Lie groups arXiv:2607.21813 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace an unconstrained latent ODE or recurrent update with Hamiltonian dynamics on a product of Euclidean coordinates and a Lie-algebra momentum. The momentum dynamics contain the explicit coadjoint term generated by the Lie-group structure constants, allowing the model to represent rotational or frame-dependent memory without learning this antisymmetric coupling from data.
Formulas
Mathematical statement
Let q ∈ ℝⁿ be latent position, p ∈ ℝⁿ its momentum, and Hθ(q,p) a learned scalar Hamiltonian. Let cᵃᵢⱼ be Lie-algebra structure constants defined by [bᵢ,bⱼ] = cᵏᵢⱼ bₖ. The paper's Poisson bivector is 𝒥 = Dqᵢ ⊗ Dpⁱ − Dpⁱ ⊗ Dqᵢ + pₐ cᵃᵢⱼ Dpʲ ⊗ Dpⁱ, giving ż = 𝒥(z)∇Hθ(z). In coordinates, q̇ᵢ = ∂Hθ/∂pᵢ and ṗᵢ = −∂Hθ/∂qᵢ + pₐ cᵃᵢⱼ ∂Hθ/∂pⱼ. For SO(3), cᵃᵢⱼ = εₐᵢⱼ, so the additional term is a cross product. If Hθ is autonomous, dHθ/dt = ∇Hθᵀ𝒥∇Hθ = 0 because 𝒥 is antisymmetric.
Implementation notes
Use this block as the transition function inside a latent state-space model, Hamiltonian RNN, or world model. Encode an observation into q₀ and p₀, evaluate a neural scalar Hamiltonian Hθ(q,p) with an MLP, and integrate the resulting ODE for one or more prediction steps. For rotational latents, use n = 3 and hard-code cᵃᵢⱼ = εₐᵢⱼ; for a general Lie algebra, store c[a,i,j] and enforce antisymmetry in i and j. Pseudocode is: compute H; obtain qdot = gradient of H with respect to p; obtain pdot = minus the gradient of H with respect to q; add pdot[i] += p[a] c[a,i,j] qdot[j]; then advance z with implicit midpoint or a Lie-group-aware symplectic method. For implicit midpoint solve z_next = z + Δt 𝒥((z + z_next)/2) gradient H((z + z_next)/2) using three to five Newton iterations. The structure constants are computed from the chosen group, gradients use automatic differentiation, and energy drift is measured empirically. First test a synthetic rigid-body or rotating-pendulum sequence against a GRU and a standard Hamiltonian neural ODE at equal parameter count, using 100 to 500 step rollouts. The prediction is bounded oscillatory energy error of order Δt² with midpoint integration, whereas Euler has secular drift of order TΔt. Removing the coadjoint term should increase orientation phase error at nonzero momentum, while both variants should agree when p = 0.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
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 self-contained SO(3) Lie-Poisson rigid-body experiment with explicit coadjoint coupling, implicit midpoint integration, Euler baseline, and no-coadjoint ablation. The core predictions were confirmed: antisymmetry and energy conservation held to machine precision, the coadjoint effect vanished at p=0, momentum scaling was 2.06 versus predicted 2, and nonlinear midpoint state error showed approximately second-order timestep scaling.
- Agent confidence
- 8/10
- Baseline
- Explicit Euler had maximum energy error 0.1004 at T=10 and fitted timestep drift exponent 1.09.
- Idea
- Implicit midpoint had maximum free-system energy error 6.33e-15; zero-momentum ablation difference 0; momentum exponent 2.06; nonlinear refined convergence approximately O(dt^2); terminal full-versus-ablated momentum error 0.373.
Limitations: This was a toy analytic rigid-body test, not a learned latent neural block. No GRU, neural ODE, encoder, parameter matching, dataset benchmark, GPU benchmark, or wall-clock/FLOP comparison was tested.
How to run: cd /home/maxwelhelp/all/math2nn/experiments/exp1255_lie-poisson-hamiltonian-latent-block && /home/maxwelhelp/main/bin/python3 experiment.py && /home/maxwelhelp/main/bin/python3 nonlinear_check.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.21813)
Significantly WORSE than the tuned baseline (+361.3%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0059
- Idea mean
- 0.0271
- Effect (Δ)
- 0.0212 (+361.3%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the built-in dynamics track was tested; no longer-horizon rollout metric, implicit midpoint integration, larger latent sizes, alternative Hamiltonian parameterizations, or wall-clock comparison was evaluated.
How to run: python3 bench_run.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 an end-to-end Lie-Poisson Hamiltonian recurrent block and evaluated it against a matched vanilla recurrent system using the shared dynamics task, parity-matched learning-rate sweep, and 8 paired seeds. The idea was significantly worse: test MSE 0.02712 versus 0.00588 for the baseline, paired delta +0.02124 with permutation p=0.0081. The trained-model signature observed momentum-scaling exponent 0.885 rather than the predicted quadratic scaling, so the mechanism prediction was not confirmed.
- Baseline
- Best lr=0.003; 8-seed mean test MSE 0.0058796 ± 0.0028056.
- Idea
- Best lr=0.01; 8-seed mean test MSE 0.0271235 ± 0.0049414; paired delta +0.0212439; p=0.0081; 0/8 paired wins.
- Mechanism signature
- map[confirmed:false observed_loglog_exponent:0.8853167356267617 observed_rms_effect:[0.007525605789851397 0.014394661411643028 0.025677648605778813] scales:[0.25 0.5 1]]
Benchmark result
Significantly WORSE than the tuned baseline (+361.3%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0059
- Idea mean
- 0.0271
- Effect (Δ)
- 0.0212 (+361.3%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the built-in dynamics track was tested; no longer-horizon rollout metric, implicit midpoint integration, larger latent sizes, alternative Hamiltonian parameterizations, or wall-clock comparison was evaluated.
How to run: python3 bench_run.py
Artifacts
- bench_report.json 3.6 KB View Raw
- bench_run.py 3.9 KB View Raw
- experiment.py 5.7 KB View Raw
- nonlinear_check.py 1.1 KB View Raw
- nonlinear_results.json 0.3 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-08-31T162049.md 3.9 KB View
- results.json 1.4 KB View Raw