Skip to content
AI360Xpert
Beta

S4 Brings Structured States to Vision

S4 parameterizes state matrices for long memory with fast kernels, giving vision a linear long-range option before selection.

Structured 64 dim states remember 16K pixels with stable gradients
Structured 64 dim states remember 16K pixels with stable gradients

Why Does This Exist?

RNNs vanish on 1616K pixel strings. Attention handles them but costs 256256M pairs.

S4 structures memory. It precedes vision mamba selection, grounds state spaces, and informs convolutional layers long-range debates.

Think of It Like This

Tuned echo chambers instead of plain rooms

Plain rooms echo muddy. Shaped chambers hold tones for seconds with clear decay.

HiPPO init shapes chambers, discretization tunes decay. Where it stops: fixed shapes suit all inputs alike, just as S4 lacks per-input selection.

How It Actually Works

Discretize A,BA,B with step Δ\Delta to Aˉ,Bˉ\bar{A},\bar{B}. HiPPO sets AA to memorize history optimally in 6464 dims. Run as recurrence or long conv kernel K=(CBˉ,CAˉBˉ,...)K = (C\bar{B}, C\bar{A}\bar{B}, ...).

Worked example

128×128=16,384128 \times 128 = 16{,}384 pixels. Attention 16,3842=26816{,}384^2 = 268M pairs. S4 kernel length 16,38416{,}384 with state 6464 runs O(Nlog⁡N)O(N \log N) near 16,384×14≈22916{,}384 \times 14 \approx 229K steps. Decay 0.991000=0.000040.99^{1000} = 0.00004 versus HiPPO 0.420.42 retention shows long memory kept.

Watch Out For

Using S4 where selection matters most

Fixed kernels average clutter with targets. Symptom: fine detail washes on busy scenes. Fix: move to selective Mamba variants for cluttered dense tasks.

The Quick Version

  • S4 structures 6464 dim states with HiPPO for long memory.
  • Runs as recurrence or 1616K long conv kernels.
  • Fixture 229229K steps replace 268268M pairs.
  • Fixed after training, unlike selective scans.
  • Use selective successors for cluttered scenes.