Abstract
Recurrent Neural Networks (RNNs) are powerful for sequential data processing, yet their internal state dynamics often remain opaque. This paper investigates the geometry and temporal evolution of internal representations in a vanilla RNN using the Sequential MNIST task. Through dimensionality analysis and visualization, we demonstrate that while class-specific information is extracted early in a sequence, it is not immediately accessible to the output layer. Our results highlight that recurrent dynamics perform critical computational work to transform internal states into a decodable format, a process constrained by the expected temporal structure of the input.
Introduction
In contrast to deep convolutional networks where layers often correspond to hierarchical feature detection, the iterative nature of RNNs makes it difficult to isolate the contribution of individual time steps. This study explores how internal class representations evolve geometrically and how recurrent dynamics, independent of new information, facilitate final classification.
Methodology
The researchers utilized a "vanilla" RNN consisting of 200 tanh neurons without bias parameters to isolate the effects of recurrent and input weights. Analysis was performed using Principal Component Analysis (PCA) to track linear dimensionality and t-SNE for 2D visualization of high-dimensional states. The Sequential MNIST dataset served as the benchmark, where 28x28 images are processed row-by-row over 28 steps. Three key experiments decoupled information from dynamics:
- Experiment 1: Blanking out the final n rows while maintaining total sequence length.
- Experiment 2: Terminating the sequence early after n rows.
- Experiment 3: Appending blank rows after a complete sequence.
Key Insights and Results
Visualizations using t-SNE revealed that the network begins to cluster digits remarkably early. For instance, by time step 4 of 28, distinct groupings for certain digits are already visible.
However, this early "knowledge" is not immediately actionable. The linear output layer fails to correctly classify these early states, suggesting that the internal representation is evocative of the label but not yet in a decodable format.
The importance of processing time is further underscored by comparing Experiments 1 and 2. The network achieves significantly higher accuracy when allowed to continue its recurrent dynamics with blank inputs (Experiment 1) compared to being stopped immediately after the information is presented (Experiment 2).
This indicates that the recurrent dynamics themselves move the internal state into a "decodable zone." Conversely, Experiment 3 showed that adding blank rows after a full sequence leads to a sharp decline in accuracy. The internal state follows an oscillatory trajectory; if the sequence length deviates from what the network was trained on, it "overthinks" and moves out of the correct decision region.
Conclusion
The study confirms that RNNs follow a dimensionality expansion-compression cycle, similar to other deep architectures. A critical finding is the temporal lag between information acquisition and decodability. Future work could focus on "early classification" techniques to make these early internal clusters decodable, potentially enabling faster decision-making in real-time applications.
Summary updated