Koopman-generator HJB critic
Implementation & benchmark of arXiv:2608.11808 — Data-Driven optimal control via Koopman operators and Hamilton-Jacobi-Bellman equations
Source paper: Data-Driven optimal control via Koopman operators and Hamilton-Jacobi-Bellman equations arXiv:2608.11808 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace an unconstrained learned dynamics model in model-based reinforcement learning or neural optimal control with a Koopman-style observable lift and an explicitly estimated infinitesimal generator. Train a value network against an HJB residual formed from this generator, so the critic is constrained by the observed vector field and control directions rather than relying only on temporal-difference targets.
Formulas
Mathematical statement
For the autonomous system $\dot{\xi}=F(\xi)$ on a forward-invariant domain $\mathbf{\Omega}\subset\mathbb{R}^{J}$, the Koopman operator is $(\mathcal{K}^{t}\varphi)(\xi_0)=\varphi(\xi(t;\xi_0))$, where $\xi(t;\xi_0)$ is the trajectory from initial state $\xi_0$ and $\varphi$ is an observable. Its infinitesimal generator is $\mathcal{L}\varphi=\lim_{t\to0^+}(\mathcal{K}^{t}\varphi-\varphi)/t=F(\xi)^{\mathsf T}\nabla\varphi(\xi)$ for differentiable $\varphi$. Adapt this to a control-affine system $\dot{x}=f(x)+G(x)u$, where $x\in\mathbb{R}^{d}$ is the state, $f(x)\in\mathbb{R}^{d}$ is the drift, $G(x)\in\mathbb{R}^{d\times m}$ is the control matrix, and $u\in\mathbb{R}^{m}$ is the control. For a dictionary $\psi(x)\in\mathbb{R}^{r}$, EDMD-style regression estimates a lifted generator through $\dot{\psi}(x)\approx A\psi(x)+B(x)u$, with $A$ and $B$ fitted from finite differences. For running cost $q(x)+\tfrac12u^{\mathsf T}Ru$, discount $\rho\ge0$, and positive-definite $R$, the stationary HJB equation is $0=q(x)+\min_u\{\tfrac12u^{\mathsf T}Ru+\nabla V(x)^{\mathsf T}[f(x)+G(x)u]-\rho V(x)\}$. The minimizing feedback is $u^*(x)=-R^{-1}G(x)^{\mathsf T}\nabla V(x)$, and substituting learned dynamics gives the trainable residual $r_\theta(x)=q(x)-\rho V_\theta(x)+\nabla V_\theta(x)^{\mathsf T}\hat f(x)-\tfrac12\nabla V_\theta(x)^{\mathsf T}\hat G(x)R^{-1}\hat G(x)^{\mathsf T}\nabla V_\theta(x)$.
Implementation notes
1. Integration point: use this as a critic and differentiable model-learning module for a small continuous-control agent, or as a standalone neural optimal controller. Learn a dictionary encoder $\psi_\omega(x)$, drift model $\hat f_\eta(x)$, control model $\hat G_\eta(x)$, and value network $V_\theta(x)$. Evaluate the HJB residual at sampled states using automatic differentiation through $V_\theta$. 2. Pseudocode: collect tuples $(x_t,u_t,x_{t+\Delta})$; calculate $y_t=(x_{t+\Delta}-x_t)/\Delta$; regress $y_t\approx\hat f_\eta(x_t)+\hat G_\eta(x_t)u_t$; optionally calculate lifted differences $z_t=(\psi_\omega(x_{t+\Delta})-\psi_\omega(x_t))/\Delta$ and fit $z_t\approx A\psi_\omega(x_t)+B(x_t)u_t$; sample a minibatch of states; compute $g=\nabla_xV_\theta(x)$ and $u=-R^{-1}\hat G_\eta(x)^{\mathsf T}g$; compute $r=q(x)-\rho V_\theta(x)+g^{\mathsf T}(\hat f_\eta+\hat G_\eta u)+\tfrac12u^{\mathsf T}Ru$; update all parameters with $L=\mathbb{E}[r^2]+\lambda_d\mathbb{E}\|x_{t+\Delta}-x_t-\Delta(\hat f_\eta+\hat G_\eta u_t)\|^2+\lambda_b\mathbb{E}\|u\|^2$. 3. The mathematical component is the Koopman operator/generator identity and the HJB minimizing-control formula. Estimate finite-difference derivatives, dictionary dimension, model errors, and regularization weights empirically; freeze the dynamics model initially to prevent value fitting from corrupting identification, then optionally alternate model and value updates. 4. First experiment: compare against a standard MLP actor-critic and neural-ODE actor-critic on a two-dimensional Van der Pol, pendulum, or linear-quadratic-control benchmark using identical trajectory and parameter budgets. Track HJB residual, held-out one-step prediction error, episodic return, control energy, and the fraction of random initial states that remain bounded. Success means lower residual and fewer unstable trajectories at equal data; a useful target is at least 10% higher return or 2x lower one-step error without increasing parameter count by more than 25%.
Verification
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 9/10
Built a compact Koopman-generator/HJB critic experiment for a discounted continuous-time LQR system, including finite-difference generator estimation, control-affine regression, EDMD-style observable lifting, HJB residual training, and a TD baseline. All three required mechanism predictions manifested: generator error scaled as dt^0.995 versus predicted dt^1, identification error scaled as N^-0.535 versus predicted N^-0.5, and HJB residual was approximately zero with exact dynamics and scaled as |epsilon|^1.029 versus predicted first order. In the small neural comparison, HJB value error was 0.203 versus 3.093 for TD, but this is only a toy controlled benchmark and is not evidence of general RL superiority.
- Agent confidence
- 9/10
- Baseline
- TD critic RMS value error 3.0930 after 220 updates
- Idea
- HJB critic RMS value error 0.2034 after 220 updates; generator slope 0.9948, identification slope -0.5348, HJB dynamics-error slope 1.0285, exact-dynamics HJB residual 9.1e-16, lifted-generator holdout derivative RMS error 0.5134
Limitations: Only a two-dimensional linear LQR toy system was tested; no nonlinear Van der Pol, pendulum, online data collection, learned dictionary encoder, long-horizon stability, wall-clock/FLOP matching, or statistically independent benchmark suite was evaluated. The EDMD lift was demonstrated but not used to train the value network; the neural comparison used exact known dynamics rather than a jointly learned world model.
How to run: OMP_NUM_THREADS=2 MKL_NUM_THREADS=2 /home/maxwelhelp/main/bin/python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.11808)
Significantly WORSE than the tuned baseline (+1.3%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0003
- Idea mean
- 0.0003
- Effect (Δ)
- 0 (+1.3%; 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 3 configs
Only the built-in actuated-pendulum rollout track was tested; no online RL return, long-horizon boundedness, neural dictionary encoder, alternative HJB weights, or larger architectures were evaluated.
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: 9/10
Implemented the Koopman-generator HJB critic with a learned control-affine generator and HJB residual training on the structurally matched dynamics track, using the shared rnn_small architecture. The mechanism signature was confirmed, but the best idea result was significantly worse than the tuned baseline: paired delta +4.0983e-6 with permutation p=0.0081, so the idea does not give a benchmark win.
- Baseline
- mean test MSE 0.0003191903 across 8 seeds; best lr=0.01
- Idea
- mean test MSE 0.0003232886 across 8 seeds; lr=0.01, lambda_hjb=0.001
- Mechanism signature
- confirmed=true; observed derivative RMS 0.1218762; observed HJB residual RMS 0.5597087
- Paired delta
- +0.0000040983 (idea worse)
- Permutation p
- 0.0081
Benchmark result
Significantly WORSE than the tuned baseline (+1.3%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0003
- Idea mean
- 0.0003
- Effect (Δ)
- 0 (+1.3%; 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 3 configs
Only the built-in actuated-pendulum rollout track was tested; no online RL return, long-horizon boundedness, neural dictionary encoder, alternative HJB weights, or larger architectures were evaluated.
How to run: python3 stage2_bench.py
Artifacts
- bench_report.json 3.9 KB View Raw
- experiment.py 7.0 KB View Raw
- report.md 1.7 KB View
- report_bench_2026-09-01T125437.md 3.0 KB View
- results.json 2.3 KB View Raw
- stage2_bench.py 5.1 KB View Raw