Piecewise-Static Factors in Parallel Linear Recurrences

Many sequence models try to split what stays fixed in a sequence from what changes. A video splits into who is moving and how they move; speech splits into who is speaking and what is said. Methods that make this split, called static–dynamic disentanglement, almost all assume the fixed part is fixed for the whole sequence. Real long sequences break that assumption: a speaker hands over to another, a character changes clothes, a sensor is swapped mid-recording. The same methods also tend to rely on step-by-step recurrent networks or many-step diffusion samplers, so they get slow exactly when sequences get long enough for identity to change.

We propose a single recurrent layer that handles both problems. Some of its channels hold a running average of their input and are reset only at rare, learned moments, so they encode identity that is constant within a segment and can switch between segments. The remaining channels decay quickly and encode motion or phonetic content. Every update is linear in the hidden state, so the whole sequence can be processed with a parallel scan, an algorithm that combines steps in a tree, in $O(\log L)$ depth instead of $L$ sequential steps. The main claim is that a sparse reset signal is the one ingredient needed to move from "static everywhere" to "static per segment." We further claim it costs nothing on standard benchmarks, where the resets switch off, and that it beats two-stage pipelines on sequences where identity changes.

Core Claim and Mechanism

Three results set up the idea. Multifactor Sequential Disentanglement via Structured Koopman Autoencoders fits a single linear transition matrix to latent frames and defines the static subspace as the eigenvectors with eigenvalue exactly 1. Disentanglement Beyond Static vs. Dynamic carries that spectral constraint into a state-space model (SSM-SKD). Resurrecting Recurrent Neural Networks for Long Sequences shows that diagonal linear recurrences with eigenvalues parameterized as $\exp(-\nu+i\theta)$ train stably and in parallel. All of these treat an eigenvalue of 1 as permanent, so a static channel can never forget. We make the "eigenvalue 1" property conditional on the input. That turns a global spectral split into one that holds per segment.

For each static channel block $k$, the encoder emits a per-frame feature $u^k_t$ and a reset probability $r^k_t \in [0,1]$ computed from a short window of frames. It maintains a gated sum and count,

$$a^k_t = (1-r^k_t)\,a^k_{t-1} + u^k_t, \qquad n^k_t = (1-r^k_t)\,n^k_{t-1} + 1,$$

and the static code is $s^k_t = a^k_t / n^k_t$. Both recurrences are linear in the state with input-dependent diagonal coefficients, so they are associative and scan-parallel. A matching backward scan gives each frame the mean over its whole segment. When $r^k_t = 0$ the channel has eigenvalue exactly 1 and averages evidence. When $r^k_t = 1$ it starts a new segment.

The construction gives a structural barrier against leakage, which is when frame-order information hides in the static code. Within a segment, $s^k$ is a mean and therefore unchanged by shuffling the frames. The only order information it can carry is where its resets fall. This is the frame-shuffling invariance that Sequential Representation Learning via Static-Dynamic Conditional Disentanglement imposes as a training constraint, and the same spatial-shuffling idea DSI2I uses for style. Here it holds by construction.

The dynamic channels form a diagonal complex linear recurrence in the style of the Linear Recurrent Unit. Their magnitudes are capped at $1-\epsilon$, mirroring the Koopman $\epsilon$-ball, so they cannot act as hidden integrators. Their input is the frame feature minus the current segment mean, borrowing the subtraction bias of Sequential Disentanglement by Extracting Static Information From A Single Sequence Element. Their input projections are modulated by $s_t$. This modulation lets dynamics depend causally on identity, as the conditional-flow and diffusion papers argue they should. It keeps associativity because $s_t$ is computed by an earlier scan. The research file presents static-conditioned parallel scans as an open tension (Gap 1); this two-pass construction shows that tension is only apparent.

A per-frame decoder reconstructs frames from $(s_t, d_t)$, where $d_t$ is the dynamic state, under a standard sequential VAE objective. We add one regularizer that pushes the reset rate toward sparsity:

$$\mathcal{L} = \mathcal{L}_{\text{recon}} + \beta\,\mathcal{L}_{\text{KL}} + \gamma \sum_{k,t} r^k_t .$$

Here $\gamma$ trades segment granularity against fit. In practice we use a hard-concrete relaxation of $r$ so that resets are near-binary at test time. Each block resets on its own schedule. This lets one factor, such as clothing, switch while another, such as body type, persists, which is a step toward the multi-factor setting without fixing the number of segments in advance.

Research Program

The first stage builds the layer on the parallel scan from the LRU line of work and confirms the sanity case. On Sprites, MUG and TIMIT, where identity truly is constant, learned resets should collapse to near zero. Swap and classification metrics should then match the global-Koopman and SSM-SKD models.

The second stage builds the benchmark the field lacks, which is sequences with ground-truth identity switches. Switching-Sprites concatenates clips whose static attributes change at random times. We also make a variant where only one attribute changes at each switch, which tests per-block independence. Switching-TIMIT concatenates utterances from different speakers into sequences of thousands of frames, which is in effect unsupervised speaker-change detection with disentangled content. Switching-MUG concatenates expression clips from different subjects. Ground-truth boundaries make reset quality directly measurable.

