Improving RNN Transducer Modeling for End-to-End Speech Recognition
Jinyu Li Rui Zhao Hu Hu Yifan Gong


The construction of Electromagnetism
    M.A. Natiello^†and H.G. Solari^
    July 2019
====================================



In the last few years, an emerging trend in automatic speech recognition research is the study of end-to-end (E2E) systems.  Connectionist Temporal Classification (CTC), Attention Encoder-Decoder (AED), and RNN Transducer (RNN-T) are the most popular three methods. Among these three methods, RNN-T has the advantages to do online streaming which is challenging to AED and it doesn't have CTC's frame-independence assumption. In this paper, we improve the RNN-T training in two aspects. First, we optimize the training algorithm of RNN-T to reduce the memory consumption so that we can have larger training minibatch for faster training speed. Second, we propose better model structures so that we obtain  RNN-T models with the very good accuracy but small footprint. Trained with 30 thousand hours anonymized and transcribed Microsoft production data, the best RNN-T model with even smaller model size (216 Megabytes) achieves up-to 11.8%  relative word error rate (WER) reduction from the baseline RNN-T model. This best RNN-T model is significantly better than the device hybrid model with similar size by achieving up-to 15.0% relative WER reduction, and obtains similar WERs as the server hybrid model of 5120 Megabytes in size. 



RNN Transducer, LSTM, GRU, layer trajectory, speech recognition




§ INTRODUCTION



Recent advances in automatic speech recognition (ASR) have been mostly due to the advent of using deep learning algorithms to build hybrid ASR systems with deep acoustic models like Deep Neural Networks (DNNs), Convolutional Neural Networks (CNNs), and Recurrent Neural Networks (RNNs). 

However, one problem with these hybrid systems is that there are several intermediate models (acoustic model, language model, lexicon model, decision tree, etc.) which either need expert linguistic knowledge or need to be trained separately. 
In the last few years, an emerging trend in ASR is the study of end-to-end (E2E) systems <cit.>. The E2E ASR system directly transduces an input sequence of acoustic features to an output sequence of tokens (phonemes, characters, words etc). This reconciles well with the notion that ASR is inherently a sequence-to-sequence task mapping input waveforms to output token sequences. Some widely used contemporary E2E approaches for sequence-to-sequence transduction are: (a) Connectionist Temporal Classification (CTC) <cit.>, (b) Attention Encoder-Decoder (AED) <cit.>, and (c) RNN Transducer (RNN-T)<cit.>. These approaches have been successfully applied to large-scale ASR systems <cit.>.

Among all these three approaches, AED (or LAS: Listen, Attend and Spell <cit.>) is the most popular one. It contains three components: Encoder which is similar to a conventional acoustic model; Attender which works as an alignment model; Decoder which is analogous to a conventional language model. However, it is very challenging for AED to do online streaming, which is an important requirement for  ASR services. Although there are several studies towards that direction, such as monotonic chunkwise attention <cit.> and triggered attention <cit.>, it's still a big challenge. As for CTC, it enjoys its simplicity by only using an encoder to map the speech signal to target labels. However, its frame-independence assumption is most criticized. There are several attempts to improve CTC modeling by relaxing or removing such assumption. In <cit.>, attention modeling was directly integrated into the CTC framework to relax the frame-independence assumption by working on model hidden layers without changing the CTC objective function and training process, hence enjoying the simplicity of CTC training.  

A more elegant solution is RNN-T <cit.>, which extends CTC modeling by incorporating acoustic model with its encoder, language model with its prediction network, and decoding process with its joint network. There is no frame-independence assumption anymore and it is very natural to do online streaming. As a result, RNN-T instead of AED was successfully deployed to Google's device <cit.> with great impacts. In spite of its recent success in industry, there is less research in RNN-T when compared to the popular AED or CTC,  possibly due to the complexity of RNN-T training <cit.>. For example, the encoder and prediction network compose a grid of alignments, and the posteriors need to be calculated at each point in the grid to perform the forward-backward training of RNN-T. This three-dimension tensor requires much more memory than what is required in AED or CTC training. Given there are lots of network structure studies in hybrid systems (e.g., <cit.>), it is also desirable to explore advanced network structures so that we can put a RNN-T model into devices with both good accuracy and small footprint.

