First-Pass Large Vocabulary Continuous Speech Recognition using Bi-Directional Recurrent DNNs

Awni Y. Hannun, Andrew L. Maas, Daniel Jurafsky, Andrew Y. Ng

Introduction

Modern large vocabulary continuous speech recognition (LVCSR) systems are complex and difficult to modify. Much of this complexity stems from the paradigm of modeling words as sequences of sub-phonetic states with hidden Markov models (HMMs). HMM-based systems require carefully-designed training recipes to construct consecutively more complex HMM recognizers. The overall difficulty of building, understanding, and modifying HMM-based LVCSR systems has limited progress in speech recognition and isolated it from many advances in related fields.

Recently Graves & Jaitly (2014) demonstrated an HMM-free approach to training a speech recognizer which uses a neural network to directly predict transcript characters given the audio of an utterance. This approach discards many of the assumptions present in modern HMM-based LVCSR systems in favor of treating speech recognition as a direct sequence transduction problem. The approach trains a neural network using the connectionist temporal classification (CTC) loss function, which amounts to maximizing the likelihood of an output sequence by efficiently summing over all possible input-output sequence alignments. Using CTC the authors were able to train a neural network to predict the character sequence of test utterances with a character error rate (CER) under 10% on the Wall Street Journal LVCSR corpus. While impressive in its own right, these results are not yet competitive with existing HMM-based systems in terms of word error rate (WER). Good word-level performance in speech recognition often depends heavily upon a language model to provide a prior probability over likely word sequences.

To integrate language model information during decoding, Graves & Jaitly (2014) use their CTC-trained neural network to rescore a lattice or n-best hypothesis list generated by a state-of-the-art HMM-based system. This introduces a potentially confounding factor because an n-best list constrains the set of possible transcriptions significantly. Additionally, it results in an overall system which still relies on HMM speech recognition infrastructure to achieve the final results. In contrast, we present first-pass decoding results which use a neural network and language model to decode from scratch, rather than re-ranking an existing set of hypotheses.

We describe a decoding algorithm which directly integrates a language model with CTC-trained neural networks to search through the space of possible word sequences. Our first-pass decoding algorithm enables CTC-trained models to benefit from a language model without relying on an existing HMM-based system to generate a word lattice. This removes the lingering dependence on HMM-centric speech recognition toolkits and enables us to achieve fairly competitive WER results with only a neural network and nn-gram language model.

Deep neural networks (DNNs) are the most widely used neural network architecture for speech recognition (Hinton et al., 2012). DNNs are a fairly generic architecture for classification and regression problems. In HMM-based LVCSR systems, DNNs act as acoustic models by predicting the HMM’s hidden state given the acoustic input for a point in time. However, in such HMM-DNN systems the temporal reasoning about an output sequence takes place within the HMM rather than the neural network. CTC training of neural networks forces the network to model output sequence dependencies rather than reasoning about single time frames independently from others. To better handle such temporal dependencies previous work with CTC used long short term memory (LSTM) networks. LSTM is a neural network architecture was originally designed to prevent the vanishing gradient problem of sigmoidal DNNs or temporally recurrent deep neural networks (RDNNs) (Hochreiter & Schmidhuber, 1997).

Our work uses RDNNs instead of LSTMs as a neural network architecture. RDNNs are simpler overall, because there are only dense weight matrix connections between subsequent layers. This simpler architecture is more amenable to graphics processing unit (GPU) computing which can significantly reduce training times. Recent work shows that with rectifier nonlinearities DNNs can perform well in DNN-HMM systems without suffering from vanishing gradient problems during optimization (Dahl et al., 2013; Zeiler et al., 2013; Maas et al., 2013). This makes us hopeful that RDNNs with rectifier nonlinearities may be able to perform comparably to LSTMs which are specially engineered to avoid vanishing gradients.

Model

We train neural networks using the CTC loss function to do maximum likelihood training of letter sequences given acoustic features as input. We consider a single utterance as a training example consisting of an acoustic feature matrix XX and word transcription WW. The CTC objective function maximizes the log probability log⁡p(W;X)\log p(W;X). We reserve a full exposition of the loss function here because our formulation follows exactly the previous work on using CTC to predict the characters of an utterance transcription (Graves & Jaitly, 2014; Graves et al., 2006).

With the loss function fixed we must next define how we compute p(c∣xt)p(c|x_{t}), the predicted distribution over output characters cc given the audio features xtx_{t} at time tt. While many function approximators are possible for this task, we choose as our most basic model a DNN. A DNN computes the distribution p(c∣xt)p(c|x_{t}) using a series of hidden layers followed by an output layer. Given an input vector xtx_{t} the first hidden layer activations are a vector computed as,

The matrix W(1)W^{(1)} and vector b(1)b^{(1)} are the weight matrix and bias vector for the layer. The function σ(⋅)\sigma(\cdot) is a point-wise nonlinearity. We use rectifier nonlinearities and thus choose, σ(z)=max⁡(z,0)\sigma(z)=\max(z,0).

