A Better and Faster End-to-End Model for Streaming ASR

End-to-end (E2E) models have shown to outperform state-of-the-art conventional models for streaming speech recognition [1] across many dimensions, including quality (as measured by word error rate (WER)) and endpointer latency [2]. However, the model still tends to delay the predictions towards the end and thus has much higher partial latency compared to a conventional ASR model. To address this issue, we look at encouraging the E2E model to emit words early, through an algorithm called FastEmit [3]. Naturally, improving on latency results in a quality degradation. To address this, we explore replacing the LSTM layers in the encoder of our E2E model with Conformer layers [4], which has shown good improvements for ASR. Secondly, we also explore running a 2nd-pass beam search to improve quality. In order to ensure the 2nd-pass completes quickly, we explore non-causal Conformer layers that feed into the same 1st-pass RNN-T decoder, an algorithm we called Cascaded Encoders. Overall, we find that the Conformer RNN-T with Cascaded Encoders offers a better quality and latency tradeoff for streaming ASR.


INTRODUCTION
Having an end-to-end (E2E) speech recognition model [5][6][7][8][9][10], that matches/surpasses the quality of a conventional model (which has separate acoustic, pronunciation and language model components) across all dimensions of quality and latency, has become a challenging research direction over the past few years.
On the latency side, one such requirement of E2E models is that they have to be streaming. They must emit words to the screen with minimal delay as the user speaks. Models such as Recurrent Neural Network Transducer (RNN-T) [8], Neural Transducer [11,12], Monotonic Attention [13,14], Triggered attention [15] and Scout Network [16] have been explored to address the streaming nature. Another requirement is that the model must stop decoding quickly once the user stops speaking, a problem known as endpointing. Folding the endpointer into the E2E model helped address this issue [2].
On the quality side, we require a model which achieves better word error rate (WER) compared to a conventional model. Using a 1st-pass streaming RNN-T model coupled with a 2nd-pass non-streaming attention-based model helped address quality concerns [17]. In addition, improving the performance of the model to recognize proper nouns was achieved with contextual biasing [18].
Putting many of these above components together, we recently released an on-device model that surpassed a conventional model in terms of both WER and endpointer latency [1]. However, one of the * Equal contribution issues with that model is that partial hypotheses were still delayed to the end compared to a conventional model trained with an alignment.
In this work, we explore ideas to improve the model's partial latency. Speech-to-text alignment can be used to improve the token prediction timing [19,20], which normally causes large quality degradation. We adopted the recently proposed FastEmit [3]. It regularizes the RNN-T lattice to encourage non-blank tokens and surpass the blank token across the entire sequence based on the forwardbackward probabilities. It is found to be effective in reducing models' partial latency with much less quality degradation.
One can expect that any research attempt to improve partial latency results in a slight quality degradation. To address this, we explore improving our core E2E model by replacing the recurrent LSTM layers in the encoder with Conformer layers, which have shown promise in Librispeech [4]. In addition, we also look at improving our 2nd-pass strategy so that we can run a beam search rather than a rescorer. We explored the improved latency and quality ideas on a Voice Search task, which yielded 10% relative WER reduction with 250ms and 170ms reduction in median partial and prefetch latency respectively than [1].

Conformer
We use Conformer [4] to improve the model quality. The model used in [4] is designed for tasks with non-streaming, single-domain and short utterances. In this work, we adapt it for our streaming multi-domain task [1]. We first limit the self-attention, the convolution and the normalization layers to take in only the previous context for streaming applications. We also replaced the full context self-attention with local self-attention which helps generalize to long utterances [21]. The same as [1], we train our systems on a combination of data from different domains. For efficiency, we aggregate utterances with similar lengths before creating batches (i.e. bucketing). Due to the different length distributions across domains, for a particular batch the data may bias towards certain domain. This could lead to biased statistics for the batch normalization used in the original Conformer layer, and then limit the model's generalization capability across domains. We addressed this issue by replacing the batch normalization layer with the group normalization layer [22]. This is found critical for the quality of our multi-domain models.
Additionally, we speedup the training and inference by removing the original relative positional encoding [23]. Instead, we reuse the existing convolution module that aggregates information from neighboring context to implicitly provide relative positional information [23,24]. This is done by simply swapping the order of the convolution module and the multi-head self-attention module, leading to the improved Conformer block depicted in Figure 1.

