Source-linked AI summary

Dynamical Isometry and a Mean Field Theory of LSTMs and GRUs

Dar Gilboa, Bo Chang, Minmin Chen, Greg Yang, Samuel S. Schoenholz, Ed H. Chi, Jeffrey Pennington

arXiv:1901.08987v2cs.LGstat.ML

TL;DR

Long-sequence RNNs suffer from unstable signal and gradient propagation, and standard hyperparameter search may miss the narrow trainable region. The paper develops a mean field and dynamical-isometry analysis for LSTMs and GRUs, deriving initialization conditions that improve long-sequence training and generalization. Experiments show critical initialization can remain successful when standard initialization fails and can be orders of magnitude faster on harder sequences.

  • Problem

    Long-sequence RNN training is hindered by exploding or vanishing signals and gradients, while trainable initialization configurations can occupy a difficult-to-search low-dimensional subspace.

    Source: §1 · pp. 1–2
  • Method

    The paper uses mean field theory and dynamical isometry to characterize signal propagation and state-to-state Jacobian spectra, then derives initialization conditions for LSTMs and GRUs.

    Source: §2.1 · p. 2, §4.4 · p. 5
  • Results

    Critical initialization improves long-sequence trainability: it remains successful when standard initialization fails, and can train orders of magnitude faster as sequence length increases.

    Source: §1 · p. 2, §5.4 · p. 8
  • Takeaways & Limitations

    Initialization schemes satisfying the derived conditions dramatically improve long-sequence performance and show a beneficial effect on generalization error.

    Source: §2.1 · p. 2, §6 · p. 8

    The dynamical-isometry conditions define a multidimensional initialization subspace without a clear principled way to select one preferred initialization.

    Source: §6 · p. 8

Abstract

from arXiv · show

Training recurrent neural networks (RNNs) on long sequence tasks is plagued with difficulties arising from the exponential explosion or vanishing of signals as they propagate forward or backward through the network. Many techniques have been proposed to ameliorate these issues, including various algorithmic and architectural modifications. Two of the most successful RNN architectures, the LSTM and the GRU, do exhibit modest improvements over vanilla RNN cells, but they still suffer from instabilities when trained on very long sequences. In this work, we develop a mean field theory of signal propagation in LSTMs and GRUs that enables us to calculate the time scales for signal propagation as well as the spectral properties of the state-to-state Jacobians. By optimizing these quantities in terms of the initialization hyperparameters, we derive a novel initialization scheme that eliminates or reduces training instabilities. We demonstrate the efficacy of our initialization scheme on multiple sequence tasks, on which it enables successful training while a standard initialization either fails completely or is orders of magnitude slower. We also observe a beneficial effect on generalization performance using this new initialization.

1. Introduction

Long-sequence RNN training can fail because suitable initialization settings occupy a constrained subspace, so signals and gradients must both remain stable. The paper characterizes these conditions for LSTMs and GRUs and shows that critical initialization improves trainability as sequences lengthen.

1. Introduction

  • Standard hyperparameter searches can miss trainable configurations when those configurations lie in a low-dimensional subspace.Random, grid, and Bayesian search are not guaranteed to succeed under this constraint.Source: §1 · p. 1
  • Critical initialization remains trainable on longer sequences where standard initialization begins to fail.The paper illustrates this behavior with peephole LSTMs classifying sequences of MNIST digits.Source: Figure 1 · p. 1, §1 · p. 2
  • Initialization settings for long-sequence LSTMs and GRUs occupy a theoretically characterizable subspace whose conditions support signal propagation and stable gradients.Trainability requires relevant input signals to reach the loss while gradients avoid exponential explosion or vanishing.Source: §1 · p. 2
  • The analysis combines mean field signal-propagation theory with dynamical isometry to study recurrent architectures including GRUs, LSTMs, and peephole LSTMs.Experiments corroborate the calculations and motivate initialization schemes for long-sequence tasks.Source: §1 · p. 2

2. Background and related work

Prior work connects signal propagation and Jacobian spectra to trainability, while recurrent networks remain vulnerable to exploding or vanishing gradients. This paper builds on those analyses, considers generalization and beyond-initialization behavior, and positions initialization as complementary to architectural and optimization changes.

2.1. Mean field analysis of neural networks

  • Initialization schemes controlling signal propagation have improved benchmark performance in feed-forward and simple gated recurrent networks.Related feed-forward results enabled very deep architectures without batch normalization or skip connections.Source: §2.1 · p. 2
  • Mean field and random matrix theory analyze forward signal correlations and Jacobian singular values, with the latter targeted to improve gradient conditioning.Forward propagation is necessary but not sufficient for trainability, while backward analysis controls the first two moments of squared singular values.Source: §2.1 · p. 2
  • Modified initialization shows empirical evidence of beneficial rather than adverse effects on generalization error despite neural-network nonconvexity.The concern is that initialization could change the converged parameter-space location and worsen generalization.Source: §2.1 · p. 2

