Skip to main content
QUICK REVIEW

[Paper Review] A Gentle Tutorial of Recurrent Neural Network with Error Backpropagation

Gang Chen|arXiv (Cornell University)|Oct 8, 2016
Neural Networks and ApplicationsComputer Science3 references96 citations
TL;DR

This paper provides a detailed, accessible tutorial on training recurrent neural networks (RNNs) using backpropagation through time (BPTT), with a focus on error backpropagation in RNNs and long short-term memory (LSTM) units. It derives gradients for shared parameters across time steps and explains how to compute them via unfolding in time, offering a clear foundation for sequence modeling in tasks like speech and handwriting recognition.

ABSTRACT

We describe recurrent neural networks (RNNs), which have attracted great attention on sequential tasks, such as handwriting recognition, speech recognition and image to text. However, compared to general feedforward neural networks, RNNs have feedback loops, which makes it a little hard to understand the backpropagation step. Thus, we focus on basics, especially the error backpropagation to compute gradients with respect to model parameters. Further, we go into detail on how error backpropagation algorithm is applied on long short-term memory (LSTM) by unfolding the memory unit.

Motivation & Objective

  • To clarify the backpropagation process in recurrent neural networks, which is often misunderstood due to feedback loops.
  • To provide a step-by-step derivation of error gradients for RNN parameters, especially for shared weights across time steps.
  • To extend the analysis to long short-term memory (LSTM) networks by unfolding the memory cell and deriving gradients for all gates.
  • To enable practitioners and researchers to implement and understand RNN training using standard optimization methods like stochastic gradient descent.

Proposed method

  • Uses backpropagation through time (BPTT) to compute gradients by unfolding the RNN across time steps.
  • Derives the gradient of the loss with respect to the output layer weights $W_{hz}$ and bias $b_z$ using the softmax cross-entropy objective.
  • Applies the chain rule to compute gradients for recurrent weights $W_{hh}$ by propagating error backward through time from $t$ to $0$.
  • Unfolds the LSTM unit over time to compute gradients for all gates (input, forget, output, candidate) using recursive dependency chains.
  • Derives the gradient of the tanh and softmax activation functions, which are essential for error propagation.
  • Uses the chain rule to propagate error backward through hidden states, updating gradients for all parameters via accumulation across time steps.

Experimental results

Research questions

  • RQ1How can error backpropagation be systematically applied in RNNs despite the presence of recurrent feedback loops?
  • RQ2What is the correct way to compute gradients for shared weights in RNNs across variable-length sequences?
  • RQ3How does the backpropagation process differ when applied to LSTM units compared to standard RNNs?
  • RQ4What are the analytical gradients for the tanh and softmax functions used in RNN and LSTM output layers?
  • RQ5How can gradients for all LSTM gate parameters be derived using the chain rule and time-unfolded computation?

Key findings

  • The gradient of the loss with respect to the output logits $\alpha_t$ is $-(y_t - z_t)$, which simplifies the backpropagation process for the final layer.
  • The gradient for shared weights $W_{hz}$ is computed by summing gradients across all time steps, ensuring parameter sharing generalizes well.
  • For recurrent weights $W_{hh}$, the gradient is computed via a chain of partial derivatives from $t+1$ back to $t=0$, using the BPTT method.
  • The gradient for the LSTM cell state $c_t$ is computed recursively backward using the chain rule, with the error from future time steps propagated through the forget gate.
  • The gradient for the hidden state $h_t$ is computed by aggregating contributions from all future time steps, enabling full parameter update via backpropagation.
  • The paper derives the analytical gradient of the tanh function as $1 - \tanh^2(x)$, which is essential for efficient error propagation in RNNs and LSTMs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.