Two-pass with Cascaded Encoders
A big goal of two-pass models is to make up for the quality degradation in the 1st-pass. To improve our current two-pass approach, which is to run rescoring, we look to run a beam search instead. One of the challenges with this beam search is that we need the model to be robust to decoding short search utterances as well as long caption utterances. Typically attention-based models do very poorly on long-form [21].
To address this, we look at running a 2nd-pass beam search with RNN-T itself, which has shown better robustness to long-form [25]. The model explored, which we call Cascaded Encoders, is shown in Figure 2. To add the non-causal aspect of LAS (which improves quality) [17] into a streaming, causal RNN-T system, we add additional non-causal encoder layers on top of the causal encoder layers. The 1st-pass uses only the causal encoder and the RNN-T decoder. In the second pass, the additional non-causal layers take in both left and right context of the 1st-pass encoder outputs, and again feeds to the same decoder. A single RNN-T decoder is shared between the 1st and 2nd-passes for smaller model size and on-device benefits.

LATENCY IMPROVEMENTS
In this section, we present latency metrics for streaming ASR and techniques to reduce them. Different from the average token latency [20], we adopt metrics that are directly related to streaming speech applications such as Voice Search and Assistant.

Endpointer Latency
In streaming ASR based applications, when the user finishes speaking is a critical signal that triggers the next step fulfillment. For Voice Search/Assistant, it signals the ASR system to finalize the recognition result and initiate either a server request for more information or an action on the client side. Endpointer latency measures the time difference between when the user finishes speaking and when the system predicts the end of the query (EOQ). This is the latency metric we normally referred to in previous work [1,2]. A lower Endpointer latency leads to a lower application latency and faster system responses. We adopt the same RNN-T Endpointer model together with early and late penalties on EOQ during training to reduce Endpointer latency [2]. We report both the median (i.e. 50 th percentile, EP50) and the 90 th percentile (EP90) latency for comparisons.

Prefetch Latency
Prefetching is a common technique used in web-based applications to reduce network latency involved in the application stack [26,27]. Instead of waiting for the EOQ signal, streaming applications normally send early server requests (either retrieving relevant information or necessary resources for next step actions) based on partial/incomplete recognition hypotheses. If a prefetch is based on a partial hypothesis that does not match the finalized hypothesis at the time EOQ is generated, it is discarded as a premature prefetching, increasing the overall computation cost. However, if the partial hypothesis used in a prefetching matches with the final result, the system can immediately execute the following action without waiting for additional server responses. This saves the time used to compute and fetch responses from the server and reduces the network processing latency. Prefetch latency is defined as the time difference between when the first correct prefetch is triggered and when the user finishes speaking [28]. A prefetch is correct only if the partial recognition result it used matches the final recognition result. If no correct prefetch is found, the latency falls back to Endpointer latency. Besides latency, the prefetch rate, which is the number of prefetches for each query, is also an important metric. For comparison, we report both the 50 th and 90 th percentile latency (PF50 and PF90) together with the prefetching rate (PFR).

E2E Prefetching
There are multiple ways to trigger prefetching [28]. It normally relies on observing a fixed interval of silence either from the decoding or an external voice activity detector (VAD). An E2E Prefetching has recently been proposed and yielded a much better prefetch latency and prefetch rate tradeoff [28]. It leverages on the EOQ prediction of the RNN-T Endpointer model for prefetching decisions. Different from endpointing, we want to generate EOQ for every partial result but avoid changing decoding. To achieve that, for each frame before EOQ shows on the top beam, we artificially add it to the end of the current hypothesis to compute its probability given the observations and the best path so far. This allows us to predict how likely the query is completed at each time frame and the corresponding partial result while decoding following frames. If the probability is greater than a predefined threshold, the system declares a prefetch decision.

Partial Latency
Prefetching relies on partial results generated by the ASR model. Systems that output partial hypothesis with less latency are preferred. We hence define partial latency as the time difference between when the first correct partial hypothesis is generated by the model and when the user finishes speaking. Similarly, the correctness of a partial hypothesis refers to whether it matches the finalized recognition hypothesis. Unlike prefetching latency, partial latency is inherent to the ASR model itself and does not rely on additional logic implemented in the application pipeline such as the decision to trigger prefecthing. Partial latency is the lower bound for prefetch latency. Developing techniques that reduce models' partial latency would give more room for reducing the overall application latency and is independent of the actual application pipeline.

Constrained Alignment
One way to improve partial latency is to constrain the model's prediction based on alignments generated from other models [19]. Similar to the RNN-T EP model that constrains the EOU token, constrained alignment penalizes the prediction of each word's beginning and ending tokens if they fall out of a buffer centered around the corresponding ground truth obtained from the alignment. It has been shown to yield more accurate prediction timing information and can be used to improve partial latency.