In this paper, we use the methods presented in the latest work <cit.> as the baseline and improve the RNN-T modeling in two aspects. First, we optimize the training algorithm of RNN-T to reduce the memory consumption so that we can have larger training minibatch for faster training speed. Second, we propose better model structures than the layer-normalized long short-term memory (LSTM) used in <cit.> so that we obtain  RNN-T models with better accuracy but smaller footprint. 

This paper is organized as follows. In Section <ref>, we briefly describe the basic RNN-T method. Then, in Section <ref>, we propose how to improve the RNN-T training by reducing the memory consumption which constrains the training minibatch size because of the large-size tensors in RNN-T. In Section <ref>, we propose several model structures which improve the baseline LSTM model used in  <cit.> for better accuracy and smaller model size. We evaluate the proposed models in Section <ref> by training them with 30 thousand hours anonymized and transcribed production data, and evaluating with several ASR tasks. Finally, we conclude the study in Section <ref>.



§ RNN-T



Figure <ref> shows the diagram of the RNN-T model, which consists of encoder, prediction, and joint networks. The encoder network is analogous to the acoustic model, which converts the acoustic feature x_t into a high-level representation h_t^enc, where t is time index.

    h_t^enc = f^enc (x_t)


The prediction network works like a RNN language model, which produces a high-level representation h_u^pre by conditioning on the previous non-blank target y_u-1 predicted by the RNN-T model, where u is output label index. 

    h_u^pre = f^pre (y_u-1)


The joint network is a feed-forward network that combines the encoder network output h_t^enc and the prediction network output h_u^pre as 

    z_t,u   = f^joint (h_t^enc, h_u^pre) 
       = ψ(U h_t^enc + V h_u^pre + b_z),

where U and V are weight matrices, b_z is a bias vector, and ψ is a non-linear function, e.g. Tanh or ReLU <cit.>.

The z_t,u is connected to the output layer with a linear transform

    h_t,u=W_y z_t,u +b_y.

The final posterior for each output token k is obtained after applying softmax operation

    P(k|t,u)=softmax (h_t,u^k).




The loss function of RNN-T is the negative log posterior of output label sequence y given input acoustic feature x,

    L = -ln P(y|x),

which is calculated based on the forward-backward algorithm described in <cit.>. 
The derivatives of loss L with respect to P⁡(k|t,u) is 

    ∂ L/∂ P⁡(k|t,u)= -α(t, u)/ P(y|x){[    β(t, u+1) if   k=y_u+1;    β(t+1, u)     if   k=∅;            0    otherwise ].

where ∅ denotes the blank label. α(t, u) is  is the probability of outputting y_[1:u] during x_[1:t] while β(t,u) is the probability of outputting y_[u+1:U] during x_[t:T], assuming one sequence with acoustic feature length as T and label sequence length as U. 



§ TRAINING IMPROVEMENT



We use  K to denote the number of all output labels (including blank), and D to denote the dimension of z_t,u. From Eq. (<ref>) and (<ref>),  we can see the size of z is T*U*D, and the size of  h is K*T*U. Compared with other E2E models, such as CTC or AED, RNN-T model consumes much more memory during training. This restricts the training minibatch size, especially when trained on GPUs with limited memory capacity. The training speed would be slow if small minibatch is used, therefore reducing memory cost is important for fast RNN-T training.  In this paper, we use two methods to reduce memory cost for RNN-T model training. 



 §.§ Efficient encoder and prediction output combination

To improve the training efficiency of RNN, usually several sequences are used in parallel in one minibatch.  Given N sequences in one minibatch with acoustic feature lengths (T_1,T_2,...,T_N), the dimension of h^enc would be (N, max(T_1,T_2,...,T_N ),F) (F is the size of vector h_t^enc) when they are paralleled in one minibatch. Because the actual element number in h^enc is ∑_n=1^N T_n *F, some of the memory is wasted. Such waste is worse for RNN-T when combining encoder and prediction network output with the broadcasting method which is a popular implementation for dealing with different-size tensors in neural network training tools such as PyTorch. 

Suppose the label length of N sequences are (U_1,U_2,...,U_N). The dimension of h^pre would then be (N,max(U_1,U_2,...,U_N ),F).  To combine h^enc and h^pre with the broadcasting method, the dimension of h^enc and h^pre is expanded to 

    (N, 1, max(T_1,T_2,...,T_N ), F)

and

    (N, max(U_1,U_2,...,U_N ), 1, F)

respectively. Then, they are combined according to Eq. (<ref>) and the output dimension becomes

    (N, max(U_1,U_2,...,U_N ),  max(T_1,T_2,...,T_N ), D).

Note the last dimension is D instead of F because of the projection matrices in Eq. (<ref>). Hence, z becomes a four-dimension tensor, which requires very large memory (N* max(U_1,U_2,...,U_N )*  max(T_1,T_2,...,T_N )* D) to accommodate. 

To eliminate such memory waste, we did not use the broadcasting method to combine h^enc and h^pre.  Instead, we implement the combination sequence by sequence. Hence, the size of z_n for utterance n is T_n *U_n*D instead of  max(T_1,T_2,…,T_N )*max⁡〖(U_1,U_2,…,U_N )*D. Then we concatenate all z_n instead of paralleling them, which means we convert z into a two-dimension tensor (∑_n=1^N T_n *U_n), D).  In this way, the total memory cost for z_1, z_2,...z_N is (∑_n=1^N T_n *U_n)*D. This significantly reduces the memory cost, compared to the broadcasting method. There is no recurrent operation after the combination, hence such conversion will not affect the training speed for the  operations following it. Of course, we need to pass the sequence information like T_n, U_n  to any later operations so that they could process the sequences correctly based on such information.

