Input-Aware Contracting Neural ODE
Implementation & benchmark of arXiv:2608.09404 — Adaptive Stability-Constrained Neural Differential Equations for Controlled Dynamical Systems with Unknown Inputs
Source paper: Adaptive Stability-Constrained Neural Differential Equations for Controlled Dynamical Systems with Unknown Inputs arXiv:2608.09404 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Train a neural vector field together with a positive-definite metric \(M_\phi(x,u)\) that certifies local contraction at a prescribed rate. The contraction penalty must include the total derivative of the input-dependent metric, so rapidly changing controls are treated as a source of geometry variation rather than incorrectly claiming stability from a frozen metric.
Formulas
Mathematical statement
The learned nominal dynamics are \(\dot x=f_\theta(x,u)\), where \(x\in\mathbb R^n\) is the state, \(u\in\mathbb R^m\) is the measured input, and \(\theta\) are vector-field parameters. Define a positive-definite metric \(M_\phi(x,u)=L_\phi(x,u)L_\phi(x,u)^\top+\epsilon I\), where \(L_\phi\) is a lower-triangular neural network, \(\epsilon>0\), and \(\phi\) are metric parameters. For an infinitesimal displacement \(\delta x\), use \(V=\delta x^\top M_\phi\delta x\). Let \(A=\partial f_\theta/\partial x\) and \(B=\partial f_\theta/\partial u\). Along an input trajectory, the total metric derivative is \(\dot M=(\partial M/\partial x)f_\theta+(\partial M/\partial u)\dot u\). The local contraction certificate at rate \(\lambda>0\) is \(\dot M+A^\top M+MA+2\lambda M\preceq0\). For input and disturbance mismatch, with disturbance injection matrix \(E\), a sufficient robust condition adds \(\alpha M+\beta MBB^\top M+\gamma MEE^\top M\), where \(\alpha,\beta,\gamma>0\) are design weights. A negative largest generalized eigenvalue predicts exponential decay for matched trajectories and a bounded input-to-state separation for mismatched trajectories.
Implementation notes
1. Integration point: replace an unconstrained NODE or continuous-time state-space model with two networks, \(f_\theta(x,u)\) and a metric-factor network \(L_\phi(x,u)\). Add the contraction loss to the trajectory prediction loss, evaluating it on states from training trajectories and on randomly perturbed rollout states. Estimate \(\dot u\) from adjacent control samples using centered finite differences; for piecewise-constant controls, use zero inside intervals and evaluate separately at switching points. 2. Pseudocode: for each minibatch, compute \(f=f_\theta(x,u)\), \(A=\partial f/\partial x\), \(B=\partial f/\partial u\), and \(M=LL^\top+\epsilon I\). Use automatic differentiation to obtain \(\partial_xM\) and \(\partial_uM\), then form \(\dot M=(\partial_xM)f+(\partial_uM)\dot u\). Construct \(S\) from the displayed robust inequality, estimate its largest generalized eigenvalue through \(M^{-1/2}SM^{-1/2}\), and optimize \(\mathcal L_{\mathrm{prediction}}+\rho\mathcal L_{\mathrm{contr}}\). Increase \(\rho\) when the violation fraction exceeds a target and decrease it when violations remain rare. 3. Computed from the mechanism are the vector-field Jacobians, metric derivative, and generalized eigenvalue. Estimated empirically are the control derivative, state sampling distribution, and disturbance magnitude; initially set \(E=0\), then test known or conservative disturbance channels. 4. First experiment: train a two-state forced Duffing NODE on short trajectories, comparing an unconstrained NODE, a fixed Euclidean metric \(M=I\), and the adaptive metric. Sweep the learning rate and evaluate long rollouts under held-out forcing. The predicted signature is that the constrained model's sampled maximum generalized eigenvalue \(\mu_{\max}=\lambda_{\max}(M^{-1/2}SM^{-1/2})\) becomes negative, while the unconstrained model remains positive in some regions. For identical inputs, the logarithm of the metric distance between nearby rollouts should have slope no greater than \(-\lambda\) until approximation error dominates. Under input mismatch, separation should approach a plateau proportional to the mismatch norm rather than grow exponentially. Removing the \((\partial M/\partial u)\dot u\) term should selectively produce certificate violations and worse rollouts for rapidly varying controls.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
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 an input-aware contracting Neural ODE prototype with a positive-definite learned metric and total derivative dM/dt=(∂M/∂x)f+(∂M/∂u)u_dot. The scalar checks confirmed three predictions essentially exactly: boundary q*=0.8, sensitivity dμ/dq=1.5, and zero input-rate effect when the metric is input-independent. The adaptive model reduced mean certificate eigenvalue and violation fraction, but its worst-case violation remained large, so this is a promising mechanism signal rather than a complete stability certificate.
- Agent confidence
- 8/10
- Baseline
- Unconstrained: mean_mu=1.675, max_mu=2.295, violation_fraction=1.000; fixed M=I: mean_mu=0.748, max_mu=1.589, violation_fraction=1.000.
- Idea
- Adaptive input-aware metric with total derivative: mean_mu=-0.402, max_mu=22.465, violation_fraction=0.438. Analytic predictions: q boundary 0.800 predicted/observed, dmu/dq 1.500 predicted/observed, k=0 variation 0.
Limitations: The mini-experiment uses a small short-horizon Duffing-inspired vector-field fitting task rather than full NODE trajectory optimization, omits robust B/E disturbance terms, does not separately train a frozen-metric neural model, and does not test long rollouts or the input-mismatch plateau. The learned metric still has substantial worst-case certificate violations.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.09404)
Ahead of the baseline (−4.5%) but not statistically significant (p=0.3924, wins 4 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.085
- Idea mean
- 0.0812
- Effect (Δ)
- -0.0038 (−4.5%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.3924 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±10.9%
- Mechanism
- Not confirmed ✗
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The benchmark used a reduced but equal-budget dynamics dataset of 240 training and 120 test samples with 4 epochs because higher-order autograd through the GRU was expensive. The local certificate is a scalar approximation applied to the final theta/control slice of rnn_small rather than a full two-state NODE vector-field certificate; robust disturbance terms were omitted. The analytical scalar derivative check passed, but it is not counted as NN-scale mechanism confirmation; a baseline trained-model certificate aggregate was not retained in the final report.
How to run: python3 bench_experiment.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 the input-aware contracting metric as a training-loss intervention on the structurally matched dynamics/rnn_small benchmark, including a positive-definite learned metric and total derivative contribution from state and control rate. Across 8 paired seeds, test MSE improved slightly from 0.0850381 to 0.0812273, but the permutation p-value was 0.3924, so there was no significant win. The trained certificate remained violated on nearly all probe points, and the NN-scale quantitative mechanism prediction was not confirmed.
- Baseline
- dynamics/rnn_small, tuned lr=0.006, test MSE mean=0.0850381, std=0.0185276
- Idea
- input-aware metric penalty, lr=0.006, rho=0.05, test MSE mean=0.0812273, std=0.0218786; paired delta=-0.00381088, p=0.3924; idea wins=4/8
Benchmark result
Ahead of the baseline (−4.5%) but not statistically significant (p=0.3924, wins 4 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.085
- Idea mean
- 0.0812
- Effect (Δ)
- -0.0038 (−4.5%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.3924 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±10.9%
- Mechanism
- Not confirmed ✗
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The benchmark used a reduced but equal-budget dynamics dataset of 240 training and 120 test samples with 4 epochs because higher-order autograd through the GRU was expensive. The local certificate is a scalar approximation applied to the final theta/control slice of rnn_small rather than a full two-state NODE vector-field certificate; robust disturbance terms were omitted. The analytical scalar derivative check passed, but it is not counted as NN-scale mechanism confirmation; a baseline trained-model certificate aggregate was not retained in the final report.
How to run: python3 bench_experiment.py
Artifacts
- bench_experiment.py 5.7 KB View Raw
- bench_report.json 5.4 KB View Raw
- experiment.py 5.6 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-09-01T101130.md 4.2 KB View
- results.json 0.8 KB View Raw