A Log-Timescale Perturbation Bound for Selective State Space Models at Every Sequence Length

Jack Humphries, Daniel MidgleyarXiv 2026

TL;DR

Researchers have developed a new mathematical "stability guarantee" for Mamba-style selective state space models that remains valid even for infinitely long sequences. By measuring changes in the model's internal "timescale" on a log scale rather than an additive one, they prove that small input perturbations won't cause the model's hidden state to drift away, regardless of how long the model runs.

What Problem Does This Paper Address?

Selective State Space Models (SSMs) like Mamba are designed to handle massive, streaming sequences—think financial tick data or long-form text. However, a major concern for researchers is stability: if I change a single input slightly, will that error "explode" or accumulate over time, eventually ruining the model's hidden state?

Existing mathematical bounds for this problem (notably from Cao et al.) measure changes in the model's "timescale" (essentially its step size) additively. The problem is that these additive bounds grow linearly with the sequence length ($L$). To stop this growth, you have to assume a "floor"—a minimum possible value for the timescale. But Mamba often uses a softplus activation that can produce timescales as tiny as $10^{-21}$. At that scale, additive bounds become practically useless, predicting massive errors that don't actually happen in practice.

Figure 1: (a) Change of the transition e−λ∆against λ∆when log ∆changes by 0.1 and when λ∆ changes by 0.01, with the input weight 1 −¯A. The two changes of λ∆are equal at λ∆≈0.095, where the two curves of the change of the transition cross. The first change stays below e0.1−1 ≈ 0.105 times the input weight. The second exceeds the whole input weight for λ∆below about 0.0099. At λ∆= 10−4 it is 99.5 times the input weight. (b) The gap |ht−˜ht| in the construction of Proposition 4 for ρ = 0.5, M = 1 and η = 0. The nominal λ∆t alternates between 0.05 e0.5

Methods

The authors' core innovation is the log-timescale condition. Instead of measuring the difference between a nominal timescale ($\Delta_t$) and a perturbed one ($\tilde{\Delta}_t$), they measure the ratio: $|\log \Delta_t - \log \tilde{\Delta}_t| \leq \rho$.

Key technical steps include:

  1. The Ratio Lemma: Proving that under this log condition, the change in the "decay factor" of the SSM is always bounded by a fixed fraction of the input weight. This ensures that errors at each step don't "pile up."
  2. Theorem 3 (Cell Bound): Proving a uniform bound for a single scalar recurrence (a "cell") that holds for every sequence length without needing a timescale floor.
  3. Data-Free Certificates: Using interval arithmetic to propagate these cell-level bounds through an entire Mamba block (including projections, convolutions, and activations) to create a "certificate" of stability for the whole layer.

Datasets

The authors evaluated their bounds on models trained for high-frequency finance:

  • Databento MBP-10 (SPY): Limit order book (LOB) data for the S&P 500 ETF from January 2021.
  • The task was to predict the log return of the mid-price 100 ticks into the future based on the previous 100 ticks.

Key Insights and Ideas

  • The "Aha" Moment on Scaling: The reason additive bounds fail is that as the timescale approaches zero, the "input weight" (how much new information the model absorbs) also approaches zero. An additive error doesn't shrink with the timescale, so it eventually overwhelms the signal. A log-scale error does shrink, keeping the perturbation proportional to the model's actual update.
  • Uniformity Over Time: Because the per-step error is proportional to the input weight, the total accumulated error is naturally "damped" by the model's own decay. This leads to a bound that is flat—it doesn't matter if your sequence is 10 steps or 10 million steps long.
  • Tightness: Through numerical "gradient attacks" (searching for the worst possible input change), the authors showed their theoretical bound is within a factor of about 2 of the best possible mathematical bound for small changes.

Key Results

The paper compares their new "log-timescale" bound against the traditional "additive" baseline:

  • Crossing Point: On a model with a bounded timescale, the additive bound becomes looser (worse) than the log-timescale bound after just 8 steps.
  • Softplus Superiority: For models using Mamba's standard softplus timescale, the additive bound is looser at every single sequence length tested.
  • Massive Looseness in Old Bounds: At a sequence length of 5,000, the additive bound was 540 times larger than the log-timescale bound for the bounded model, and over $10^{15}$ times larger for the softplus model.
Figure 3 illustrates the "flat" nature of the log-timescale certificate (blue) compared to the linearly growing additive bounds (dashed orange).

Limitations and Future Work

  • Diagonal Restriction: The current proof applies to scalar cells (diagonal $A$ matrices). While standard Mamba uses this, newer variants like Mamba-3 use complex-valued states which aren't yet covered.
  • Certificate Looseness: While much tighter than previous bounds, the "data-free" block certificates are still about 5 orders of magnitude higher than the errors found by actual gradient attacks. This suggests the theoretical "worst-case" is still much worse than what happens in reality.
  • Floating Point Issues: At extremely small timescales ($10^{-21}$), standard 32-bit floating-point rounding can break the "convex combination" property the proof relies on.
  • Future Directions: Extending the math to complex-valued transitions and finding ways to tighten the block-level certificates by accounting for dependencies between different channels.

Summary updated

Abstract

Mamba models deployed on streaming data, such as limit order book updates, run far past the sequence lengths they were trained on. A guarantee on how much a small change of input can move the hidden state therefore has to hold at every length. The closest existing bound we know of measures the change of the timescale additively, and it grows linearly with the sequence length unless the timescale is bounded away from zero. In this paper, we measure the change on a log scale instead. The key observation is that the decay factor of each step then moves by at most a fixed fraction of that step's input weight, so the per-step errors cannot pile up. Using this, we prove that two runs of a selective-scan cell from a common start stay within a bound that holds at every length, shrinks to zero with the size of the change and needs no lower bound on the timescale. We give a construction showing that, for small changes, this bound is within a factor of about 2 of the best possible, and we extend it to the update used in Mamba's released code when the timescale is bounded above. We then evaluate block-level bounds built from the theorem on two small models trained on one day of order book data. With a bounded timescale, a bound built on the existing analysis is tighter than ours for at most the first 8 steps. With Mamba's softplus timescale, whose certified lower bound is as small as $10^{-21}$, it is looser at every length. Our bounds hold for every input to a block, but they remain more than five orders of magnitude above the changes that gradient attacks find.
BibTeX
@misc{humphries2026log,
  author = {Jack Humphries and Daniel Midgley},
  title = {{A Log-Timescale Perturbation Bound for Selective State Space Models at Every Sequence Length}},
  year = {2026},
  eprint = {2611.21952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21952},
}
Figure