Multiway Multislice PHATE: Visualizing Hidden Dynamics of RNNs through Training

Jiancheng Xie, Lou C Voinov, Noga Mudrik, Gal Mishne, Adam Shabti Charles

TL;DR

This paper introduces MM-PHATE, a novel visualization technique for understanding the internal workings of Recurrent Neural Networks (RNNs) during training. By simultaneously visualizing hidden states across time, training epochs, and network units, MM-PHATE offers unprecedented insight into how RNNs learn and adapt, moving beyond static snapshots of trained models.

What Problem Does This Paper Address?

Recurrent Neural Networks (RNNs) are powerful tools for sequential data, but their internal dynamics remain largely opaque, making it difficult to understand how they learn. Existing visualization methods often focus on the network's state after training, missing the crucial evolution of representations during the learning process. This gap hinders the development of better RNN architectures and optimization strategies. The authors aim to bridge this gap by providing a method to visualize the dynamic evolution of RNN hidden states across multiple dimensions simultaneously.

Methods

The core contribution is Multiway Multislice PHATE (MM-PHATE), an extension of the PHATE (Potential of Heat-diffusion for Affinity-based Trajectory Embedding) visualization technique. MM-PHATE constructs a multiway multislice kernel that captures similarities between RNN hidden units across three key dimensions:

  • Time: Within a single training epoch, how hidden states evolve as the network processes a sequence.
  • Epoch: How the network's representations change across different training stages.
  • Units: The relationships and community structures among individual hidden units.

This kernel is then embedded into a low-dimensional space using PHATE, providing a unified view of the RNN's internal dynamics throughout training. The method is designed to preserve both local and global structures in the data, allowing for the visualization of complex trajectories and community formations.

Datasets

The authors evaluate MM-PHATE on:

  • Controlled Synthetic Benchmarks:
    • Hopf and Pitchfork Bifurcations: These systems are used to generate synthetic data that mimics dynamical transitions and bifurcations, allowing for controlled testing of MM-PHATE's ability to recover known structures under various perturbations (e.g., smooth state-space warps).
  • Real RNN Applications:
    • Area2Bump Dataset: A neuroscience-benchmark dataset containing neural activity recordings from macaques during a reaching task.
  • Human Activity Recognition (HAR) Dataset: A dataset of kinematics from smartphone sensors for activity recognition.

Key Insights and Ideas

  • Beyond Static Snapshots: MM-PHATE reveals that understanding RNNs requires looking at their dynamics during training, not just after. The evolution of representations over time and epochs is as crucial as the final state.
  • Uncovering Learning Phases: The visualizations highlight distinct phases of learning, such as information processing and compression, which are not apparent with traditional methods.
  • Geometric Signatures of Learning: Changes in the geometry of the embedding space (e.g., contraction, expansion, stabilization) directly correlate with learning progress and performance gains.
  • Temporal Specialization: MM-PHATE can identify units that become more or less temporally selective as training progresses, suggesting a specialization of roles within the network.
  • Robustness to Perturbations: The method demonstrates a degree of robustness to smooth coordinate transformations, suggesting that the captured dynamics are not solely artifacts of the specific representation.

Key Results

  • Synthetic Benchmarks: MM-PHATE successfully recovers known dynamical progressions in synthetic systems, distinguishing between different bifurcation families (Hopf vs. Pitchfork) and remaining informative even under smooth state-space warps.
  • Task-Trained RNNs (Area2Bump & HAR):
    • MM-PHATE reveals a clear reorganization of hidden states around mid-training, coinciding with validation performance improvements.
  • Time-resolved entropy summaries align with linear probes, time-step ablations, and mutual information analyses, validating the interpretation of learned representations.
  • On the HAR dataset, MM-PHATE identified a significant transition in within-sequence dynamics around epoch 7, correlating with performance gains and increased temporal specialization.
  • Comparison to Baselines: MM-PHATE consistently outperforms standard dimensionality reduction techniques (PCA, t-SNE, Isomap, LLE, UMAP) in preserving relevant structures and revealing learning-relevant dynamics, especially when dealing with temporal and epoch-wise evolution.

Limitations and Future Work

  • Non-Smooth Dynamics: MM-PHATE's interpretability might be reduced for highly non-smooth training dynamics (e.g., abrupt restarts or extreme learning rates).
  • Scalability: The $O(N^2)$ complexity of the kernel construction can be a limitation for very large networks, though subsampling and approximations are suggested as practical solutions.
  • Theoretical Guarantees: While empirical evidence is strong, extending the analysis to develop theoretical guarantees for invariance or equivalence under various transformations remains an important direction.
  • Richer Architectures: Extending MM-PHATE to more complex architectures like deeper recurrent stacks or attention-based models is a promising avenue for future work.

Summary updated

BibTeX
@article{xie2025multiway,
  author = {Jiancheng Xie and Lou C Voinov and Noga Mudrik and Gal Mishne and Adam Shabti Charles},
  title = {{Multiway Multislice PHATE: Visualizing Hidden Dynamics of RNNs through Training}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=9Yr4V7iZsq},
}
Figure