Passivity-Regularized Sequence Layer
Implementation & benchmark of arXiv:2607.08637 — Aclass of incrementally scattering-passive nonlinear systems
Source paper: Aclass of incrementally scattering-passive nonlinear systems arXiv:2607.08637 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use the paper's scattering energy balance as a measurable regularizer for an existing recurrent or state-space model instead of replacing its architecture. Penalize positive violations of the per-step energy inequality and, for paired examples, penalize violations of incremental passivity so that the model learns not to amplify perturbations over long sequences.
Formulas
Mathematical statement
The paper's defining inequality compares stored state energy and accumulated output energy with initial state energy and accumulated input energy: \(\|x(\tau)\|^2+\int_0^\tau\|y(t)\|^2dt\leq\|x(0)\|^2+\int_0^\tau\|u(t)\|^2dt\). For a discrete neural sequence layer with hidden state \(h_t\), input \(u_t\), and output \(y_t\), define the per-step residual \(r_t=\|h_{t+1}\|_2^2+\|y_t\|_2^2-\|h_t\|_2^2-\|u_t\|_2^2\). A passive trajectory should have nonpositive cumulative residual \(\sum_t r_t\). Incremental passivity applies the same inequality to differences between two trajectories: \(\delta h_t=h_t^{(a)}-h_t^{(b)}\), \(\delta u_t=u_t^{(a)}-u_t^{(b)}\), and \(\delta y_t=y_t^{(a)}-y_t^{(b)}\). The positive-part function \([z]_+=\max(z,0)\) turns violations into a differentiable-almost-everywhere penalty. This is a soft empirical version of the paper's energy guarantee and does not require modifying the original recurrent transition.
Implementation notes
(1) Integrate this into the training loss of an existing GRU, LSTM, diagonal SSM, or custom RNN. Record \(h_t\) before each transition, \(h_{t+1}\) after the transition, the layer output \(y_t\), and the normalized input \(u_t\). Ensure the same feature scaling is used for all energy terms; otherwise the penalty is arbitrary. (2) Pseudocode: initialize \(L_p=0\) and \(R=0\); run the sequence model; for each timestep compute \(r=\|h_{t+1}\|_2^2+\|y_t\|_2^2-\|h_t\|_2^2-\|u_t\|_2^2\), update \(L_p\leftarrow L_p+\operatorname{relu}(r)\) and \(R\leftarrow R+r\); after the sequence set \(L_p\leftarrow L_p/T+\gamma\operatorname{relu}(R)\). For incremental training, create a second trajectory using a nearby input perturbation or an augmented view, compute \(\delta h,\delta u,\delta y\), and add \(\eta T^{-1}\sum_t\operatorname{relu}(r_t^{inc})\). Optimize \(L_{task}+\lambda L_p\). (3) The paper determines the target inequality and the residual definitions; \(\lambda\), \(\gamma\), \(\eta\), perturbation size, and normalization are empirical. Log maximum positive residual, cumulative residual, hidden-state norm, gradient norm, and finite-difference amplification \(\|\delta h_T\|/\|\delta h_0\|\). (4) First cheap experiment: train 2-layer GRUs with hidden size 128 on sequential MNIST, adding, and copy tasks. Compare no regularizer, spectral normalization, and this penalty for \(\lambda\in\{10^{-3},10^{-2},10^{-1}\}\), with and without paired trajectories. Evaluate ordinary sequences and sequences 5 times longer than training. Success is reduced hidden-state explosion and gradient variance, improved long-context accuracy, and less than 10% additional training FLOPs.
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 passivity regularizer for a GRU, including per-step, cumulative, and optional incremental trajectory penalties, plus a direct telescoping-identity check. The identity held numerically with maximum error 2.6e-6, and regularization reduced hidden-state energy violations and perturbation amplification. However, long-context accuracy worsened from 0.846 for the baseline to 0.666 with regularization, so the stability effect is real but did not improve task generalization in this small test.
- Agent confidence
- 8/10
- Baseline
- T32 accuracy 0.953; T160 accuracy 0.846; T160 amplification 0.697; T160 mean cumulative residual 7438.3; max positive residual 106.8
- Idea
- T32 accuracy 0.939; T160 accuracy 0.666; T160 amplification 0.207 without incremental pairing and 0.106 with pairing; T160 mean cumulative residual 1681.3/1677.6; max positive residual about 21.0
Limitations: Only a small GRU and synthetic sign-sum task were tested with one seed and one regularization weight. No spectral-normalization baseline, LSTM/SSM, FLOP accounting, gradient-variance measurement, or repeated-seed significance analysis was performed; CUDA failed due to shared cuDNN allocation and the run fell back to CPU.
How to run: python3 passivity_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.08637)
Ahead of the baseline (−7.3%) but not statistically significant (p=0.7258, wins 4 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0024
- Idea mean
- 0.0022
- Effect (Δ)
- -0.0002 (−7.3%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.7258 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±56.2%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The benchmark used the fixed dynamics track with 400 training and 200 test examples and 12 epochs rather than the larger default dataset. The baseline sweep covered learning rate but not weight decay because the local training loop did not expose that knob; no long-horizon rollout extension, FLOP profiling, spectral-normalization baseline, or additional architectures were tested. The confirmed mechanism signature is modest and does not establish improved generalization.
How to run: python3 bench_passivity.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 passivity and incremental-passivity penalties in the matched rnn_small dynamics model and ran the required paired-seed protocol. The measured signature confirmed slightly lower cumulative residual and perturbation amplification for the regularized models, but task MSE improved by only 0.000177 with 4/8 wins and permutation p=0.72575; therefore there is no significant benchmark win.
- Baseline
- dynamics/rnn_small, tuned lr=0.01; full 8-seed mean MSE approximately 0.00241524
- Idea
- passivity regularization, selected from shared lr/penalty/paired sweep; 8-seed mean MSE 0.00223852; paired delta -0.00017673; p=0.72575
Benchmark result
Ahead of the baseline (−7.3%) but not statistically significant (p=0.7258, wins 4 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0024
- Idea mean
- 0.0022
- Effect (Δ)
- -0.0002 (−7.3%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.7258 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±56.2%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The benchmark used the fixed dynamics track with 400 training and 200 test examples and 12 epochs rather than the larger default dataset. The baseline sweep covered learning rate but not weight decay because the local training loop did not expose that knob; no long-horizon rollout extension, FLOP profiling, spectral-normalization baseline, or additional architectures were tested. The confirmed mechanism signature is modest and does not establish improved generalization.
How to run: python3 bench_passivity.py
Artifacts
- bench_passivity.py 8.4 KB View Raw
- bench_report.json 2.2 KB View Raw
- passivity_experiment.py 5.9 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-09-04T200930.md 4.0 KB View
- results.json 2.9 KB View Raw