Analytic Markov-Routing Lyapunov Controller
Implementation & benchmark of arXiv:2608.01569 — Analyticity of Lyapunov Exponents for Mixed Markov Quasi-Periodic Cocycles
Source paper: Analyticity of Lyapunov Exponents for Mixed Markov Quasi-Periodic Cocycles arXiv:2608.01569 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use a finite-state Markov router to select recurrent or expert Jacobians, and regularize or optimize the router through the top Lyapunov exponent computed from state-conditioned projective statistics. The paper's mechanism predicts that this exponent varies smoothly with routing probabilities when the transition matrix is primitive and the dominant exponent is simple, while loss of primitivity, resonance, or exponent collision marks a detectable boundary where routing gradients may become unreliable.
Formulas
Mathematical statement
Let modes be indexed by $i\in\{1,\ldots,N\}$, let $P=(p_{ij})$ be a row-stochastic primitive transition matrix, and let $G_i(t,[v])=(t+\theta_i,[A_i(t)v])$ act on base position $t\in\mathbb T^m$ and projective direction $[v]\in\mathbb P^{d-1}$. Define unnormalized state-conditioned stationary measures $q_i$ by $q_j=\sum_i p_{ij}(G_i)_*q_i$, with total mass $q_i(\mathbb T^m\times\mathbb P^{d-1})=\pi_i$, where $\pi=\pi P$ is the stationary distribution. The top Lyapunov exponent is $\lambda(P)=\sum_i\int \log(\|A_i(t)v\|/\|v\|)\,dq_i(t,[v])$. Under primitive $P$, non-resonant directed-cycle translations, essentially bounded invertible cocycles, and a simple top exponent, the Markov transfer operator has a unique attracting projective stationary object and $\lambda(P)$ is analytic in the positive transition probabilities. For a neural recurrence $h_{t+1}=\phi(A_{z_t}h_t+B_{z_t}x_t)$ with Markov mode $z_t$, use the same quantity on recurrent Jacobians $J_i=\partial h_{t+1}/\partial h_t$ or on their linearized approximations.
Implementation notes
1. Integration point: add this controller to a Markov-switching RNN, state-space model, or recurrent mixture-of-experts network. Each mode $i$ has its own recurrent map and the router has logits $u_{ij}$ for allowed transitions $j\in\mathcal S_i$; preserve the support graph while learning probabilities. Compute recurrent Jacobian-vector products $J_i u$ during training without forming the full Jacobian. 2. Pseudocode: initialize a unit tangent vector $u$ and mode $z$; for each minibatch sequence and time step, sample or use the expected transition from $P$; compute the hidden update; calculate the JVP $r=J_z u$; accumulate $s\mathrel{+}=\log(\|r\|+\epsilon)$; normalize $u=r/(\|r\|+\epsilon)$; and sample the next mode using row $P_{z,:}$. Set $\widehat\lambda=s/T$ and add $\alpha(\widehat\lambda-\lambda_\star)^2$ to the task loss. For lower variance, maintain one normalized tangent vector per mode and estimate conditioned projective statistics with exponential moving averages. 3. Taken from the paper: the state-conditioned Markov transfer construction, primitive positive-support transitions, and analyticity under a simple top exponent. Estimated empirically: $q_i$, $\lambda$, the top-exponent gap, and gradients through finite-time tangent propagation. Use multiple tangent vectors and sequence seeds for uncertainty estimates. 4. First cheap experiment: use a two-mode 2D linear RNN on sequential MNIST or a synthetic sequence-classification task, with fixed matrices $A_1,A_2$ and a two-state router controlled by self-transition probability $p$. Compare unconstrained SGD, the Lyapunov controller, and fixed iid routing. Sweep $p\in[0.05,0.95]$ and measure $\widehat\lambda(p)$, finite-difference derivatives, gradient variance, and exploding or vanishing-gradient frequency. The quantitative prediction is a smooth curve with stable derivative estimates in the primitive interior while the dominant exponent remains separated; finite-difference error should decrease approximately quadratically with perturbation size. Near $p=0$ or $p=1$, nearly equal top exponents, or resonant translations, smoothness and gradient-variance benefits should deteriorate. Accept the mechanism if online and long-run Lyapunov estimates differ by at most 20% and routing-gradient variance is reduced by at least 2x away from the predicted boundaries.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a two-mode Markov-switching linear cocycle with normalized tangent propagation, empirical stationary-measure checks, finite-difference Lyapunov sensitivity tests, a persistence sweep, and a target-exponent controller. Stationary masses matched the theoretical distribution in the primitive interior, but finite-difference derivatives were too noisy for quadratic scaling, boundary variance did not increase as predicted, and the controller failed to move from p=0.2 toward its target. The promised effect was therefore not demonstrated.
- Agent confidence
- 9/10
- Baseline
- No meaningful baseline win established; fixed/uncontrolled routing was used as the reference and the controller remained near p=0.2 with exponent about 0.018 versus target 0.0341.
- Idea
- Stationary residual max 0.0069 at p=0.5 and 0.0105 at p=0.95; finite-difference derivatives at p=0.35 ranged 0.0575 to -0.0408 as h decreased; seed standard deviation was 0.00023 at p=0.05 versus 0.00112 at p=0.5; controller final p=0.2004.
Limitations: This was a small linear 2D toy rather than a trained nonlinear RNN or mixture-of-experts model. Runs were shortened for runtime, no full autodifferentiated router training or FLOP/speed comparison was performed, and exponent-collision/resonant-translation boundaries were not separately constructed.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 5.0 KB View Raw
- report.md 1.6 KB View
- results.json 3.6 KB View Raw