Another way to reduce memory waste is to sort the sequences with respect to both acoustic feature and label length, and then performing the training with sorted sequences. However, from our experience, this generates worse accuracy than presenting randomized utterances to the training. In the deep speech 2 work <cit.>, SortaGrad was used to present the sorted utterances to training in the first epoch for the better initialization of CTC training. After the first epoch, the training then is reverted back to a random order of data over minibatches, which indicates the importance of data shuffle.



 §.§ Function merging


Most of the neural network training tools (e.g., PyTorch) are modular based. Although this is convenient for user to try various model structure, the memory usage is not efficient. For RNN-T model, if we define softmax and loss function with two separate modules, to get the derivative of loss with respect to h_t,u^k, i.e., ∂ L/∂ h_t,u^k, we may use the chain rule 

    ∂ L/∂ h_t,u^k = ∂ L/∂ P⁡(k|t,u)∂ P⁡(k|t,u)/∂ h_t,u^k

to first calculate ∂ L/∂ P⁡(k|t,u) with Eq. (<ref>) and then∂ P⁡(k|t,u)/∂ h_t,u^k. However, calculating and storing ∂ L/∂ P(k|t,u)  is not necessary. Instead we directly derive the formulation of   ∂ L/∂ h_t,u^k as

    ∂ L/∂ h_t,u^k 
    =P⁡(k|t,u) α(t, u)/ P(y|x)[ β(t, u) - {[  β(t, u+1) if k=y_u+1;  β(t+1, u)     if k=∅;          0  otherwise ]. ]	.

The tenor size of ∂ L/∂ P(k|t,u) of one minibatch is very big, hence  Eq. (<ref>) saves large memory compared with Eq. (<ref>). To further optimize this, we calculate softmax in-place [the operation that directly changes the content of a given tensor without making a copy.] for Eq. (<ref>) and let ∂ L/∂ h_t,u^k take the memory storage place of P⁡(k|t,u) in   Eq. (<ref>) . In this way, for this part  we only have one very large tensor in the memory (either  P⁡(k|t,u) or ∂ L/∂ h_t,u^k), compared to standard chain rule implementation which needs to store three large tensors ( P⁡(k|t,u), ∂ L/∂ h_t,u^k, and ∂ L/∂ P(k|t,u) ) in the memory. 

With above two methods, memory cost is reduced significantly, which helps to increase the training minibatch size. For a RNN-T model with around 4,000 output labels, the minibatch size could be increased from 2000 to 4000 when it is trained with V100 GPU which has 16 Gigabytes memory. The improvement is even larger for a RNN-T model with 36,000 output labels. The minibatch size could be increased from 500 to 2000. 



§ MODEL STRUCTURE EXPLORATION



In the latest successful RNN-T work <cit.>, the layer-normalized LSTMs with projection layer were used in both encoder and prediction networks. We describe it in Section <ref> and use it as the baseline structure in this study. 
From Section <ref> to Section <ref>, we propose different structures for RNN-T.  These new structures achieve more modeling power by 1) decoupling the target classification task and temporal modeling task with separate modeling units; 2) exploring future context frames to generate more informative encoder output. 



 §.§ Layer normalized LSTM