DNNs can have arbitrarily many hidden layers. After the first hidden layer, the hidden activations h(i)h^{(i)} for layer ii are computed as,

To obtain a proper distribution over the set of possible characters cc the final layer of the network is a softmax output layer of the form,

where Wk(s)W^{(s)}_{k} is the kk’th column of the output weight matrix W(s)W^{(s)} and bk(s)b^{(s)}_{k} is a scalar bias term.

We can compute a subgradient for all parameters of the DNN given a training example and thus utilize gradient-based optimization techniques. Note that this same DNN formulation is commonly used in DNN-HMM models to predict a distribution over senones instead of characters.

2 Recurrent Deep Neural Networks

A transcription WW has many temporal dependencies which a DNN may not sufficiently capture. At each timestep tt the DNN computes its output using only the input features xtx_{t}, ignoring previous hidden representations and output distributions. To enable better modeling of the temporal dependencies present in a problem, we use a RDNN. In a RDNN we select one hidden layer jj to have a temporally recurrent weight matrix W(f)W^{(f)} and compute the layer’s hidden activations as,

Note that we now make the distinction ht(j)h^{(j)}_{t} for the hidden activation vector of layer jj at timestep tt since it now depends upon the activation vector of layer jj at time t−1t-1.

When working with RDNNs, we found it important to use a modified version of the rectifier nonlinearity. This modified function selects σ(z)=min⁡(max⁡(z,0),20)\sigma(z)=\min(\max(z,0),20) which clips large activations to prevent divergence during network training. Setting the maximum allowed activation to 20 results in the clipped rectifier acting as a normal rectifier function in all but the most extreme cases.

Aside from these changes, computations for a RDNN are the same as those in a DNN as described in 2.1. Like the DNN, we can compute a subgradient for a RDNN using a method sometimes called backpropagation through time. In our experiments we always compute the gradient completely through time rather than truncating to obtain an approximate subgradient.

3 Bi-Directional Recurrent Deep Neural Networks

While forward recurrent connections reflect the temporal nature of the audio input, a perhaps more powerful sequence transduction model is a BRDNN, which maintains state both forwards and backwards in time. Such a model can integrate information from the entire temporal extent of the input features when making each prediction. We extend the RDNN to form a BRDNN by again choosing a temporally recurrent layer jj. The BRDNN creates both a forward and backward intermediate hidden representation which we call ht(f)h_{t}^{(f)} and ht(b)h_{t}^{(b)} respectively. We use the temporal weight matrices W(f)W^{(f)} and W(b)W^{(b)} to propagate ht(f)h_{t}^{(f)} forward in time and ht(b)h_{t}^{(b)} backward in time respectively. We update the forward and backward components via the equations,

Note that the recurrent forward and backward hidden representations are computed entirely independently from each other. As with the RDNN we use the modified nonlinearity function σ(z)=min⁡(max⁡(z,0),20)\sigma(z)=\min(\max(z,0),20). To obtain the final representation ht(j)h^{(j)}_{t} for the layer we sum the two temporally recurrent components,

Aside from this change to the recurrent layer the BRDNN computes its output using the same equations as the RDNN. As for other models, we can compute a subgradient for the BRDNN directly to perform gradient-based optimization.

Decoding

Assuming an input of length TT, the output of the neural network will be p(c;xt)p(c;x_{t}) for t=1,…,Tt=1,\ldots,T. Again, p(c;xt)p(c;x_{t}) is a distribution over possible characters in the alphabet Σ\Sigma, which includes the blank symbol, given audio input xtx_{t}. In order to recover a character string from the output of the neural network, as a first approximation, we take the argmax at each time step. Let S=(s1,…,sT)S=(s_{1},\ldots,s_{T}) be the character sequence where st=arg max⁡c∈Σp(c;xt)s_{t}=\operatorname*{arg\,max}_{c\in\Sigma}p(c;x_{t}). The sequence SS is mapped to a transcription by collapsing repeat characters and removing blanks. This gives a sequence which can be scored against the reference transcription using both CER and WER.

This first approximation lacks the ability to include the constraint of either a lexicon or a language model. We propose a generic algorithm which is capable of incorporating such constraints. Taking XX to be the acoustic input of time TT, we seek a transcription WW which maximizes the probability,

Here the overall probability of the transcription is modeled as the product of two factors: pnetp_{\text{net}} given by the network and plmp_{\text{lm}} given by a language model prior. In practice the prior plm(W)p_{\text{lm}}(W), when given by an nn-gram language model, is too constraining and thus we down-weight it and include a word insertion penalty (or bonus) as

Alogrithm 1 attempts to find a word string WW which maximizes equation 8.

The sets AprevA_{\text{prev}} and AnextA_{\text{next}} maintain a list of active prefixes at the previous time step and proposed prefixes at the next time step respectively. Note that the size of AprevA_{\text{prev}} is never larger than the beam width kk. The overall probability of a prefix is the product of a word insertion term and the sum of the blank and non-blank ending probabilities,

Experiments