FastEmit
In conventional RNN-T optimization, emitting a non-blank token and the blank token are treated equally, as long as the log-probability of the target sequence is maximized. However, in streaming ASR systems, the blank token (i.e. output nothing) should be discouraged as it leads to higher latency. A simple and effective sequencelevel emission regularization technique, FastEmit [3], is hence developed. It encourages predicting non-blank tokens and suppresses blank tokens across the entire sequence based on transducer forwardbackward probabilities. It is implemented by adding a regularization hyper parameter λFastEmit to the original Equation 20 in [29] (please refer to [29] for detailed notion definitions): Intuitively, FastEmit applies a "higher learning rate" (λFastEmit 0) to the prediction of non-blank token when back-propagating into the streaming ASR network, while the prediction of blank token remains the same. It has been shown to give significant lower latency while retaining recognition accuracy on different RNN-T models. More importantly, FastEmit does not require any prior alignment information [19,20] and has no additional training or serving cost.

EXPERIMENTAL SETUP
Model Architecture: All models are trained using a 128D log-Mel feature frontend [25]. The features are computed using 32ms windows with a 10ms hop. Features from 4 contiguous frames are stacked to form a 512D input representation, which is further subsampled by a factor of 3. A 16D one-hot domain-id vector is then appended to form a 528D input vector as the inputs to the model. Following [4], we use 512D Conformer layers in the encoder. Causal convolution and left-context attention layers are used for the Conformer layer to strictly restrict the model to use no future inputs. 8-head attention is used in the self-attention layer and the Convolution kernel size used is 15. The encoder consists of 17 Conformer layers. The RNN-T decoder consists of a prediction network with 2 LSTM layers with 2048 units projected down to 640 output units, and a joint network with a single feed-forward layer with 640 units. Two non-causal Conformer layers that take in additional 5.04s right context are used in the Cascaded Encoders on top of the streaming encoder before the decoder. All the E2E models are trained to predict 4,096 word pieces [30]. The decoding is rescored with a 2nd-pass MaxEnt language model [31].
The Conformer RNN-T model has 137M parameters. The two non-causal Conformer layers in the Cascaded Encoders model bring in additional 12M parameters. All models are trained in Tensorflow [32] using the Lingvo [33] toolkit on 8 × 8 Tensor Processing Units (TPU) slices with a global batch size of 4,096 utterances. Models are optimized using synchronized stochastic gradient descent with the Adam optimizer [34]. Datasets: All the E2E models are trained on audio-text pairs the same as [1], which is a small fraction of data compared to the trillion-word text-only data a conventional LM is trained with. To increase vocabulary and diversity of training data, we explore using more data by incorporating multi-domain utterances as described in [25]. These multi-domain utterances span domains of search, farfield, telephony and YouTube. All datasets are anonymized and hand-transcribed; the transcription for YouTube utterances is done in a semi-supervised fashion [35]. In addition to the diverse training sets, multi-condition training (MTR) [36] and random data down-sampling to 8kHz [37] are also used to further increase data diversity. Noisy data is generated at signal-noise-ratio (SNR) from 0 to 30 dB, with an average SNR of 12 dB, and with T60 times ranging from 0 to 900ms, averaging 500ms. Noise segments are sampled from YouTube and daily life noisy environmental recordings. Both 8 kHz and 16 kHz versions of the data are generated, each with equal probability, to make the model robust to varying sample rates. The test set includes around 12K Voice Search utterances with duration less than 5.5s long. They are anonymized and handtranscribed, and are representative of Google's Voice Search traffic.

Quality Improvement with Conformer
First we experimented with Conformer encoders for quality improvement. Table 1 presents the comparison on the Voice Search testset for RNN-T models with different encoders. The RNN-T model with an LSTM encoder serves as our baseline (B1), which has been shown to give a better quality and latency performance than conventional hybrid ASR systems [1]. Limiting the Conformer encoder presented in [4] to use only left-context for streaming applications, system C0 shows significant WER degradation due to the biased batch normalization statistics in our multi-domain task. This can be resolved by randomly sampling utterances (i.e. no bucketing) instead of aggregating utterances with similar lengths into each batch (C0 No bucketing in Table 1) with the cost of large training speed reduction due to the lower computation utilization per batch. By replacing the batch normalization with the group normalization, system C1 addressed the issue with similar WER gains but less training speed regression. Further swapping the order of the convolution module and the self-attention module, system C2 achieves both WER gains and training speedups. Comparing to B1, C2 yields a total of 7% relative WER reduction and 35% speedup. Note for B1 we did not see quality gains with more LSTM encoder layers.