In <cit.>, layer normalization and projection layer for LSTM were reported important to the success of RNN-T modeling. Following <cit.>, we define the layer normalization function for vector v given adaptive gain α and bias β as 

    LN(v)    = (v- μ)/σ⊙α + β, 
    μ   = 1/D_v∑_i=1^D_v v_i, 
    σ   = √(1/D_v∑_i=1^D_v (v_i-μ)^2)

where D_v is the dimension of  v, and ⊙ is element-wise product.

Then, we define the layer normalized LSTM function with project layer   h_t^l = LSTM(h_t-1^l, x_t^l, c_t-1^l) as  
  
    i_t^l    = σ ( LN(W^l_ixx_t^l + W^l_ihh_t-1^l + b^l_i)) 
    f_t^l    = σ ( LN(W^l_fxx_t^l + W^l_fhh_t-1^l + b^l_f)) 
    c_t^l    = f_t^l ⊙c_t-1^l + i_t^l ⊙ϕ( LN(W^l_cxx_t^l + W^l_chh_t-1^l + b^l_c)) 
    o_t^l    = σ ( LN(W^l_oxx_t^l + W^l_ohh_t-1^l  + b^l_o)) 
    q_t^l    = o_t^l ⊙ϕ(LN(c_t^l)) 
    h_t^l    = W_p^l q_t^l

The vectors  i_t^l, o_t^l, f_t^l, c_t^l are the activations of the input, output, forget gates, and memory cells, respectively. h_t^l is the output of the LSTM.  W^l_.x and  W^l_.h are the weight matrices for the inputs x_t^l and the recurrent inputs h_t-1^l, respectively. b^l_. are bias vectors. The functions σ and ϕ are the logistic sigmoid and hyperbolic tangent nonlinearity, respectively. 

For the multi-layer LSTM, x_t^l = h_t^l-1, then we have the hidden output of the lth layer at time t as

    h_t^l    = LSTM(h_t-1^l, h_t^l-1, c_t-1^l),

and we use the last hidden layer output h_t^L and h_u^M of the encoder and prediction networks as h_t^enc and h_u^pre, where L and M denote the number of layers in encoder and prediction networks respectively.



 §.§ Layer trajectory LSTM


Recently, significant accuracy improvement was reported with a layer trajectory LSTM (ltLSTM) model <cit.> in which depth-LSTMs are used to scan the outputs of multi-layer time-LSTMs to extract information for label classification. By decoupling the temporal modeling and senone classification tasks, ltLSTM allows time and depth LSTMs focusing on their individual tasks. The model structure is illustrated by Figure <ref>. 



Following <cit.>, we define the layer-normalized ltLSTM formulation using 

    h_t^l    = LSTM(h_t-1^l, h_t^l-1, c_t-1^l)	
    g_t^l    = LSTM(h_t^l, g_t^l-1, d_t^l-1),

with the LSTM function defined from Eq. (<ref>) to Eq. (<ref>), where c_t-1^l and d_t^l-1 are the memory cells from time-LSTM (time t-1 and layer l) and depth-LSTM (time t and layer l-1), respectively.  The time-LSTM formulation in Eq. (<ref>) performs temporal modeling, while the depth-LSTM formulation in Eq. (<ref>) works across layers for the target classification. g_t^l is the output of the depth-LSTM at time t and layer l. Similarly, we can use the last hidden layer output g_t^L and g_u^M of the encoder and prediction networks as h_t^enc and h_u^pre for RNN-T.



 §.§ Contextual layer trajectory LSTM


