# Input-Aware Contracting Neural ODE

- ID: 2045
- Canonical URL: https://synthcore.org/idea/2045/input-aware-contracting-neural-ode
- API JSON: https://synthcore.org/api/idea/2045.json
- API Markdown: https://synthcore.org/api/idea/2045.md
- Verification status: failed_benchmark
- Source: [arXiv:2608.09404](https://arxiv.org/abs/2608.09404)
- Category: dynamics
- Solves: stability, accuracy, generalization
- ML areas: optimizer, training-dynamics, ssm, rnn
- Math tags: control-theory, dynamical-systems, differential-geometry, optimization, linear-algebra
- Ratings: usefulness 8/10; difficulty 6/10; novelty 6/10

## 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.

## 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.

## Key formulas

- $$M_\phi(x,u)=L_\phi(x,u)L_\phi(x,u)^\top+\epsilon I,\qquad V(\delta x,x,u)=\delta x^\top M_\phi(x,u)\delta x.$$
- $$\dot M_\phi=\frac{\partial M_\phi}{\partial x}f_\theta(x,u)+\frac{\partial M_\phi}{\partial u}\dot u,$$
- $$\dot M_\phi+A^\top M_\phi+M_\phi A+2\lambda M_\phi\preceq0,\qquad A=\frac{\partial f_\theta}{\partial x}.$$
- $$\mathcal L_{\mathrm{contr}}=\mathbb E\left[\operatorname{softplus}\left(\lambda_{\max}\left(M^{-1/2}SM^{-1/2}\right)\right)\right],\quad S=\dot M+A^\top M+MA+2\lambda M+\alpha M+\beta MBB^\top M+\gamma MEE^\top M.$$

## 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

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: inconclusive
- Verdict: 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.

### Mechanism check

- Verdict: 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.
- Confidence: 8/10
- 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.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.3924
- Paired wins: 4/8
- Benchmark verdict: no significant win

## Artifacts

- [bench_experiment.py](https://synthcore.org/code/770/bench_experiment.py)
- [bench_report.json](https://synthcore.org/code/770/bench_report.json)
- [experiment.py](https://synthcore.org/code/770/experiment.py)
- [report.md](https://synthcore.org/code/770/report.md)
- [report_bench_2026-09-01T101130.md](https://synthcore.org/code/770/report_bench_2026-09-01T101130.md)
- [results.json](https://synthcore.org/code/770/results.json)
- [Download all files as ZIP](https://synthcore.org/download/770)

## Disclaimer

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