Diagnosing Faults in Reinforcement Learning Simulators with Canonical Polynomial Invariants
Organizations: Computer Science, MIU, Iowa, USA
Abstract
A large literature incorporates physical structure into learned dynamics on the premise that models respecting the underlying physics should predict better. We test this premise using exact polynomial invariants recovered from trajectories and represented canonically as reduced Gröbner bases over Q. We find that exact polynomial invariants provide little additional benefit for residual-based downstream uses. On Gymnasium's Acrobot, consistency regularisation reduces algebraic residuals without improving long-horizon rollout fidelity, while one-step validation error is more strongly associated with long-horizon accuracy; similarly, shaping potentials recovered from systems with mass errors of up to 100% achieve similar learning performance to the physically correct potential. The main benefit observed here instead appears in diagnosis, where canonical representations permit exact ideal-equality and membership decisions, and where a reference generating set supplies a physical vocabulary that generic two-sample tests do not have. We develop a two-level diagnostic comprising screening, which identifies the violated physical constraint, and attribution, which recovers the faulty invariant and identifies the responsible physical parameter. Normal-form deflation removes algebraically trivial multiples, while quotient-space recovery avoids tolerance-based nullspace selection. Across fifteen injected faults, screening localises all fifteen when no observation noise is added, with no observed false alarms. Attribution identifies the responsible parameter in all seven single-parameter faults. Paired difference tests detect all faults but provide no constraint-level localisation, showing that the advantage is localisation and not detection. In conclusion, exactness is more useful for diagnosing violations of physical constraints than for improving prediction.
Figures & tables
| Regime, noise | Method | Faults detected | False alarms | Localised | Attributed |
|---|---|---|---|---|---|
| unpaired, | MMD permutation | n/a | n/a | ||
| KS Bonferroni | n/a | n/a | |||
| MLP discriminator | n/a | n/a | |||
| paired difference | n/a | n/a | n/a | n/a | |
| algebraic, per block | |||||
| algebraic, per trajectory |
| reference energy drift | LINK_MASS_2 | LINK_LENGTH_1 | |
|---|---|---|---|
| (shipped) | none | none | |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| multiples of present | projection removes | normal form removes | |
|---|---|---|---|
| tol | raw | after projection | after normal form | residual | outcome | |
|---|---|---|---|---|---|---|
| – | energy below tolerance | |||||
| survivor is not the energy | ||||||
| – | spurious direction admitted | |||||
| energy isolated exactly | ||||||
| energy isolated exactly |
| (a) Perturbed coefficients, | ||||
|---|---|---|---|---|
| measured deviation | detected | localised | false alarms | |
| yes | ||||
| (6 decades) | – | – | no | |
| – | – | no | ||
| – | – | no | ||
| – | – | no | ||
| Environment | deg | Invariants | |
|---|---|---|---|
| Cartesian pendulum (DAE) | ; ; energy (passive) | ||
| Acrobot-v1 | – | ; ; energy (passive) ; balance law | |
| Reacher-v4 | – | 2 unit-norm; ; 2 forward-kinematics | |
| Free rigid body / attitude | ; , (torque-free) | ||
| Planar Kepler | ; energy after lifting | ||
| Reaction network | – | moiety conservation, integer coefficients |
| fault | category | description | must break |
| acrobot_m2_1.3 | parameter | second link mass not | energy |
| acrobot_l1_1.2 | parameter | first link length not | energy |
| acrobot_lc2_0.6 | parameter | second CoM at not | energy |
| acrobot_I2_1.5 | parameter | second inertia not | energy |
| acrobot_g_9.81 | parameter | gravity not | energy |
| reacher_l2_0.13 | parameter | not | fk- , fk- |
| setting | value |
|---|---|
| Acrobot trajectories | trajectories, steps, |
| Reacher samples | poses, lengths scaled by |
| significance level | , Bonferroni corrected over |
| screen blocks | contiguous, per trajectory |
| screen trajectory units | per configuration, exact permutation null over splits |
| screen residual floor |
| lag | lag | lag | lag | |
|---|---|---|---|---|
| noise | constant | MMD | KS | discriminator | screen |
|---|---|---|---|---|---|
| Acrobot | |||||
| Acrobot | |||||
| Acrobot | |||||
| Reacher | none | none | none | ||
| Acrobot | |||||
| Acrobot |
| noise | MMD | KS | discriminator | screen | |
|---|---|---|---|---|---|
| val MSE | algebraic residual | horizon | interval | |
|---|---|---|---|---|
| condition | AUC | final return | spread | step | vs. discovered | |
|---|---|---|---|---|---|---|
| none (PPO) | ||||||
| rand. matched range | ||||||
| rand. matched step | ||||||
| RND [ Burda et al., 2019 ] | ||||||
| discovered | ||||||
| faulty, |
Fault Diagnosis
Fault diagnosis identifies, localizes, and explains failures in engineered and computational systems using sensor data, logs, models, and domain knowledge.
See all 149 papers