In <cit.>, the contextual layer trajectory LSTM (cltLSTM) was proposed to further improve the performance of ltLSTM models  by using context frames to capture future information. 
In cltLSTM,  g_t^l-1 used in Eq. (<ref>) is replaced by the lookahead embedding vector ζ_t^l-1 in order to incorporate the future context information.  The embedding vector is computed from the depth-LSTM using Eq. (<ref>)

    ζ_t^l-1   = ∑_δ =0^τG_δ^l-1g_t+δ^l-1
    h_t^l    = LSTM(h_t-1^l, h_t^l-1, c_t-1^l)	
    g_t^l    = LSTM(h_t^l, ζ_t^l-1, d_t^l-1),

where G_δ^l-1 denotes the weight matrix applied to depth-LSTM output g_t+δ^l-1. Note it is only meaningful to have future context lookahead for the encoder network. Therefore,  ζ_t^L of the encoder  network can be used as h_t^enc for RNN-T. In Eq. (<ref>), every layer has τ frames lookahead. To generate ζ_t^L, we have L*τ frames lookahead in total.




 §.§ Layer normalized gated recurrent units


Similar to <cit.>, our target is to deploy RNN-T  for device ASR. Therefore, footprint is a major factor when developing models. As gated recurrent unit (GRU) <cit.> usually has light weight compared to LSTM, we use it as the building block for RNN-T and define the layer normalized GRU function  GRU(h_t-1^l, x_t^l)  as  
  
    z_t^l    = σ ( LN(W^l_zxx_t^l + W^l_zhh_t-1^l + b^l_z)) 
    r_t^l    = σ ( LN(W^l_rxx_t^l + W^l_rhh_t-1^l + b^l_r)) 
    h̃_t^l    = ϕ( LN(W^l_hxx_t^l + W^l_hh (r_t^l ⊙h_t-1^l) + b^l_h))
    h_t^l    = z_t^l ⊙h_t-1^l + (1-z_t^l) ⊙h̃_t^l

Again, W^l_.x and  W^l_.h are the weight matrices for the inputs x_t^l and the recurrent inputs h_t-1^l, respectively. b^l_. are bias vectors. 
For the multi-layer GRU, x_t^l = h_t^l-1, then we have the hidden output of the lth layer at time t as

    h_t^l    = GRU(h_t-1^l, h_t^l-1)

Note that all the networks in this study are uni-directional and our layer normalized GRU is different from the bi-directional GRU with batch normalization used in <cit.>. Layer normalization is better than batch normalization for recurrent neural networks <cit.>. 



 §.§ Layer trajectory GRU


Similar to the layer normalized ltLSTM presented in Section <ref>, we propose layer trajectory GRU (ltGRU) with layer normalization in this study as

    h_t^l    = GRU(h_t-1^l, h_t^l-1)	
    g_t^l    = GRU(h_t^l, g_t^l-1)	.

The time-GRU formulation in Eq. (<ref>) performs temporal modeling, while the depth-GRU formulation in Eq. (<ref>) works across layer for target classification. g_t^l is the output of the depth-GRU at time t and layer l. We can use the last hidden layer output g_t^L and g_u^M of the encoder and prediction networks as h_t^enc and h_u^pre for RNN-T.



 §.§ Contextual layer trajectory GRU


To further improve the performance of ltGRU models, we extend ltGRU in Section <ref> by utilizing the lookahead embedding vector in order to incorporate the future context information.  The embedding vector ζ_t^l-1 is computed from the depth-GRU using Eq. (<ref>)

    ζ_t^l-1   = ∑_δ =0^τq_δ^l-1⊙g_t+δ^l-1
    h_t^l    = GRU(h_t-1^l, h_t^l-1)	
    g_t^l    = GRU(h_t^l, ζ_t^l-1)

Different from Eq. (<ref>), Eq. (<ref>) uses vector q_δ^l-1 instead of matrix G_δ^l-1 to integrate future context g_t+δ^l-1 from the depth-GRU. This further reduces the model footprint. Hence  we call this model as elementwise contextual layer trajectory GRU (ecltGRU). 

ζ_t^L  of the encoder  network can then be used as h_t^enc for RNN-T.  In Eq. (<ref>), every layer has τ frames lookahead, and we have L*τ frames lookahead in total to generate ζ_t^L.




§ EXPERIMENTS