The third stage studies scaling. We measure training wall-clock time and memory against sequence length, compared with the LSTM-based single-element model and with DiffSDA sampling cost. The aim is to show the depth advantage translates into usable throughput on long concatenated sequences.

Baselines

The naive reference point is a global-static model with resets forced off. This is our own architecture with $r \equiv 0$, which reduces to an LRU version of a single static subspace. It isolates the key ingredient. If it matches the full model on switching data, the reset idea adds nothing. On the standard benchmarks it is the ceiling we must not fall below.

The strongest existing method on standard benchmarks is the structured Koopman autoencoder. It reports 100% static-feature preservation in Sprites swaps and a 4.46% static equal error rate (EER, the error at which false accepts equal false rejects) on TIMIT, per Multifactor Sequential Disentanglement via Structured Koopman Autoencoders. On MUG the reference is the single-element model's 86.90% classification accuracy and 54% leakage gap, from Sequential Disentanglement by Extracting Static Information From A Single Sequence Element. On the TIMIT disentanglement gap the reference is DiffSDA's 42.29%, from DiffSDA. SSM-SKD reports roughly 16% improvement on Sprites, but the file gives no absolute value. We will rerun SSM-SKD and the Koopman model from released or reimplemented code under our data splits, latent size and an equal hyperparameter-search budget measured in GPU-hours.

On the switching benchmarks, no reported result was found on Lacuna for any method. Here the strongest competitor is a two-stage pipeline. A change-point detector, either a classical spectral one or one trained on encoder features, segments the sequence, and the Koopman or single-element model is then run on each segment. We also report an oracle variant that is given true boundaries. Beating the baseline means three things. Per-segment swap accuracy must be within two points of the oracle and above the two-stage pipeline. Reset boundary F1 must beat the detector. On standard benchmarks we must stay within one point of the Koopman and single-element numbers. A second ablation removes the mean-subtraction input to the dynamic channels, and a third replaces the gated mean with an unconstrained selective SSM gate. The third ablation tests whether the averaging form, rather than mere input-dependence, is what prevents leakage.

Why not just…?

Why not just segment first and then run an existing disentangler on each piece? This is the most serious threat. It is why the two-stage pipeline and its oracle are central baselines and not afterthoughts. Our argument for doing it jointly is that what defines a change point is a change in the static factor, which is exactly what the detector does not yet know. A detector on raw features will fire on large motions, such as a sprite slashing, and miss subtle identity changes, such as a similar-voiced speaker. The joint model only pays the reset penalty when reconstruction demands a new static code. If the two-stage pipeline matches us on boundary F1 and swap accuracy, the honest conclusion is that resets are a convenience rather than a capability. The paper would then be reframed around throughput alone.

Why not just use a selective SSM like Mamba and let its gates learn this? A Mamba-style gate can in principle represent a reset. But nothing makes its channels average, so static information spreads across many leaky channels with no shuffle invariance. This is the monolithic-state entanglement that Slot State Space Models identifies for objects. The style-transfer SSMs Mamba-ST and SaMam inject style through predicted transition parameters but offer no guarantee about what each channel holds. The unconstrained-gate ablation tests this directly with a frame-shuffle leakage probe and swap accuracy.

Why not just use a Transformer or an LSTM with an information penalty? A Transformer conditioned per segment would work on short clips. Its quadratic memory, however, is the reason the SlotSSM, SaMam and Mamba4D comparisons in the file favor linear models at thousands of frames. An LSTM reimposes $L$ sequential steps. The file also notes that mutual-information penalties and multi-term losses are fragile compared with architectural biases. We include the single-element LSTM model in the wall-clock study rather than relying on this argument alone.

Proposed Experiments and Decisive Checks

The first decisive check is the collapse test. On Sprites, MUG and TIMIT, learned reset rates should fall below one per sequence. Metrics should then match the $r\equiv0$ ablation and the cited Koopman and single-element numbers within a point. If resets stay active on truly static data, the sparsity mechanism is leaking dynamics into identity and the idea fails.

The second check runs on Switching-Sprites and Switching-TIMIT. We measure boundary F1 against ground truth, per-segment attribute-classifier swap accuracy, and per-segment speaker EER. For multi-factor switches we also measure whether only the block owning the changed attribute resets. The full model must beat the two-stage pipeline and approach the oracle.

The third check probes leakage. A classifier trained to predict frame order or action from $s$ after shuffling frames within each segment should stay at chance. The same probe applied to the unconstrained-gate ablation should not.

The fourth check covers efficiency. We report training time and peak memory at sequence lengths from 64 to several thousand frames, compared with the LSTM-based model and with DiffSDA's per-sequence sampling cost.

Together these checks separate three possible outcomes: the reset mechanism itself helps, the result comes only from a fast backbone, or a simple segment-then-disentangle pipeline would have done just as well.