Speech Recognition with Deep Recurrent Neural Networks

Alex Graves, Abdel-rahman Mohamed, Geoffrey Hinton

Introduction

Neural networks have a long history in speech recognition, usually in combination with hidden Markov models . They have gained attention in recent years with the dramatic improvements in acoustic modelling yielded by deep feedforward networks . Given that speech is an inherently dynamic process, it seems natural to consider recurrent neural networks (RNNs) as an alternative model. HMM-RNN systems have also seen a recent revival , but do not currently perform as well as deep networks.

Instead of combining RNNs with HMMs, it is possible to train RNNs ‘end-to-end’ for speech recognition . This approach exploits the larger state-space and richer dynamics of RNNs compared to HMMs, and avoids the problem of using potentially incorrect alignments as training targets. The combination of Long Short-term Memory , an RNN architecture with an improved memory, with end-to-end training has proved especially effective for cursive handwriting recognition . However it has so far made little impact on speech recognition.

RNNs are inherently deep in time, since their hidden state is a function of all previous hidden states. The question that inspired this paper was whether RNNs could also benefit from depth in space; that is from stacking multiple recurrent hidden layers on top of each other, just as feedforward layers are stacked in conventional deep networks. To answer this question we introduce deep Long Short-term Memory RNNs and assess their potential for speech recognition. We also present an enhancement to a recently introduced end-to-end learning method that jointly trains two separate RNNs as acoustic and linguistic models . Sections 2 and 3 describe the network architectures and training methods, Section 4 provides experimental results and concluding remarks are given in Section 5.

Recurrent Neural Networks

Given an input sequence x=(x1,,xT)\bm{x}=(x_{1},\ldots,x_{T}), a standard recurrent neural network (RNN) computes the hidden vector sequence h=(h1,,hT)\bm{h}=(h_{1},\ldots,h_{T}) and output vector sequence y=(y1,,yT)\bm{y}=(y_{1},\ldots,y_{T}) by iterating the following equations from t=1t=1 to TT:

where the WW terms denote weight matrices (e.g. WxhW_{xh} is the input-hidden weight matrix), the bb terms denote bias vectors (e.g. bhb_{h} is hidden bias vector) and H\mathcal{H} is the hidden layer function.

H\mathcal{H} is usually an elementwise application of a sigmoid function. However we have found that the Long Short-Term Memory (LSTM) architecture , which uses purpose-built memory cells to store information, is better at finding and exploiting long range context. Fig. 1 illustrates a single LSTM memory cell. For the version of LSTM used in this paper H\mathcal{H} is implemented by the following composite function:

where σ\sigma is the logistic sigmoid function, and ii, ff, oo and cc are respectively the input gate, forget gate, output gate and cell activation vectors, all of which are the same size as the hidden vector hh. The weight matrices from the cell to gate vectors (e.g. WsiW_{si}) are diagonal, so element mm in each gate vector only receives input from element mm of the cell vector.

One shortcoming of conventional RNNs is that they are only able to make use of previous context. In speech recognition, where whole utterances are transcribed at once, there is no reason not to exploit future context as well. Bidirectional RNNs (BRNNs) do this by processing the data in both directions with two separate hidden layers, which are then fed forwards to the same output layer. As illustrated in Fig. 2, a BRNN computes the forward hidden sequence h\bm{\overrightarrow{h}}, the backward hidden sequence h\bm{\overleftarrow{h}} and the output sequence y\bm{y} by iterating the backward layer from t=Tt=T to 11, the forward layer from t=1t=1 to TT and then updating the output layer:

Combing BRNNs with LSTM gives bidirectional LSTM , which can access long-range context in both input directions.

A crucial element of the recent success of hybrid HMM-neural network systems is the use of deep architectures, which are able to build up progressively higher level representations of acoustic data. Deep RNNs can be created by stacking multiple RNN hidden layers on top of each other, with the output sequence of one layer forming the input sequence for the next. Assuming the same hidden layer function is used for all NN layers in the stack, the hidden vector sequences hn\bm{h}^{n} are iteratively computed from n=1n=1 to NN and t=1t=1 to TT:

where we define h0=x\bm{h}^{0}=\bm{x}. The network outputs yty_{t} are

Deep bidirectional RNNs can be implemented by replacing each hidden sequence hn\bm{h}^{n} with the forward and backward sequences hn\bm{\overrightarrow{h}}^{n} and hn\bm{\overleftarrow{h}}^{n}, and ensuring that every hidden layer receives input from both the forward and backward layers at the level below. If LSTM is used for the hidden layers we get deep bidirectional LSTM, the main architecture used in this paper. As far as we are aware this is the first time deep LSTM has been applied to speech recognition, and we find that it yields a dramatic improvement over single-layer LSTM.

Network Training