In this section, we evaluate the effectiveness of the proposed models. In our experiments, all models are  uni-directional, and were trained with 30 thousand (k) hours of anonymized and transcribed Microsoft production data, including Cortana and  Conversation data, recorded in both close-talk and far-field conditions. We evaluated all models with  Cortana and Conversation test sets. Both sets contain mixed close-talk and far-field recordings, with 439k and 111k words, respectively. The Cortana  set has shorter utterances related to voice search and commands, while the Conversation  set has longer utterances from conversations. We also evaluate the models on the third test set named as DMA with 29k words, which is not in Cortana or Conversation domain. The DMA domain was unseen during the model training, and serves to evaluate the generalization capacity of the model. 



 §.§ RNN-T models with greedy search




In Table <ref>, we compare different structures of RNN-T models in terms of size and word error rate (WER) using greedy search. The computational cost of RNN-T models during runtime is proportional to the model size. The feature is 80-dimension log Mel filter bank for every 10 milliseconds (ms) speech. Three of them are stacked together to form a frame of 240-dimension input acoustic feature to the encoder network. All encoder (enc.) networks have 6 hidden layers, and all prediction (pred.) networks have 2 hidden layers. The joint network always outputs a vector with dimension 640. The output layer models 4096 word piece units together with blank label. The word piece units are generated by running byte pair encoding <cit.> on the acoustic training texts. Similar to the latest successful RNN-T model on device <cit.>, our first model uses LSTM for both encoder and prediction networks. The encoder network has a 6 layer layer-normalized LSTM with 1280 hidden units at each layer and the output size then is reduced to 640 using a linear projection layer. We denote this layer-normalized LSTM structure as 1280p640. The prediction network has 2 hidden layers, and each layer is with the 1280p640 LSTM structure. This model has total size of 255 megabytes (Mb). We use this RNN-T model as the baseline model. 

Then, we explore ltLSTM structures described in Section <ref> for encoder and prediction networks. All the LSTM components in ltLSTM use the 1280p640 LSTM structure. Simply using ltLSTM in the encoder significantly reduces the WERs on Cortana and DMA test sets, but increases the model size from 255 Mb to 422 Mb. Further using ltLSTM in prediction network increases the model size to 482 Mb, without benefiting the WER clearly. Hence, using ltLSTM only in the encoder is a good setup. 

Using cltLSTM described in Section <ref> in the encoder network with τ=4 at each layer improves the WERs significantly, with respectively 17.5%, 10.5%, and 14.0% relative WER reduction on Cortana, Conversation, and DMA test sets  from the baseline  RNN-T model which uses layer-normalized LSTM in both encoder and decoder networks. This clearly shows the advantage of using future context for the encoder network. However, this model also has a very large model size as 469 Mb, which especially brings challenges to the deployment into devices. 

Next, layer-normalized LSTM is replaced with layer-normalized GRU described in Section <ref>. The GRU in this study is with 800 units at each layer without any projection layer. When using layer-normalized GRU in both encoder and prediction networks, we significantly reduce the RNN-T model size to 139 Mb and obtain slightly worse WERs than the baseline RNN-T model using LSTM. 

The RNN-T model using ltGRU proposed in Section <ref> in the encoder network has the model size 216 Mb, and significantly improves the RNN-T model with GRU in the encoder network. Again, applying ltGRU to prediction network doesn't bring any additional benefits but increases the model size. 

Finally, ecltGRU which uses τ=4 at each layer has almost the same size as ltGRU in the encoder network due to the use of vectors instead of matrices when incorporating future context, but significantly improves the WERs because of the future context access.  The size of this model (216 Mb) is smaller than that (255 Mb) of the baseline RNN-T model which uses LSTM in the encoder and prediction networks. At the same time, it outperforms the baseline RNN-T model with  11.2%, 10.9% and 13.3% relative WER reduction on Cortana, Conversation, and DMA test sets, respectively. 

Given the good performance of ecltGRU, we evaluate the impact of future frame contexts at each layer in Figure <ref> by varying the value of τ. When τ=0, the ecltGRU model just reduces to the ltGRU model. With larger τ value, the WERs drop monotonically. Setting τ as 3 or 4 doesn't have too much WER difference while smaller τ value does reduce the model latency with less future context access.





 §.§ Comparison with hybrid models




