Flat-Connection Neural Dynamics
Implementation & benchmark of arXiv:2607.02648 — Time-Dependent Integrability from Gauge Theory, I
Source paper: Time-Dependent Integrability from Gauge Theory, I arXiv:2607.02648 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace an unconstrained recurrent or neural-ODE vector field with a Lie-algebra-valued connection depending on time, input position, and an auxiliary spectral parameter. Train the model both for prediction and for approximate zero curvature, so evolution along different discretized paths is compatible rather than accumulating arbitrary noncommutative drift.
Formulas
Mathematical statement
The paper defines the Chern–Simons three-form CS[A]=⟨A,dA+(2/3)A∧A⟩ and the four-dimensional action S_CS4[A]=(i/4π)∫_{Σ×C}ω∧CS[A], where A is a Lie-algebra-valued connection one-form, ⟨·,·⟩ is an invariant bilinear form, Σ is the space-time surface, C is the auxiliary complex curve, and ω is a meromorphic one-form. Its variation is δS=(i/2π)∫ω∧⟨F[A],δA⟩−(i/4π)∫dω∧⟨A,δA⟩, with curvature F[A]=dA+A∧A. When dω=0 away from prescribed singularities, stationarity enforces flatness F[A]=0. For a neural implementation, use two coordinates t and x and a matrix-valued connection A=A_t(t,x,z)dt+A_x(t,x,z)dx, where z is a sampled spectral parameter and A_t,A_x∈sl(N). The flatness condition becomes F_tx=∂_tA_x−∂_xA_t+[A_t,A_x]=0, with [X,Y]=XY−YX. The loss penalty is the squared invariant norm ||F_tx||_F² averaged over collocation points and spectral parameters. The transferred property is zero curvature, which makes parallel transport path-compatible and is the local mechanism behind Lax integrability.
Implementation notes
(1) Integration point: implement this as a recurrent state-space model or neural ODE for sequences. Let the hidden state be h_t∈R^d and let an MLP output two matrices A_t(h_t,u_t,z) and A_x(h_t,u_t,z)∈sl(N), represented by unconstrained matrices projected to traceless form X↦X−tr(X)I/N. Use z values sampled from a fixed interval, such as z∈{−1,−0.5,0.5,1}. For a real-valued implementation, use real traceless matrices; for a complex spectral parameter, represent real and imaginary parts as separate channels.
(2) Pseudocode:
inputs: sequence u[0:T], initial h0, collocation points (t_k,x_k), spectral samples z_j
for each training batch:
run the recurrent model and compute prediction loss L_pred
at each collocation point evaluate At=A_t(h,u,z) and Ax=A_x(h,u,z)
estimate ∂tAx and ∂xAt with automatic differentiation or centered finite differences
F = ∂tAx − ∂xAt + At@Ax − Ax@At
L_flat = mean(||F||_F^2)
L = L_pred + λ_flat L_flat + λ_reg mean(||A_t||_F^2+||A_x||_F^2)
update network parameters with AdamW
(3) Compute F and its derivatives from the curvature formula; estimate derivatives empirically with automatic differentiation. The invariant bilinear form can be the Frobenius inner product ⟨X,Y⟩=tr(XᵀY). Start with N=2 or N=4 and use 8–32 collocation points per sequence. Do not require exact flatness: tune λ_flat on validation data. A cheaper discrete variant uses a plaquette residual: compose exp(εA_t), exp(εA_x), exp(−εA_t), exp(−εA_x) around a small grid cell and penalize deviation from the identity matrix.
(4) First experiment: use a small character-level Penn Treebank task or a synthetic advection/world-model task with sequence lengths 128, 512, and 2048. Compare a GRU, a diagonal SSM, and the proposed sl(N)-connection recurrent model at matched parameter count and FLOPs. Measure validation loss, gradient norm, hidden-state norm, and error after rolling the model beyond the training horizon. The expected signal is lower long-horizon error and less hidden-state explosion at equal short-horizon loss; a meaningful result would be at least 20% lower extrapolation error or substantially slower degradation as sequence length increases.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Inconclusive
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 reproducible flat-connection toy verification and a small supervised connection-fitting comparison. The mechanism manifested quantitatively: curvature scaled linearly with connection amplitude (observed slope 1.0000 vs predicted 1), plaquette deviation scaled quadratically with cell size (2.0004 vs 2), and a pure-gauge connection had residual curvature below 5e-9. In the mini-fit, the flat potential parameterization achieved lower validation MSE (0.001356 vs 0.001536) and zero analytic curvature, but this is not evidence of improved long-horizon sequence modeling.
- Agent confidence
- 8/10
- Baseline
- Unconstrained polynomial connection: validation MSE 0.0015363; mean absolute curvature 0.06652
- Idea
- Potential-derived flat connection: validation MSE 0.0013561; mean absolute curvature 0.0; curvature-amplitude slope 1.0000; plaquette-area slope 2.00045; pure-gauge maximum residual 4.93e-9
Limitations: The experiment uses 2x2 real matrices and a synthetic polynomial field, not a trained GRU/neural ODE or character-level/world-model task. It does not test long-horizon prediction, matched FLOPs or parameter counts, optimization dynamics, spectral-parameter sampling, noise robustness, or whether exact/approximate flatness improves forecasting beyond this controlled regression.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.02648)
Ahead of the baseline (−21.6%) but not statistically significant (p=0.254, wins 7 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0126
- Idea mean
- 0.0099
- Effect (Δ)
- -0.0027 (−21.6%; negative = idea better)
- Wins
- 7 / 8 paired seeds
- p-value
- 0.254 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±39.7%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 6 configs
Only the built-in dynamics track was tested; no long-horizon rollout metric beyond its fixed benchmark target, sequence/vision/tabular tracks, spectral complex parameters, plaquette discretization, or larger recurrent models were tested. The benchmark used a small 400/200 dataset and 6 epochs. The flatness sweep values produced effectively identical task results in this implementation, indicating the penalty gradient was weak at these settings; therefore the curvature mechanism was confirmed but predictive improvement was not.
How to run: python3 bench_flat_connection.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Implemented a matched rnn_small dynamics benchmark using the dynamics track, with a FlatGRU connection head and autograd F_tx penalty; baseline and idea shared the recurrent prediction system and differed only by the flatness-loss weight. The mechanism signature was confirmed: trained-model curvature RMS fell from 0.05386 to 0.00724 (ratio 0.134). Test MSE improved from 0.01261 to 0.00989, but the paired permutation test gave p=0.25395, so this is not a significant win under the required protocol.
- Baseline
- dynamics/rnn_small, best sweep cfg lr=0.006, wd=0, epochs=6; test MSE mean 0.01260863 ± 0.00743564
- Idea
- FlatGRU with flat=0.0001, lr=0.006, wd=0, epochs=6; test MSE mean 0.00988772 ± 0.00646094; paired delta -0.00272091, 7/8 wins, permutation p=0.25395; trained curvature RMS 0.00724154 vs baseline 0.05386039
Benchmark result
Ahead of the baseline (−21.6%) but not statistically significant (p=0.254, wins 7 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0126
- Idea mean
- 0.0099
- Effect (Δ)
- -0.0027 (−21.6%; negative = idea better)
- Wins
- 7 / 8 paired seeds
- p-value
- 0.254 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±39.7%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 6 configs
Only the built-in dynamics track was tested; no long-horizon rollout metric beyond its fixed benchmark target, sequence/vision/tabular tracks, spectral complex parameters, plaquette discretization, or larger recurrent models were tested. The benchmark used a small 400/200 dataset and 6 epochs. The flatness sweep values produced effectively identical task results in this implementation, indicating the penalty gradient was weak at these settings; therefore the curvature mechanism was confirmed but predictive improvement was not.
How to run: python3 bench_flat_connection.py
Artifacts
- bench_flat_connection.py 5.2 KB View Raw
- bench_report.json 4.5 KB View Raw
- experiment.py 5.4 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-08-30T213907.md 6.3 KB View
- results.json 1.3 KB View Raw