TL;DR
This paper demonstrates that two simple, non-invasive regularization techniques—Activation Regularization (AR) and Temporal Activation Regularization (TAR)—can significantly improve the performance of Recurrent Neural Networks (RNNs) in language modeling. By penalizing large activations and rapid changes in hidden states, these methods achieve results comparable to or better than complex, architecture-altering techniques while remaining fully compatible with high-performance libraries like NVIDIA’s cuDNN.
What Problem Does This Paper Address?
Regularizing Recurrent Neural Networks (RNNs) is notoriously difficult. Standard techniques like dropout, which work wonders for feed-forward networks, are "destructive" when applied naively to the recurrent connections of an RNN, making it nearly impossible for the model to retain information over long sequences.
To solve this, researchers have developed specialized methods like Variational Dropout, Zoneout, or entirely new architectures (like the Recurrent Highway Network). However, these often require significant changes to the underlying RNN cell math. This complexity makes them harder to implement and, crucially, prevents them from using highly optimized, "black-box" implementations like the cuDNN LSTM, which can be many times faster than custom versions. The authors ask: Can we achieve state-of-the-art regularization without touching the RNN cell itself?
Methods
The authors revisit two "traditional" regularization strategies that act on the network's activations rather than its weights or architecture. These are added as penalty terms to the standard loss function:
- Activation Regularization (AR): This is essentially $L_2$ regularization applied to the RNN's output activations. It penalizes the model when hidden states ($h_t$) become excessively large, encouraging the network to find more stable, sparse representations.
- Formula: $\alpha L_2(m \odot h_t)$, where $m$ is a dropout mask and $\alpha$ is a scaling coefficient.
- Temporal Activation Regularization (TAR): This is a form of "slowness regularization." It penalizes large changes between successive hidden states ($h_t$ and $h_{t+1}$), encouraging the model to maintain consistency over time.
- Formula: $\beta L_2(h_t - h_{t+1})$, where $\beta$ is a scaling coefficient.
Because these are just additions to the loss function, they can be applied to any RNN architecture (LSTM, GRU, or even a basic tanh RNN) without modifying the internal code.
Datasets
The researchers evaluated their methods on two standard language modeling benchmarks:
- Penn Treebank (PTB): A small, classic dataset where preventing overfitting is the primary challenge.
- WikiText-2 (WT2): A dataset roughly twice the size of PTB with a much larger vocabulary, providing a more realistic test of language modeling capabilities.
Key Insights and Ideas
- The Power of Simplicity: You don't always need a complex new architecture to improve performance. AR and TAR provide a "free lunch" by improving accuracy through the loss function alone.
- Hardware Efficiency: Because these methods don't change the RNN cell, they are compatible with NVIDIA's cuDNN LSTM. This allows researchers to enjoy both state-of-the-art regularization and the massive speedups provided by hardware-optimized kernels.
- Generality: While tested primarily on LSTMs, the authors showed that AR and TAR also significantly improved the performance of GRUs and even simple tanh RNNs. In the case of tanh RNNs, TAR acted as an implicit "identity initialization," helping the model learn long-term dependencies that are usually impossible for simple RNNs.
- Joint Optimization: The authors found that while both AR and TAR help individually, they work best when used together, though the scaling coefficients ($\alpha$ and $\beta$) need to be slightly reduced to avoid over-regularizing the model.
Key Results
The results show that AR and TAR consistently push standard LSTMs into the territory of much more complex models.
As seen in Table 1 above, increasing the $\alpha$ coefficient for AR alone dropped validation perplexity on PTB from 78.4 to 73.0. When both AR and TAR were applied to a large LSTM (h=1500), the test perplexity dropped from 68.3 to 65.4, as shown in the main results table:
These results are competitive with the Recurrent Highway Network (RHN), a human-designed custom architecture, despite the LSTM being a standard, off-the-shelf component.
Limitations and Future Work
- Hyperparameter Sensitivity: The effectiveness of AR and TAR depends on finding the right values for $\alpha$ and $\beta$. The authors noted that their WikiText-2 results, while good, might have been even better if they had performed a full hyperparameter search specifically for that dataset rather than reusing PTB values.
- Comparison to NAS: While AR/TAR-regularized LSTMs are excellent, they are still slightly outperformed by cells discovered via Neural Architecture Search (NAS). However, the authors argue that the simplicity and speed of regularized LSTMs make them a more practical choice for many engineers.
- Future Directions: The authors suggest that AR and TAR could likely be combined with other non-invasive techniques, like Variational Dropout, to push performance even further.
Summary updated