2.2. The exploding/vanishing gradient problem and signal propagation in recurrent networks

  • Exploding or vanishing gradients hinder long-sequence training, motivating approaches based on orthogonal weights, gradient modification or clipping, auxiliary losses, and altered recurrent architectures.These methods typically modify the training algorithm, loss, or architecture and are treated as complementary to initialization.Source: §2.2 · p. 2

2.3. Dynamics beyond initialization

  • The analysis is formulated at initialization, although large-width results suggest covariance quantities may remain nearly constant during training.The paper notes that finite-width networks can nevertheless gain trainability from satisfying the derived initialization conditions.Source: §2.3 · p. 3

3. Notation

The notation defines matrices and vectors by typography and introduces normalized traces and element-wise nonlinear operations used throughout the analysis.

3. Notation

  • Matrices use bold uppercase Latin characters, while vectors use bold lowercase Latin characters.Source: §3 · p. 3
  • The notation includes normalized traces, Hadamard products, element-wise sigmoid and tanh functions, and diagonal matrices.A diagonal matrix is denoted by D_a when a is placed on the diagonal.Source: §3 · p. 3

4. Mean field analysis of signal propagation and dynamical isometry

The paper develops a mean-field analysis of recurrent architectures that links initialization hyperparameters to forward signal timescales and state-to-state Jacobian spectra. Dynamical-isometry conditions combine stable signal propagation with controlled gradients, motivating critical initializations for LSTMs and GRUs.

4.1. Model description and important assumptions

  • The general recurrent formulation covers GRUs, LSTMs, peephole LSTMs, and related architectures under an untied-weights mean-field framework.At infinite width, pre-activations are approximated as jointly Gaussian, yielding deterministic dynamics for moments and correlations.Source: §4.1 · p. 4, §4.2 · p. 4

4.2. Forward signal propagation

  • Forward signal propagation is characterized by convergence toward a fixed point, whose rate defines an effective timescale ξ for information retention.Because the fixed point erases distinctions between input sequences, delaying convergence supports longer-range propagation; ξ diverges as χC∗_s approaches 1 from below.Source: §4.2 · pp. 4–5

4.3. Backwards signal propagation - the state-to-state Jacobian

  • The state-to-state Jacobian controls gradient stability because length-T gradients depend on matrix polynomials of order T in J.Choosing hyperparameters with mean squared singular value near 1 and small variance keeps powers of J from diverging rapidly.Source: §4.3 · p. 5

4.4. Dynamical Isometry

  • Dynamical-isometry conditions require stable forward propagation and controlled Jacobian spectra, although they may need to be satisfied approximately.The conditions are motivated by preventing exploding or vanishing gradients, and no architecture is guaranteed to satisfy all of them exactly.Source: §4.4 · p. 5
  • The predicted propagation timescale identifies transitions between high and low training accuracy across architectures and hyperparameter directions.Empirical evidence also indicates that timescales much larger than a task requires can degrade performance, while the Σz = 1 approximation remains predictive across tasks.Source: Figure 2 · p. 6, §4.4 · p. 6
  • For LSTMs, calculating signal timescales and Jacobian moments requires integrating over the stationary cell-state distribution.The paper uses specialized calculations because the additional cell state complicates the analysis.Source: §4.4 · p. 6

5. Experiments

Experiments show that the theoretical signal timescale predicts trainability transitions and that critical initialization improves long-sequence optimization. Across increasingly difficult tasks, it can accelerate training by orders of magnitude and preserve training where standard initialization fails.

5.1. Padded MNIST Classification

  • For padded MNIST, predicted propagation timescales agree with the transition between successful and unsuccessful training as sequence length and hyperparameters vary.The comparison uses untied-weight GRUs and LSTMs and overlays training accuracy with multiples of ξ.Source: §5.1 · p. 6

5.2. Squared Jacobian spectrum histograms

  • The predicted and empirical squared-singular-value moments agree for the state-to-state Jacobian, supporting the calculation under an ergodicity assumption.The spectrum changes dramatically between standard initialization and initialization near the dynamical-isometry conditions.Source: §5.2 · p. 7

5.3. Unrolled MNIST and CIFAR-10

  • Critical initializations are evaluated on unrolled MNIST and CIFAR-10 sequence tasks, including a CIFAR-10 case where the best initialization has ξ much smaller than the sequence length.This suggests that successful classification can use information from a subset of the sequence.Source: §5.3 · p. 7, Table 2 · p. 7

