Abstract
State Space Models (SSMs) have emerged as a powerful alternative to Transformers for long-sequence modeling. However, their inference efficiency is often limited by the size of their internal state. This paper introduces Hankel Singular Value Regularization (HSVR), a novel training-time penalty that encourages models to concentrate information into a small fraction of their internal state. By leveraging classical system theory, HSVR enables up to 10x more post-training compression than standard methods with minimal loss in accuracy, effectively bridging the gap between high-capacity training and efficient deployment.
Introduction
State Space Models (SSMs), such as S4, S5, and Mamba, have demonstrated remarkable performance on tasks involving extreme sequence lengths. Unlike Transformers, which scale quadratically with sequence length, SSMs maintain a persistent internal state that allows for linear-time inference. However, a fundamental trade-off exists: a large state dimension ($n$) is necessary during training to capture complex dependencies, but this same large $n$ increases the computational footprint during inference.
Standard training procedures typically distribute information across the entire state space, making the models "incompressible." If one attempts to prune or truncate the state of a pre-trained SSM, accuracy usually collapses. To address this, we propose a regularization technique that forces the model to learn a low-rank representation of its own dynamics, allowing for massive state reduction after training without the need for expensive fine-tuning.
Methodology
Hankel Singular Values (HSVs)
Our approach is rooted in classical Control Theory. In linear systems, Hankel Singular Values (HSVs) quantify the contribution of specific state dimensions to the system's input-output behavior. A system with rapidly decaying HSVs is inherently compressible; its behavior can be closely approximated by a much smaller system.
The HSVR Penalty
We introduce a regularization term to the loss function consisting of the sum of the HSVs (essentially a nuclear norm for the system). By penalizing the sum of these values, we encourage the optimizer to find solutions where only a few state dimensions carry the majority of the "energy."
Mathematically, while individual singular values can be non-smooth and difficult to optimize, we prove that the sum of HSVs is differentiable. This allows the penalty to be integrated directly into standard gradient descent workflows.
Scalable Optimization
Computing HSVs typically requires solving Lyapunov equations, which has a complexity of $O(n^3)$. To make this viable for deep learning, we utilize a parametrization based on rotation matrices. This structure allows us to compute the necessary gradients in $O(n^2)$ time, ensuring that the regularization adds only a modest overhead (1.1x to 1.6x) to the training process.
Balanced Truncation
Once a model is trained with HSVR, we apply "Balanced Truncation." This technique physically removes the low-energy state dimensions identified by the regularizer. Because the model was trained to be sparse in its HSV distribution, this truncation results in a significantly smaller model that retains the performance of the original, larger version.
Experimental Evaluation
We evaluated HSVR on the Long Range Arena (LRA) benchmark, the standard stress test for sequence models. The tasks included:
- sCIFAR10 & sMNIST: Pixel-by-pixel image classification.
- IMDB: Long-form sentiment analysis.
- PATH & PATH-X: Connectivity tasks, with PATH-X featuring sequences of 16,384 steps.
Results and Discussion
The experimental results demonstrate that HSVR-trained models are significantly more robust to state truncation than their unregularized counterparts.
- Superior Compression: On sCIFAR10, HSVR models maintained high accuracy even after 80% of the state was removed. In contrast, standard models experienced a total collapse in performance at the same compression level.
- High-Fidelity Truncation: On sMNIST, the regularized model achieved 99% accuracy with an 80% truncation ratio. The unregularized version dropped to near-random accuracy (~13%).
- Solving PATH-X: On the notoriously difficult PATH-X task, HSVR was the only method capable of maintaining over 50% accuracy at high compression levels, while other state-of-the-art pruning techniques failed to outperform a random baseline.
An additional benefit of HSVR is Layer-Adaptive Pruning. Because the regularizer is applied globally, the model naturally allocates state capacity where it is most needed. This allows for more efficient compression than uniform pruning, where every layer is reduced by the same fixed percentage.
Conclusion and Future Work
HSVR represents a significant step forward in making State Space Models viable for resource-constrained environments. By bringing rigorous system-theoretic concepts into the deep learning optimization loop, we can produce models that are both highly expressive during training and exceptionally lean during inference.
Currently, the method is limited to linear time-invariant (LTI) layers and requires training from scratch. Future research will focus on extending these principles to time-varying or "selective" mechanisms, such as those found in Mamba, and exploring ways to apply similar logic to existing pre-trained weights.
Summary updated