Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling


Motivation

  • Problems with Vanilla RNNs

    : Gradient vanishing occurs, making it difficult to learn long-term dependencies. This complicates gradient-based optimization methods.

  • LSTMs were successfully introduced, but their high complexity has posed the problem of low computational efficiency. Accordingly, a simpler unit called the GRU was proposed, and prior studies showed results indicating that it performs at a level similar to LSTMs. Comparisons between LSTMs and GRUs have been made on fragmentary tasks, but a systematic and empirical comparison of LSTMs and GRUs across more general domains had not been conducted.

Contribution & Limitation

  • A performance comparison of vanilla RNNs, LSTMs, and GRUs was conducted on sequential speech & sound. General performance evaluation was carried out using various datasets.
  • However, which of GRU and LSTM is superior varied depending on the dataset and the task performed, and therefore no conclusion could be drawn. In addition, further experiments on how the components of the gating units contribute to learning were called for going forward.

LSTM & GRU

Figure

Figure

An image that represents Figure 1 used in the paper more intuitively

Vanila RNN

Figure

  • There is no gating unit.
  • Uses the tanh activation function.
  • It takes \(h_{t-1}\) and \(x_t\) as inputs, and outputs a new hidden unit \(h_t\) for the current time step t.
  • The basic structure is as follows. Here, \(\phi\) is a non-linear function:

    \[\mathbf{h}_t = \begin{cases} 0, & t = 0 \\ \phi\left(\mathbf{h}_{t-1}, \mathbf{x}_t\right), & \text{otherwise} \end{cases}\]
  • Looking more specifically at the \(\phi(h_{t-1}, x_t)\) part where the hidden state is updated:

    \[\mathbf{h}_t = g\left(W\mathbf{x}_t + U\mathbf{h}_{t-1}\right),\]
    • Here, the tanh function shown in the figure is typically used as the activation function g

LSTM

Figure

Figure

The LSTM is basically composed of three gates (the input gate, output gate, and forget gate) and a memory cell, the cell state.

  1. First, it takes \(x_t\) and \(h_{t-1}\) as inputs, which pass through the forget gate, determining how much of the information in the cell state \(C_{t-1}\) to retain.
  2. 1) The information \(x_t, h_{t-1}\) coming in as input passes through the input gate, determining how much new information is added to the memory.

    2) The input simultaneously passes through tanh, generating a new candidate \(\tilde{C}_t\).

  3. The value passed through the forget gate and the value passed through the input gate are added, updating \(C_t\).
  4. This again goes through tanh and passes through the output gate, updating \(h_t\)
  • Here, the gates play the role of determining how much information to discard and use, and the sigmoid function is used. The equations for each gate are as follows:

    \[\begin{aligned} f_t^j &= \sigma\left(W_f \mathbf{x}_t + U_f \mathbf{h}_{t-1} + V_f \mathbf{c}_{t-1}\right)^j, \\ i_t^j &= \sigma\left(W_i \mathbf{x}_t + U_i \mathbf{h}_{t-1} + V_i \mathbf{c}_{t-1}\right)^j, \end{aligned}\] \[o_t^j = \sigma\left(W_o \mathbf{x}_t + U_o \mathbf{h}_{t-1} + V_o \mathbf{c}_t\right)^j\]
  • The tanh function is used twice when \(h_t\) is output: once in \(c_t\), and once when generating \(\tilde{c}_t\):
\[\tilde{c}_t^j = \tanh\left(W_c \mathbf{x}_t + U_c \mathbf{h}_{t-1}\right)^j.\] \[h_t^j = o_t^j \tanh\left(c_t^j\right)\]
  • The equation for \(c_t\) is as follows:
\[c_t^j = f_t^j\, c_{t-1}^j + i_t^j\, \tilde{c}_t^j\]

GRU

Figure

Figure

The GRU is a more simplified approach, having two gates: the reset gate and the update gate. The reset gate plays a role similar to the forget gate in that it determines the degree to which the previous state is ignored. The update gate determines how much updating to perform between the newly computed h_t and the previous h_{t-1}.

  1. First, the input passes through the reset gate \(r_t\), determining how much \(h_{t-1}\) is ignored.

    \[r_t^j = \sigma\left(W_r \mathbf{x}_t + U_r \mathbf{h}_{t-1}\right)^j.\]
  2. The information passed through the reset gate goes through tanh and, together with the input, generates the candidate \(\tilde{h}_t\).

    \[\tilde{h}_t^j = \tanh\left(W\mathbf{x}_t + U\left(\mathbf{r}_t \odot \mathbf{h}_{t-1}\right)\right)^j,\]
  3. The input passes through the update gate \(z_t\), determining the degree to which \(h_t\) is updated.

    \[z_t^j = \sigma\left(W_z \mathbf{x}_t + U_z \mathbf{h}_{t-1}\right)^j.\]
  4. The values passed through the two gates above are added, computing the new \(h_t\).

    \[h_t^j = (1 - z_t^j) h_{t-1}^j + z_t^j \tilde{h}_t^j\]

Comparison between LSTM and GRU

  • Similarities
    • additive update

      Unlike the vanilla RNN, which completely replaces \(h_{t-1}\) according to new input, both LSTM and GRU perform updates by combining the previous state with new information.

      ⇒ Mitigation of the gradient vanishing problem

  • Differences
    • The LSTM can control the degree to which memory content is exposed using the output gate, whereas the GRU cannot. This allows the LSTM to adjust the current state more finely.
    • The input gate and forget gate of the LSTM are simplified into a single gate in the GRU, which has the effect of increasing the efficiency of information regulation.

Experiments and Result

Experiment Settings

  • Compared LSTM, GRU, and tanh units under a similar number of parameters
  • test set: Four polyphonic music datasets (Nottingham, JSB Chorales, MuseData, Piano-midi) and two speech signal datasets provided by Ubisoft
  • RMSProp was used as the optimizer
  • Evaluation: Checked the average negative log-probabilities for each dataset, and examined the learning curves with respect to Wall Clock Time and epoch

Results

Figure

For the Nottingham dataset, the tanh unit showed the highest performance, but considering that all models showed a similar level of performance, the GRU showed the highest performance on the Music Dataset. On the other hand, for the Ubisoft Dataset, GRU and LSTM each showed the best performance once.

Figure

Figure

Looking at the learning curves as well, the GRU generally showed the fastest convergence speed and performance. The LSTM also showed a level of performance similar to the GRU, but the tanh unit, as can be seen in the Ubisoft dataset, showed lower performance compared to the two gating units.