In Table <ref>, we compare  RNN-T models decoded using beam search with hybrid models trained with cross entropy criterion on Cortana, Conversation, and DMA test sets. Note that all models, not matter RNN-T or hybrid, can be improved by sequence discriminative training.  The acoustic model of this hybrid model is a 6 layer LSTM with 1024 hidden units at each layer and the output size then is reduced to 512 using a linear projection layer. The softmax layer has 9404-dimension output to model the senone labels. 
The input feature is also 80-dimension log Mel filter bank for every 10 milliseconds (ms) speech. We applied frame skipping by a factor of 2 <cit.> to reduce the runtime cost, which corresponds to 20ms per frame. This acoustic model (AM) has the size of 120 Mb. The language model (LM) is a 5-gram with around 100 million (M) ngrams, which is compiled into a graph of 5 gigabytes (Gb) size. We refer this configuration as the server setup. We also prune the LM for the purpose of device usage, resulting in a graph of 98 Mb size. The decoding of these two hybrid models uses our production setup, differing only the LM size. We list the WERs of this AM combined with both the large LM and pruned LM in Table <ref>. Clearly, the device setup with small LM gives worse WERs than the server setup using  large LM. 

The RNN-T decoding results are generated by beam search with beam width 10. Comparing the results in Table <ref> and Table <ref>, we can see that beam search significantly improves the WERs from the greedy search. Using ecltGRU in the encoder network and GRU in the prediction network for RNN-T outperforms the baseline RNN-T which uses LSTM everywhere, with 6.6%, 7.5%, and 11.8% relative WER reduction on  Cortana, Conversation, and DMA test sets, respectively. The size of this best RNN-T model is 216 Mb, less than the baseline RNN-T model with LSTM units.   Moreover, the WERs of this best RNN-T model matches the WERs of hybrid model with server setup which has a 5 Gb LM. Comparing to the device hybrid setup which has similar size (218 Mb), this best RNN-T obtains 15.0%, 9.9%, and 11.3% relative WER reduction on  Cortana, Conversation, and DMA test sets, respectively. With the high recognition accuracy and small footprint, this RNN-T model is ideal for device ASR. 

Finally, we look at the gap between ground truth word alignment obtained by force alignment with a hybrid model and the word alignment generated by greedy decoding from two RNN-T models in Table <ref>. As shown in Figure <ref>, the baseline RNN-T with LSTM in the encoder network has larger delay than the ground truth alignment. The average delay is about 10 input frames. In contrast, the RNN-T model with ecltGRU has less alignment discrepancy, with average 2 input frames delay. This is because the ecltGRU encoder has total 24 frames lookahead, which provides more information to RNN-T so that it makes decision earlier than the baseline model. Because the input to RNN-T models spans 30ms by stacking 3 10ms frames together, therefore the average latency of RNN-T with ecltGRU encoder is (24+2)*30ms = 780ms while the average latency of RNN-T with LSTM encoder is 10*30ms = 300ms. Hence, partial accuracy advantage of ecltGRU encoder comes from the tradeoff of latency. 












§ CONCLUSIONS



In this paper, we improve the RNN-T training for end-to-end ASR from two aspects. First, we reduce the memory consumption of RNN-T training with efficient combination of the encoder and prediction network outputs, and by reformulating the gradient calculation to avoid storing multiple large tensors in the memory. In this way, we significantly increase the minibatch size (otherwise constrained by the memory usage) during training. Second, we improve the baseline RNN-T model structure which uses LSTM units by proposing several new structures. All the proposed structures use the concept of layer trajectory which decouples the classification task and temporal modeling task by using depth LSTM / GRU units and time LSTM / GRU units, respectively. The best tradeoff between model size and accuracy is obtained by the RNN-T model with ecltGRU in the encoder network and GRU in the prediction network. The future context lookahead at each layer helps to build accurate models with better performance. 

Trained with 30 thousand hours anonymized and transcribed Microsoft production data, this best RNN-T model achieves respectively 6.6%, 7.5%, and 11.8% relative WER reduction on  Cortana, Conversation, and DMA test sets, from the baseline RNN-T model but with smaller model size (216 Megabytes), which is ideal for the deployment to devices. This best RNN-T model is significantly better than the hybrid model with similar size, by reducing 15.0%, 9.9%, and 11.3% relative WER on  Cortana, Conversation, and DMA test sets, respectively. It also obtains similar WERs as the server-size hybrid model of 5120 Megabytes in size. 





IEEEbib


