# Contour-resolvent state-space layer

- ID: 822
- Canonical URL: https://synthcore.org/idea/822/contour-resolvent-state-space-layer
- API JSON: https://synthcore.org/api/idea/822.json
- API Markdown: https://synthcore.org/api/idea/822.md
- Verification status: failed_benchmark
- Source: [arXiv:2607.12628](https://arxiv.org/abs/2607.12628)
- Category: dynamics
- Solves: speedup, stability, accuracy
- ML areas: ssm, rnn, training-dynamics, inference-speedup
- Math tags: dynamical-systems, numerical-analysis, linear-algebra
- Ratings: usefulness 7/10; difficulty 6/10; novelty 6/10

## Idea description

Replace repeated time-stepping of a stiff linear state-space block with a quadrature approximation to its inverse Laplace transform. The layer propagates a hidden state using a small set of complex shifted linear solves, which can be batched and reused across many time steps or parameter values.

## Mathematical statement

The paper studies the descriptor system $E\dot{x}(t)=Ax(t)+f(t)$, where $x(t)\in\mathbb{R}^n$ is the state, $E,A\in\mathbb{R}^{n\times n}$, and singular $E$ encodes algebraic constraints. For zero forcing and initial state $x_0$, the Laplace-domain solution is $\widehat{x}(s)=(sE-A)^{-1}Ex_0$, where $s\in\mathbb{C}$ and $(sE-A)^{-1}$ is the resolvent of the matrix pencil. Inverse Laplace reconstruction integrates this resolvent over a contour $\Gamma$ in the resolvent set: $x(t)=\frac{1}{2\pi i}\int_\Gamma e^{st}(sE-A)^{-1}Ex_0\,ds$. Nodes $s_j\in\Gamma$ and quadrature weights $w_j$ yield the computable approximation $\operatorname{Re}\sum_jw_je^{s_jt}(s_jE-A)^{-1}Ex_0$; taking the real part is valid when nodes and weights occur in conjugate pairs. The transferable property is stiffly stable propagation through resolvent solves instead of explicit steps constrained by the fastest eigenvalue.

## Key formulas

- $$E\dot{x}(t)=Ax(t)+f(t),\qquad E,A\in\mathbb{R}^{n\times n},\quad x(t)\in\mathbb{R}^n.$$
- $$\widehat{x}(s)=(sE-A)^{-1}Ex_0.$$
- $$x(t)=\frac{1}{2\pi i}\int_{\Gamma}e^{st}(sE-A)^{-1}Ex_0\,ds\;\approx\;\operatorname{Re}\sum_{j=1}^{q}w_je^{s_jt}(s_jE-A)^{-1}Ex_0.$$
- $$h_{k+1}=\operatorname{Re}\sum_{j=1}^{q}w_je^{s_j\Delta t}(s_jE-A(\theta))^{-1}Eh_k+b_k.$$

## Implementation notes

Integrate this at the state-transition operation of a linear SSM, recurrent block, or continuous-depth residual block. Let the hidden width be $n$, choose a descriptor matrix $E$ and a trainable dynamics matrix $A(\theta)$, and replace Euler or bilinear propagation with the contour update. Choose $q$ conjugate-symmetric nodes, for example $s_j=\sigma+\rho e^{i\phi_j}$ on a parabolic or Talbot-like contour, together with quadrature weights $w_j$. For each node, solve $(s_jE-A)z_j=Eh_k$ and set $h_{k+1}=\operatorname{Re}\sum_jw_je^{s_j\Delta t}z_j+b_k$. If $A$ and $E$ are fixed across sequence positions, cache one LU factorization per node; if $A$ changes slowly, reuse preconditioners or use batched Krylov solves. With $E=I$, this is a drop-in stiff SSM; with singular $E$, it becomes a descriptor SSM. The paper supplies the resolvent propagation rule, while contour shape, node count, and truncation tolerance should be selected by comparing against a finer quadrature and monitoring the residual of the propagated system. First test a width-128 SSM on a stiff synthetic oscillator and on a small Long Range Arena task. Compare Euler, bilinear/Tustin, and exact matrix-exponential baselines at equal FLOPs. Measure loss descent, maximum stable $\Delta t$, gradient-norm variance, wall-clock time, and final sequence accuracy. A positive result is faster loss descent or a substantially larger stable step size at matched accuracy; a practical target is roughly $2\times$ larger stable steps or fewer propagation evaluations without perplexity degradation.

## Verification

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: inconclusive
- Verdict: Built and numerically verified a contour-resolvent propagator for a stiff linear system. The mechanism manifested: Euler’s predicted stability boundary dt=2/L was observed across L=10,100,1000; contour quadrature error decreased rapidly from 1.17 at q=64 to 2.6e-9 at q=2048; and converged contour propagation remained stable at dt=4/L where Euler diverged to 2.8e47, matching the exact solution to about 1e-7 relative error. This is a stability/accuracy result, not a speed win: q=2048 was about 2500x slower than Euler in the unoptimized uncached implementation.

### Mechanism check

- Verdict: Built and numerically verified a contour-resolvent propagator for a stiff linear system. The mechanism manifested: Euler’s predicted stability boundary dt=2/L was observed across L=10,100,1000; contour quadrature error decreased rapidly from 1.17 at q=64 to 2.6e-9 at q=2048; and converged contour propagation remained stable at dt=4/L where Euler diverged to 2.8e47, matching the exact solution to about 1e-7 relative error. This is a stability/accuracy result, not a speed win: q=2048 was about 2500x slower than Euler in the unoptimized uncached implementation.
- Confidence: 9/10
- Limitations: Only a 2-dimensional diagonal ODE with E=I was tested; singular descriptor systems, nonnormal dynamics, forcing, trainable SSMs, gradients, sequence tasks, GPU execution, LU-factorization caching, and optimized/batched solves were not tested. The circular contour is intentionally simple and requires a very large q for this stiff setup, so practical speed conclusions are unfavorable for this MVP.

### Practical benchmark

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

## Artifacts

- [bench_report.json](https://synthcore.org/code/335/bench_report.json)
- [contour_bench.py](https://synthcore.org/code/335/contour_bench.py)
- [contour_resolvent_mvp.py](https://synthcore.org/code/335/contour_resolvent_mvp.py)
- [report.md](https://synthcore.org/code/335/report.md)
- [report_bench_2026-08-31T013124.md](https://synthcore.org/code/335/report_bench_2026-08-31T013124.md)
- [results.json](https://synthcore.org/code/335/results.json)
- [Download all files as ZIP](https://synthcore.org/download/335)

## Disclaimer

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