# Differentiable Maximal-Attractor Trap

- ID: 2540
- Canonical URL: https://synthcore.org/idea/2540/differentiable-maximal-attractor-trap
- API JSON: https://synthcore.org/api/idea/2540.json
- API Markdown: https://synthcore.org/api/idea/2540.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2608.18761](https://arxiv.org/abs/2608.18761)
- Category: dynamics
- Solves: stability, accuracy
- ML areas: rnn, ssm, world-model, training-dynamics, regularization
- Math tags: dynamical-systems, geometry, control-theory, linear-algebra
- Ratings: usefulness 7/10; difficulty 5/10; novelty 7/10

## Idea description

Constrain a recurrent neural transition to map a compact learned-state region strictly into its interior, creating a neural analogue of the paper's maximal attractor. Unlike simple spectral normalization, this permits a nontrivial invariant set and can preserve task-relevant recurrent dynamics while preventing long-horizon state escape.

## Mathematical statement

Let f_theta: R^d -> R^d be the hidden-state transition and let U be a compact trapping region. The defining condition is f_theta(cl U) subset int U, and the maximal attractor is F_theta = intersection over n >= 0 of f_theta^n(U). Use U = [-alpha, alpha]^d with alpha > 0 and enforce a margin epsilon > 0 by penalizing violations of |f_theta(x)_j| <= alpha - epsilon for sampled x in U. The finite approximation F_theta,N = intersection over n = 0,...,N of f_theta^n(U) is estimated using reachable particles or interval samples. Strict forward invariance and compactness imply bounded trajectories starting in U and convergence toward an invariant maximal set, although finite sampling only provides an empirical certificate.

## Key formulas

- f_theta(cl U) subset int U
- F_theta = intersection over n >= 0 of f_theta^n(U)
- F_theta,N = intersection over n = 0,...,N of f_theta^n(U)
- L_trap(theta) = mean over x in B and coordinates j of softplus(|f_theta(x)_j| - alpha + epsilon)

## Implementation notes

1. Exact integration point: apply the method to the hidden-state update of an RNN, state-space model, or learned world model, h_(t+1) = f_theta(h_t, u_t). For the first test, set inputs to zero or restrict them to a bounded set V, choose U = [-alpha, alpha]^d, and use a tanh MLP transition. 2. Pseudocode: sample B states x_k uniformly from U; compute y_k = f_theta(x_k, 0); calculate L_trap as the mean softplus of |y_kj| - alpha + epsilon; optimize L_task + lambda_trap L_trap. Every M training steps, initialize particles X_0 in U, propagate X_(n+1) = f_theta(X_n, 0), and record maximum norm, violation rate, cloud diameter, and Hausdorff distance between successive clouds. 3. Taken from the paper: the trapping-region definition and the nested forward-image construction. Estimated empirically: whether the sampled region is invariant, the finite-time attractor, and convergence of reachable clouds. A stronger implementation can use interval-bound propagation instead of point samples to obtain a conservative box certificate. 4. First cheap experiment: train a 32-unit RNN on Mackey-Glass next-step prediction, comparing a vanilla model with the trap-regularized model over 1,000-step rollouts from 10,000 random hidden states. The quantitative prediction is a sharp escape transition as lambda_trap becomes large enough to drive empirical violations below 0.1 percent. Above that boundary, maximum hidden-state norm stays bounded, and the Hausdorff distance between X_N and X_(N+1) decreases with N; excessive lambda_trap should shrink attractor diameter and degrade prediction accuracy.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: no_effect
- Verdict: Built a differentiable trapping-loss RNN experiment plus an analytic tanh-map verification. The mechanism manifested: the exact strict-invariance boundary was predicted as a=1.2474 and the first violating sweep point was a=1.25; the toy map also showed the predicted transition at a=1 and closely matched nonzero fixed-point attractor diameters. In the RNN, trap regularization reduced long-horizon violations from 99.9% mean at lambda=0 to 0% at lambda>=3, with max hidden norm falling from 2.46 to 0.76 at lambda=3, at the cost of higher MSE.

### Mechanism check

- Verdict: Built a differentiable trapping-loss RNN experiment plus an analytic tanh-map verification. The mechanism manifested: the exact strict-invariance boundary was predicted as a=1.2474 and the first violating sweep point was a=1.25; the toy map also showed the predicted transition at a=1 and closely matched nonzero fixed-point attractor diameters. In the RNN, trap regularization reduced long-horizon violations from 99.9% mean at lambda=0 to 0% at lambda>=3, with max hidden norm falling from 2.46 to 0.76 at lambda=3, at the cost of higher MSE.
- Confidence: 8/10
- Limitations: The invariance certificate is empirical point sampling rather than interval-bound or exact verification for the learned RNN. The task used zero-input dynamics, a small 16-unit RNN, one fixed seed, short training, and a synthetic Mackey-Glass setup; no FLOP-normalized study, multiple-seed statistics, nonzero bounded inputs, or larger benchmarks were tested.

### Practical benchmark

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

## Artifacts

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

## Disclaimer

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