Latency Improvement
In previous work [1,2], we focused on improving RNN-T models' endpointer latency and have shown that E2E models have a better WER and endpointer latency tradeoff than conventional hybrid ASR systems. However, even with that we still observe large total latency in E2E based streaming applications. This is then tracked down to  Table 2).

Reducing Partial Latency with Constrained Alignment
In this experiment, we explored constraining the RNN-T prediction with alignment information following [19]. When applied to B1, the use of constrained alignment achieves 210ms and 230ms latency reduction for PR50 and PR90 respectively with the cost of a quality degradation from 6.0% to 6.9% (B2 vs. B1 in Table 2). Negative latency suggests the model is capable of hypothesizing the whole query even before seeing the end of the speech.

Reducing Partial Latency with FastEmit
We then applied FastEmit to the same baseline system B1. From Table 2, B1 with FastEmit (B3) gives 180ms and 130ms reduction for PR50 and PR90 with much less WER regression (6.0% to 6.2%). Additionally, no alignment is needed during B3 training. To address the quality degradation, we used FastEmit on a better E2E model -C2 from Table 1. Although FastEmit still brings in 0.2% absolute WER regression, the system 'C2+FastEmit' (i.e. C3) has a WER of 5.8% with a -110ms PR50 and 90ms PR90, which is better both in quality and latency than B1.

Reducing Prefetch Latency with E2E Prefetching
Next, we explored the use of E2E prefetch to minimize the gap between partial and prefetch as prefetch latency is the one that is reflected in the total latency. E2E prefetch can only be used in E2E systems and is not applicable to conventional models, where silencebased prefetching is used. From Table 2, adding E2E prefetch to C3 (i.e. C4) brings down the prefetch latency to -50ms for PF50 and 110ms for PF90 with a PFR of 1.86. The WER increased to 6.0% which is still comparable to B1.

Two-Pass with Cascaded Encoders
To further address the quality degradation due to latency related optimization in the 1st-pass, a LAS-based two-pass rescoring model [1,17] was firstly applied, which is referred to as T1 in Table 2. It reduces the WER to 5.3% with comparable endpointer and partial latency metrics; however, the E2E Prefetch is less effective as it only applies to RNN-T EP model. We then train a Cascaded Encoders model (T2 in Table 2). In the causal only mode, 'T2 Single-pass Casual' performs similar to C4; while with the additional non-causal 2nd-pass at EOQ, 'T2 Two-pass' achieves a similar WER as T1 but with much better prefetch latency benefiting from the E2E prefetching. In non-streaming application, we can use 'T2 Single-pass Noncausal' to get an even better WER of 4.8%. The computation cost of T2 is much higher than T1 due to the use of beam-search instead of rescoring. We will further investigate techniques in reducing it in future work. With the two-pass Cascaded Encoders model T2, we can achieve a much better WER and latency (including endpointer, partial and prefetch) comparing to the previous published best E2E system B1.

Comparison to Conventional Model
We also included the performance of a conventional hybrid ASR model (B0 in Table 2) that consists of a low-frame-rate acoustic model emitting context-dependent phonemes [38] (0.1GB), a 764kword pronunciation model (2.2GB), a 1st-pass 5-gram languagemodel (4.9GB). RNN-T models (except for B2) have a better quality and endpointer latency comparing to the conventional system B0, reconfirming the finding in [1]. With FastEmit, we can achieve a better quality with very close partial latency (C3). The -150ms median partial latency (PR50) for B0 mainly comes from the stronger LM trained on large amount of text only data that can potentially hypothesis the full query even before the speech finishes, which E2E models currently lack of. However, even with slightly worse partial latency, E2E systems can still achieve much better prefetch latency with the help of E2E prefetching (C4), which directly affects the total latency of streaming ASRs. With an additional non-casual 2nd-pass (T2 Two-pass), we can further bring down the WER to 5.4% while still having a faster prefetch than B0.

CONCLUSIONS
In this work, we further improve the quality and latency of the RNN-T based E2E models for streaming applications. We replaced the encoder LSTM layers with the recently developed Conformer layers [4] for quality and adopted a simple yet effective latency regularization technique, FastEmit [3], which is generic to any transducer based models. Furthermore, we developed a Cascaded Encoders RNN-T model that shares the same RNN-T decoder for the two passes. It gives us a system that is better and faster than the previous best E2E system [1] and surpassing the conventional model in quality and all latency metrics.