We focus on end-to-end training, where RNNs learn to map directly from acoustic to phonetic sequences. One advantage of this approach is that it removes the need for a predefined (and error-prone) alignment to create the training targets. The first step is to to use the network outputs to parameterise a differentiable distribution Pr(yx)\Pr(\bm{y}|\bm{x}) over all possible phonetic output sequences y\bm{y} given an acoustic input sequence x\bm{x}. The log-probability logPr(zx)\log\Pr(\bm{z}|\bm{x}) of the target output sequence z\bm{z} can then be differentiated with respect to the network weights using backpropagation through time , and the whole system can be optimised with gradient descent. We now describe two ways to define the output distribution and hence train the network. We refer throughout to the length of x\bm{x} as TT, the length of z\bm{z} as UU, and the number of possible phonemes as KK.

The first method, known as Connectionist Temporal Classification (CTC) , uses a softmax layer to define a separate output distribution Pr(kt)\Pr(k|t) at every step tt along the input sequence. This distribution covers the KK phonemes plus an extra blank symbol \varnothing which represents a non-output (the softmax layer is therefore size K+1K+1). Intuitively the network decides whether to emit any label, or no label, at every timestep. Taken together these decisions define a distribution over alignments between the input and target sequences. CTC then uses a forward-backward algorithm to sum over all possible alignments and determine the normalised probability Pr(zx)\Pr(\bm{z}|\bm{x}) of the target sequence given the input sequence . Similar procedures have been used elsewhere in speech and handwriting recognition to integrate out over possible segmentations ; however CTC differs in that it ignores segmentation altogether and sums over single-timestep label decisions instead.

RNNs trained with CTC are generally bidirectional, to ensure that every Pr(kt)\Pr(k|t) depends on the entire input sequence, and not just the inputs up to tt. In this work we focus on deep bidirectional networks, with Pr(kt)\Pr(k|t) defined as follows:

where yt[k]y_{t}[k] is the kthk^{th} element of the length K+1K+1 unnormalised output vector yty_{t}, and NN is the number of bidirectional levels.

2 RNN Transducer

CTC defines a distribution over phoneme sequences that depends only on the acoustic input sequence x\bm{x}. It is therefore an acoustic-only model. A recent augmentation, known as an RNN transducer combines a CTC-like network with a separate RNN that predicts each phoneme given the previous ones, thereby yielding a jointly trained acoustic and language model. Joint LM-acoustic training has proved beneficial in the past for speech recognition .

Whereas CTC determines an output distribution at every input timestep, an RNN transducer determines a separate distribution Pr(kt,u)\Pr(k|t,u) for every combination of input timestep tt and output timestep uu. As with CTC, each distribution covers the KK phonemes plus \varnothing. Intuitively the network ‘decides’ what to output depending both on where it is in the input sequence and the outputs it has already emitted. For a length UU target sequence z\bm{z}, the complete set of TUTU decisions jointly determines a distribution over all possible alignments between x\bm{x} and z\bm{z}, which can then be integrated out with a forward-backward algorithm to determine logPr(zx)\log\Pr(\bm{z}|\bm{x}) .

In the original formulation Pr(kt,u)\Pr(k|t,u) was defined by taking an ‘acoustic’ distribution Pr(kt)\Pr(k|t) from the CTC network, a ‘linguistic’ distribution Pr(ku)\Pr(k|u) from the prediction network, then multiplying the two together and renormalising. An improvement introduced in this paper is to instead feed the hidden activations of both networks into a separate feedforward output network, whose outputs are then normalised with a softmax function to yield Pr(kt,u)\Pr(k|t,u). This allows a richer set of possibilities for combining linguistic and acoustic information, and appears to lead to better generalisation. In particular we have found that the number of deletion errors encountered during decoding is reduced.

Denote by hN\bm{\overrightarrow{h}}^{N} and hN\bm{\overleftarrow{h}}^{N} the uppermost forward and backward hidden sequences of the CTC network, and by p\bm{p} the hidden sequence of the prediction network. At each t,ut,u the output network is implemented by feeding hN\bm{\overrightarrow{h}}^{N} and hN\bm{\overleftarrow{h}}^{N} to a linear layer to generate the vector ltl_{t}, then feeding ltl_{t} and pup_{u} to a tanh\tanh hidden layer to yield ht,uh_{t,u}, and finally feeding ht,uh_{t,u} to a size K+1K+1 softmax layer to determine Pr(kt,u)\Pr(k|t,u):

where yt,u[k]y_{t,u}[k] is the kthk^{th} element of the length K+1K+1 unnormalised output vector. For simplicity we constrained all non-output layers to be the same size (htn=htn=pu=lt=ht,u)|\overrightarrow{h}^{n}_{t}|=|\overleftarrow{h}^{n}_{t}|=|p_{u}|=|l_{t}|=|h_{t,u}|); however they could be varied independently.

