Dynamic compression and expansion in a classifying recurrent network

Matthew Farrell, Stefano Recanatesi, Guillaume Lajoie, Eric Shea‐BrownbioRxiv 2019

Abstract

Recordings of neural circuits in the brain reveal extraordinary dynamical richness and high variability. At the same time, dimensionality reduction techniques generally uncover low-dimensional structures underlying these dynamics when tasks are performed. In general, it is still an open question what determines the dimensionality of activity in neural circuits, and what the functional role of this dimensionality in task learning is. In this work we probe these issues using a recurrent artificial neural network (RNN) model trained by stochastic gradient descent to discriminate inputs. Through simulations and mathematical analysis, we show how the dimensionality of RNN activity depends on the task parameters and evolves over time and over stages of learning. We find that common solutions produced by the network naturally compress dimensionality, while variability-inducing chaos can expand it. We show how chaotic networks balance these two factors to solve the discrimination task with high accuracy and good generalization properties.

Introduction: The Paradox of Neural Dimensionality

A central paradox in neuroscience is the observation of high-dimensional, variable neural activity that nevertheless collapses onto low-dimensional manifolds during task execution. This raises a fundamental question: what determines the dimensionality of a neural representation? In learning theory, there is a known tension between high-dimensional representations—useful for separating complex data (the "kernel trick")—and low-dimensional representations, which favor generalization by ignoring noise (Occam’s Razor). This paper investigates how Recurrent Neural Networks (RNNs) navigate this trade-off, specifically looking at how internal chaotic dynamics interact with optimization via Stochastic Gradient Descent (SGD).

Methods: Training Recurrent Networks for Classification

The researchers trained standard RNNs ($N=200$ units) on a delayed classification task. The core of the study involves comparing two initialization regimes:

  1. Edge of Chaos: Networks initialized to be stable or only weakly chaotic.
  2. Strongly Chaotic: Networks initialized with high internal gain, where internal dynamics rapidly amplify small input differences.
Schematic of the RNN classification task, showing inputs, internal recurrent dynamics during a delay period, and the eventual linear separation of activations at the evaluation time.

To quantify the internal state space, the authors used Effective Dimensionality (ED), a metric based on the participation ratio of eigenvalues of the activity covariance matrix. This allowed them to track how "spread out" or "compressed" the network's internal representations were throughout the learning process and during the task's temporal delay.

Key Insights: The Expansion-Compression Arc

The study reveals that RNNs solve classification tasks through a dynamic interplay between expansionary and compressive forces.

SGD as an Opportunistic Compressor

Mathematical analysis of a simplified linear model suggests that SGD acts as a natural "compressor." It pulls points from the same class together, effectively building invariance to noise. The researchers proved that hidden representation updates are scaled by a factor less than one in directions orthogonal to the readout, confirming that compression is an inherent byproduct of gradient-based optimization.

Chaos as a Computational Resource

In tasks with low-dimensional inputs, "Edge of Chaos" networks often struggle because they cannot project data into a sufficiently high-dimensional space for linear separation. In contrast, strongly chaotic networks use their inherent instability to "expand" inputs into a high-dimensional space. SGD then "prunes" this expanded representation into a useful, compressed form. This results in a "U-shaped" dimensionality trajectory over time: initial expansion driven by chaos followed by compression driven by learning.

Comprehensive results showing (b) Lyapunov spectra for different regimes, (c) unit activations over time, (e) the drop in Effective Dimensionality (ED) during the delay, and (g) the resulting generalizability of the representations.

Key Results and Generalization

  • Performance vs. Initialization: Chaotic networks achieved near-perfect accuracy on difficult low-dimensional input tasks where stable networks failed.
  • Dimensionality Dynamics: For high-dimensional inputs, ED dropped significantly (e.g., from ~40 to ~10) during the delay period as the network learned to ignore within-class variability.
  • Generalization: A strong correlation was found between the degree of compression and the network's ability to generalize to unseen data. The more the network compressed its representation while maintaining performance, the better its testing accuracy.

Conclusion and Future Directions

This work demonstrates that RNNs achieve robust classification by balancing the expansionary force of chaos with the compressive force of SGD. While the current study focused on static inputs and linear approximations, it provides a powerful framework for understanding how biological and artificial networks form compact, generalizable representations. Future research will explore whether these principles extend to more complex, time-varying sequence-to-sequence tasks and larger-scale datasets like ImageNet.

Summary updated

BibTeX
@misc{farrell2019dynamic,
  author = {Matthew Farrell and Stefano Recanatesi and Guillaume Lajoie and Eric Shea‐Brown},
  title = {{Dynamic compression and expansion in a classifying recurrent network}},
  year = {2019},
  doi = {10.1101/564476},
  howpublished = {bioRxiv},
}
Figure