Abstract
Recurrent Neural Networks (RNNs), specifically LSTMs, are powerful but often overparameterized, leading to high computational costs and overfitting. This paper introduces a Bayesian approach to sparsify LSTMs by transforming complex, dynamic gates into simple constants. By applying Sparse Variational Dropout to gate preactivations, the model automatically identifies redundant components. This method achieves extreme compression—up to 19,000x on sentiment classification—while revealing the minimal architectural requirements for specific tasks.
Introduction
LSTMs are the workhorses of sequential data processing but are notoriously "heavy." Traditional compression techniques like matrix factorization or basic pruning often require manual tuning of thresholds. Bayesian sparsification offers an automated alternative by treating weights as random variables. This research addresses the "middle ground" of LSTM architecture: the internal gates ($i, f, o, g$) that govern information flow.
Methodology: Gate-Level Sparsification
The authors extend Sparse Variational Dropout (SparseVD) by introducing multiplicative group variables ($z$) for gate preactivations. This creates a three-level hierarchy of sparsity:
- Weight Sparsification: Pruning individual weights.
- Neuron Sparsification: Removing entire neurons by zeroing their activations.
- Gate Sparsification: If the $z$ variable for a gate preactivation goes to zero, that gate becomes a constant determined only by its bias.
When a gate becomes constant, the model no longer needs to calculate its complex non-linear activations (sigmoid or tanh) or the associated matrix multiplications, leading to significantly faster inference.
Key Results and Insights
The method was evaluated on text classification (IMDb, AGNews) and language modeling (Penn Treebank).
Extreme Compression
The quantitative results are significant:
- IMDb Classification: The model achieved a 19,747x compression ratio with virtually no loss in accuracy. The number of hidden neurons dropped from 128 to just 4.
- Word-level PTB: Achieved 24.5x compression, demonstrating effectiveness even on complex language modeling tasks.
Task-Specific Architectures
The model "learns" which gates are necessary for a given task. For classification, where a final answer is provided at the end of a sequence, the model often simplifies the gating structure significantly. In contrast, character-level language modeling requires a more complex arrangement to track syntax and long-term dependencies.
Performance and Convergence
The Bayesian framework allows the model to reach high levels of sparsity without sacrificing performance. Training curves show that the model effectively minimizes bits-per-character while the sparsification process takes hold.
Conclusion
Bayesian gate sparsification provides a robust mechanism for simplifying LSTMs. By reducing dynamic gates to constants, the method not only achieves massive compression but also improves inference speed and model interpretability. This approach paves the way for deploying sophisticated RNNs on resource-constrained edge devices.
Summary updated