RNN transducers can be trained from random initial weights. However they appear to work better when initialised with the weights of a pretrained CTC network and a pretrained next-step prediction network (so that only the output network starts from random weights). The output layers (and all associated weights) used by the networks during pretraining are removed during retraining. In this work we pretrain the prediction network on the phonetic transcriptions of the audio training data; however for large-scale applications it would make more sense to pretrain on a separate text corpus.

3 Decoding

RNN transducers can be decoded with beam search to yield an n-best list of candidate transcriptions. In the past CTC networks have been decoded using either a form of best-first decoding known as prefix search, or by simply taking the most active output at every timestep . In this work however we exploit the same beam search as the transducer, with the modification that the output label probabilities Pr(kt,u)\Pr(k|t,u) do not depend on the previous outputs (so Pr(kt,u)=Pr(kt)\Pr(k|t,u)=\Pr(k|t)). We find beam search both faster and more effective than prefix search for CTC. Note the n-best list from the transducer was originally sorted by the length normalised log-probabilty logPr(y)/y\log\Pr(\bm{y})/|\bm{y}|; in the current work we dispense with the normalisation (which only helps when there are many more deletions than insertions) and sort by Pr(y)\Pr(\bm{y}).

4 Regularisation

Regularisation is vital for good performance with RNNs, as their flexibility makes them prone to overfitting. Two regularisers were used in this paper: early stopping and weight noise (the addition of Gaussian noise to the network weights during training ). Weight noise was added once per training sequence, rather than at every timestep. Weight noise tends to ‘simplify’ neural networks, in the sense of reducing the amount of information required to transmit the parameters , which improves generalisation.

Experiments

Phoneme recognition experiments were performed on the TIMIT corpus . The standard 462 speaker set with all SA records removed was used for training, and a separate development set of 50 speakers was used for early stopping. Results are reported for the 24-speaker core test set. The audio data was encoded using a Fourier-transform-based filter-bank with 40 coefficients (plus energy) distributed on a mel-scale, together with their first and second temporal derivatives. Each input vector was therefore size 123. The data were normalised so that every element of the input vectors had zero mean and unit variance over the training set. All 61 phoneme labels were used during training and decoding (so K=61K=61), then mapped to 39 classes for scoring . Note that all experiments were run only once, so the variance due to random weight initialisation and weight noise is unknown.

As shown in Table 1, nine RNNs were evaluated, varying along three main dimensions: the training method used (CTC, Transducer or pretrained Transducer), the number of hidden levels (1–5), and the number of LSTM cells in each hidden layer. Bidirectional LSTM was used for all networks except CTC-3l-500h-tanh, which had tanh\tanh units instead of LSTM cells, and CTC-3l-421h-uni where the LSTM layers were unidirectional. All networks were trained using stochastic gradient descent, with learning rate 10410^{-4}, momentum 0.90.9 and random initial weights drawn uniformly from [0.1,0.1][-0.1,0.1]. All networks except CTC-3l-500h-tanh and PreTrans-3l-250h were first trained with no noise and then, starting from the point of highest log-probability on the development set, retrained with Gaussian weight noise (σ=0.075\sigma=0.075) until the point of lowest phoneme error rate on the development set. PreTrans-3l-250h was initialised with the weights of CTC-3l-250h, along with the weights of a phoneme prediction network (which also had a hidden layer of 250 LSTM cells), both of which were trained without noise, retrained with noise, and stopped at the point of highest log-probability. PreTrans-3l-250h was trained from this point with noise added. CTC-3l-500h-tanh was entirely trained without weight noise because it failed to learn with noise added. Beam search decoding was used for all networks, with a beam width of 100.

The advantage of deep networks is immediately obvious, with the error rate for CTC dropping from 23.9% to 18.4% as the number of hidden levels increases from one to five. The four networks CTC-3l-500h-tanh, CTC-1l-622h, CTC-3l-421h-uni and CTC-3l-250h all had approximately the same number of weights, but give radically different results. The three main conclusions we can draw from this are (a) LSTM works much better than tanh\tanh for this task, (b) bidirectional LSTM has a slight advantage over unidirectional LSTMand (c) depth is more important than layer size (which supports previous findings for deep networks ). Although the advantage of the transducer is slight when the weights are randomly initialised, it becomes more substantial when pretraining is used.

Conclusions and future work

We have shown that the combination of deep, bidirectional Long Short-term Memory RNNs with end-to-end training and weight noise gives state-of-the-art results in phoneme recognition on the TIMIT database. An obvious next step is to extend the system to large vocabulary speech recognition. Another interesting direction would be to combine frequency-domain convolutional neural networks with deep LSTM.

References