We evaluate our approach on the 81 hour Wall Street Journal (WSJ) news article dictation corpus (available in the LDC catalog as LDC94S13B and LDC93S6B). Our training set consists of 81 hours of speech from 37,318 utterances. The basic preparation of transforming the LDC-released corpora into training and test subsets follows the Kaldi speech recognition toolkit’s s5 recipe (Povey et al., 2011). However, we did not apply much of the text normalization used to prepare transcripts for training an HMM system. Instead we simply drop unnecessary transcript notes like lexical stress, keeping transcribed word fragments and acronym punctuation marks. We can safely discard much of this normalization because our approach does not rely on a lexicon or pronunciation dictionary, which cause problems especially for word fragments. Our language models are the standard models released with the WSJ corpus without lexical expansion. We used the ‘dev93’ evaluation subset as a development set and report final test set performance on the ‘eval92’ evaluation subset. Both subsets use the same 20k word vocabulary. The language model used for decoding is constrained to this same 20k word vocabulary.

The input audio was converted into log-Mel filterbank features with 23 frequency bins. A context window of +/- 10 frames were concatenated to form a final input vector of size 483. We did not perform additional feature preprocessing or feature-space speaker adaptation. Our output alphabet consists of 32 classes, namely the blank symbol “_”, 26 letters, 3 punctuation marks (apostrophe, ., and -) as well as tokens for noise and space.

We trained a BRDNN with 5 hidden layers, all with 1824 hidden units, for a total of 20.9M free parameters. The third hidden layer of the network has recurrent connections. Weights in the network are initialized from a uniform random distribution scaled by the weight matrix’s input and output layer size (Glorot et al., 2011). We use the Nesterov accelerated gradient optimization algorithm as described in Sutskever et al. (2013) with initial learning rate 10−510^{-5}, and maximum momentum 0.95. After each full pass through the training set we divide the learning rate by 1.2 to ensure the overall learning rate decreases over time. We train the network for a total of 20 passes over the training set, which takes about 96 hours using our Python GPU implementation. For decoding with prefix search we use a beam size of 200 and cross-validate with a held-out set to find a good setting of the parameters α\alpha and β\beta. Table 1 shows word and character error rates for multiple approaches to decoding with this trained BRDNN.

Without any sort of language constraint WER is quite high, despite the fairly low CER. This is consistent with our observation that many mistakes at the character level occur when a word appears mostly correct but does not conform to the highly irregular orthography of English. Prefix-search decoding using the 20k word vocabulary as a prior over possible character sequences results in a substantial WER improvement, but changes the CER relatively little. Comparing the CERs of the no LM and dictionary LM approaches again demonstrates that without an LM the characters are mostly correct but are distributed across many words which increases WER. A large relative drop in both CER and WER occur when we decode with a bigram LM. Performance of the bigram LM model demonstrates that CTC-trained systems can attain competitive error rates without relying on a lattice or n-best list generated by an existing speech system.

2 The Effect of Recurrent Connections

Previous experiments with DNN-HMM systems found minimal benefits from recurrent connections in DNN acoustic models. It is natural to wonder whether recurrence, and especially bi-directional recurrence, is an essential aspect of our architecture. To evaluate the impact of recurrent connections we compare the train and test CERs of DNN, RDNN, and BRDNN models while roughly controlling for the total number of free parameters in the model. Table 2 shows the results for each type of architecture.

Both variants of recurrent models show substantial test set CER improvements over the non-recurrent DNN model. Note that we report performance for a DNN of only 16.8M total parameters which is smaller than the total number of parameters used in both the RDNN and BRDNN models. We found that larger DNNs performed worse on the test set, suggesting that DNNs may be more prone to over-fitting for this task. Although the BRDNN has fewer parameters than the RDNN it performs better on both the training and test sets. Again this suggests that the architecture itself drives improved performance rather than the total number of free parameters. Conversely, because the gap between bi-directional recurrence and single recurrence is small relative to a non-recurrent DNN, on-line speech recognition using a singly recurrent network may be feasible without overly damaging performance.

Conclusion

We presented a decoding algorithm which enables first-pass LVCSR with a language model for CTC-trained neural networks. This decoding approach removes the lingering dependence on HMM-based systems found in previous work. Furthermore, first-pass decoding demonstrates the capabilities of a CTC-trained system without the confounding factor of potential effects from pruning the search space via a provided lattice. While our results do not outperform the best HMM-based systems on the WSJ corpus, they demonstrate the promise of CTC-based speech recognition systems.

Our experiments with BRDNN further simplify the infrastructure needed to create CTC-based speech recognition systems. The BRDNN is overall a less complex architecture than LSTMs and can relatively easily be made to run on GPUs since large matrix multiplications dominate the computation. However, our experiments suggest that recurrent connections are critical for good performance. Bi-directional recurrence helps beyond single direction recurrence but could be sacrificed in cases that require low-latency, online speech recognition. Taken together with previous work on CTC-based LVCSR, we believe there is an exciting path forward for high quality LVCSR without the complexity of HMM-based infrastructure.

References