5.4. Repeated pixel MNIST and multiple digit MNIST

  • As sequences lengthen, critical initialization becomes faster by orders of magnitude than standard initialization, while standard initialization eventually fails and critical initialization still succeeds.For shorter sequences, the two initializations perform equivalently; the result holds for repeated-pixel and multiple-digit MNIST tasks.Source: Figure 4 · p. 7, §5.4 · p. 8

6. Discussion

The paper derives initialization schemes that stabilize forward and backward signal propagation and improve long-sequence performance. It identifies open questions about selecting among valid initializations and extending the analysis beyond initialization.

  • The derived initialization schemes dramatically improve performance on long sequence tasks by stabilizing input-to-loss signals and loss-to-weight gradients.Source: §6 · p. 8
  • The dynamical-isometry-satisfying initialization subspace is multidimensional, so the paper does not provide a principled rule for selecting one preferred initialization.Source: §6 · p. 8
  • The analysis indicates that the forget gate is critical, while some other gates or weight matrices may be removable without violating the conditions.Source: §6 · p. 8
  • Important open problems include choosing the forward-propagation time scale, quantifying violations of untied weights, and relaxing the constant Σz assumption.Source: §6 · p. 8
  • The persistence of dynamical-isometry conditions during training remains unresolved for both feed-forward and recurrent architectures.Source: §6 · p. 8

A. Details of Results

The appendix develops moment-based conditions for dynamical isometry and specializes them to recurrent architectures including LSTMs, peephole LSTMs, and GRUs. It also relates Jacobian statistics to forward signal propagation.

A.2. Moments of the state-to-state Jacobian and general form of the dynamical isometry conditions

  • The appendix characterizes dynamical isometry through normalized traces of powers of JJT and shows that controlling only the first moment is insufficient because singular-value variance can remain large.Source: §A.2 · pp. 10–11
  • Under the stated assumptions, the mean squared singular value of the state-to-state Jacobian is linked to χCs, the forward signal-propagation time scale.Source: §A.2 · p. 10
  • The general dynamical-isometry conditions can be satisfied when Σz = 1, a0 = 1, and ak≠0 = 0, motivating zero weight variances and large positive forget-gate bias limits.Source: §A.2 · p. 11

A.3. Dynamical isometry conditions for selected architectures

  • The resulting conditions are worked out separately for the LSTM, peephole LSTM, and GRU architectures.Source: §A.2 · p. 11, §A.3 · p. 11

A.3.3. LSTM

  • For the LSTM analysis, stability and approximation accuracy improve when the output gate is not concentrated near zero.Source: §A.3.2 · p. 11, §A.3.3 · p. 12

A.4. RNN Table supplement

  • Table 3 lists additional recurrent architectures in the paper’s general recurrent-network form, with pt denoting the network output at each time step.Source: Table 3 · p. 12

B. Auxiliary Lemmas and Proofs

The auxiliary results establish structural properties used in the signal-propagation analysis, including relations between forward dynamics, Jacobian moments, convexity, and fixed points.

C. The LSTM cell state distribution

The LSTM cell state has non-Gaussian stationary dynamics that can be analyzed through sampling and perpetuity theory. The resulting stationary distribution varies substantially with initialization hyperparameters.

D. Additional Experiments and Details of Experiments

The additional experiments test the mean-field dynamics, training predictions, LSTM state-distribution sampling, and initialization choices under settings that also expose deviations from the untied-weight assumption.

D.1. Dynamical system

  • The large-N calculation agrees well with simulations for the GRU dynamical system when weights are untied.Source: §D.1 · p. 16

D.2. Heatmaps

  • Figure 6 shows training accuracy across sequence lengths and hyperparameters for tied-weight networks, with deviations from the untied prediction.Performance generally improves when the predicted forward propagation time scale ξ is high, although tied weights are outside the analysis scope.Source: §D.2 · p. 16, Figure 6 · p. 17

D.3. Sampling the LSTM cell state distribution

  • Algorithm 1 efficiently approximates the stationary LSTM cell-state distribution across different initialization hyperparameters.The approximation agrees reasonably with simulations of width-N = 200 networks driven by i.i.d. Gaussian inputs.Source: §D.3 · p. 17, Figure 7 · p. 17

D.4. Critical initializations

  • For the unrolled CIFAR-10 task, µf was selected by grid search because solving the task does not require propagation across the entire sequence.The analytical results still constrain the hyperparameter space of potentially useful initializations.Source: §D.4 · p. 18

D.5. Standard initialization

  • The standard-initialization comparisons include Glorot uniform, orthogonal, and i.i.d. Gaussian initializations, with an eight-point learning-rate scan from 10^-2 to 10^-5.Validation sets contain 10000 images for MNIST and CIFAR-10.Source: §D.5 · p. 18, §D.5.1 · p. 18
Loading 1901.08987v2…