U2++ MoE: Scaling 4.7x parameters with minimal impact on RTF
Xingchen Song Di Wu Binbin Zhang Dinghao Zhou Zhendong Peng Bo Dang Fuping Pan Chao Yang


Event-Triggered Resilient Filtering for 2-D Systems with Asynchronous-Delay: Handling Binary Encoding Decoding with Probabilistic Bit Flips
This paragraph of the first footnote will contain the date on which you submitted your paper for review. This paper was produced by the IEEE Publication Technology Group. This work was supported by the National Natural Science Foundation of China (No. 62250056), the Natural Science Foundation of Shandong Province (No.ZR2021MF069, ZR2021JQ24).

    Yu Chen and Wei Wang
Y. Chen and W. Wang are with the School of Control Science and Engineering, Shandong University, Jinan 250061, P. R. China (Email: ychen_2000@163.com, w.wang@sdu.edu.cn).

    
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================









Scale has opened new frontiers in natural language processing, but at a high cost. In response, by learning to only activate a subset of parameters in training and inference, Mixture-of-Experts (MoE) <cit.> have been proposed as an energy efficient path to even larger and more capable language models and this shift towards a new generation of foundation models is gaining momentum, particularly within the field of Automatic Speech Recognition (ASR). Recent works <cit.> that incorporating MoE into ASR models have complex designs such as routing frames via supplementary embedding network, improving multilingual ability for the experts, and utilizing dedicated auxiliary losses for either expert load balancing or specific language handling. We found that delicate designs are not necessary, while an embarrassingly simple substitution of MoE layers for all Feed-Forward Network (FFN) layers is competent for the ASR task. To be more specific, we benchmark our proposed model on a large scale inner-source dataset (160k hours), the results show that we can scale our baseline Conformer (Dense-225M) to its MoE counterparts (MoE-1B) and achieve Dense-1B level Word Error Rate (WER) while maintaining a Dense-225M level Real Time Factor (RTF).

Furthermore, by applying Unified 2-pass framework with bidirectional attention decoders (U2++) <cit.>, we achieve the streaming and non-streaming decoding modes in a single MoE based model, which we call U2++ MoE.
We hope that our study can facilitate the research on scaling speech foundation models without sacrificing deployment efficiency.





speech recognition, mixture-of-expert, streaming




§ INTRODUCTION



Scaling up neural network models has recently received great attention, given the significant quality improvements on a variety of tasks including natural language processing <cit.> and speech processing <cit.>.

While training massive models on large amounts of data can almost guarantee improved quality, there are two factors affecting their practicality and applicability: (1) training efficiency and (2) inference efficiency. Large dense models are often prohibitively compute-intensive to train, with some models requiring TFlops-days of compute <cit.>. A recent line of work has proposed sparsely-gated Mixture-of-Experts (MoE) layers <cit.> as an efficient alternative to dense models in order to address both training and inference efficiency limitations.

There have been several related Mixture-of-Expert approaches for ASR modeling <cit.>. In those models each frame of the input sequence activates a different subset of the experts, hence the computation cost per frame becomes only proportional to the size of the activated sub-network. To avoid collapse to just a few experts while ignoring all others, all of those works use load balancing mechanisms such as dedicated auxiliary losses <cit.>. Nonetheless, the resulting complex optimization objectives often lead to a large amount of hyper parameter tuning, such as the weight of each auxiliary loss. Moreover, load balancing is designed to address the issue of expert sparsity in the NLP field when routing different tokens. However, this issue may not hold in the speech domain, as there is a high degree of similarity between neighboring speech frames <cit.>. Forcing speech frames to be evenly distributed among all experts does not align with intuition, as it conflicts with the natural continuity observed in the relationships between adjacent speech frames.





















Despite several notable successes of speech MoE, wide-spread adoption has been hindered by training complexity and the lack of streaming capabilities. We address these with the introduction of U2++ MoE. We simplify the integration of MoE and preclude the necessity for any auxiliary losses. Our proposed method mitigate the complexities, and we show large sparse models may be trained, for the first time, with unified streaming & non-streaming fashion.



§ RELATED WORKS


Several mixture-of-expert strategies have been developed for enhancing ASR modeling, but our work differs from them in the following ways.


    
  1) In contrast to all prior studies <cit.>, our MoE model do not include any auxiliary losses for expert routing, thus significantly streamlining the training optimization process.
    
  2) Compared to <cit.>, our MoE study also works without using any shared embedding networks, thereby simplifying the model architecture and enhancing its generality for model scaling.
    
  3) Compared to all previous works <cit.>  that exclusively explored the application of MoE layers within the encoder, our study extends this innovation by integrating MoE layers into the decoder's FFN as well. Notably, You et al. <cit.> have also attempted to modify all FFN modules in encoder into MoE layers, but it fails to achieve a better performance (detailed in <cit.>, section 3.2, paragraph 1, last sentence). In contrast, we are the first to demonstrate the effectiveness of MoE layer substitution across both encoder and decoder components.
    
  4) We are the pioneers in demonstrating the streaming capability of the MoE. While Hu et al. <cit.> have made attempts to integrate MoE layers into a causal encoder to enable streaming recognition, their approach resulted in a notable deterioration in the average WER (detailed in <cit.>, section 5.1.1, paragraph 2, first sentence). In stark contrast, our approach, which marries the MoE-based Conformer with the U2++ framework, successfully facilitates both streaming and non-streaming decoding modes within a singular MoE-based model.
    
  5) Our research primarily emphasizes scaling models without a notable increase on RTF, diverging from prior efforts that predominantly concentrate on enhancing the accuracy of multi-lingual or multi-accent recognition <cit.>. These studies lack a comprehensive analysis of inference latency, such as Dense-1B model v.s. MoE-1B model or Dense-225M model v.s. MoE-1B model. In this paper, however, we demonstrate that a MoE-1B model can achieve the accuracy of a Dense-1B model while maintaining the inference efficiency of a Dense-225M model.


In summary, our guiding principle has been to keeping MoE model as simple as possible and is thus more generic for scaling up models. Our model do not require any auxiliary losses or any additional embedding networks. By applying 1) an embarrassingly simple replacement of all FFN layers with MoE layers and 2) the U2++ framework to Conformer <cit.>, we prove that MoE-1B model can achieve Dense-1B level accuracy with Dense-225M level inference cost, alongside the capability for streaming.



§ METHODOLOGY



Our model uses Conformer (for encoders) and Transformer (for decoders) as the main building block. A Conformer encoder layer <cit.> consists of a multi-headed self-attention and a convolution-based layer sandwiched by two FFN. A Transformer decoder layer <cit.> consists of a multi-headed self-attention, a multi-headed src-attention and one FFN. As shown in Fig.<ref>, to incorporate experts, we use an MoE layer <cit.> to replace all FFN in the encoders and decoders. Similar to <cit.>, the MoE layer consists of a routing network and multiple experts, each of which is an FFN.

We use the joint Connectionist Temporal Classification (CTC) loss <cit.> and Autoregressive Encoder Decoder (AED) loss <cit.> for training the proposed model. The combined loss has two hyper parameters (λ and α) to balance the importance of different losses (more details can be found in <cit.>, section 2.1):

    L = λ L_CTC + (1 - λ)(α L_AED^right2left + (1 - α) L_AED^left2right)


Similar to U2 <cit.>, we adopt the dynamic chunk masking strategy to unify the streaming and non-streaming modes. Firstly, the input is split into several chunks by a fixed chunk size C and every chunk attends on itself and all the previous chunks, so the whole latency for the CTC decoding in the first pass only depends on the chunk size. When the chunk size is limited, it works in a streaming way; otherwise it works in a non-streaming way. Secondly, the chunk size is varied dynamically from 1 to the max length of the current training utterance in the training, so the trained model learns to predict with arbitrary chunk size.



§ EXPERIMENTS




 §.§ Datasets

Our training corpus comprises mixed datasets gathered from a variety of application domains, amounting to a substantial 160k hours of large-scale, industrial-level training data. This corpus consists predominantly of Mandarin (90%) with the remainder in English (10%).

To evaluate the capabilities of the proposed method, we use the most widely used benchmark for the Mandarin ASR task, namely SpeechIO TIOBE ASR Benchmark [https://github.com/SpeechColab/Leaderboard]. SpeechIO test sets are carefully curated by SpeechIO authors, crawled from publicly available sources (Youtube, TV programs, Podcast etc), covering various well-known scenarios and topics (TV News, VLog, Documentary and so on), transcribed by payed professional annotators thus is exceptionally suitable for testing a model's general speech recognition capabilities. Cumulatively, the 26 publicly available SpeechIO test sets amount to 60.2 hours, averaging 2.3 hours of data across each domain.



 §.§ Training Details


In all experiments, we utilize 80-dimensional log-mel filterbank features, computed using a 25ms window that is shifted every 10ms. Each frame undergoes global mean and variance normalization. For modeling Mandarin, we employ character-based representations, whereas for English, we utilize byte-pair encoding (BPE), culminating in a comprehensive vocabulary of 6000 units. All our experiments are conducted in WeNet toolkit <cit.> with DeepSpeed <cit.> enabled, all the models are trained using 8 * NVIDIA 3090 (24GB) GPUs.

We have developed three distinct models, as detailed in Table <ref>, all of which adopt the parameters Head = 8, CNN_kernel = 15, λ = 0.3, and α = 0.3. In the context of the MoE layer, we configure it with 8 experts and enable only the top two experts during both the training and inference phases. For the decoding process, the CTC decoder initially generates the N-Best hypotheses during the first pass. Subsequently, these hypotheses are rescored by the attention decoder in the second pass to produce the final outcomes.














 §.§ Main Results on 160k hours





In Table.<ref>, we compare the performance of the three models from Table.<ref> under different conditions (such as the same number of training steps or the same training time), with the results indicating:

    
  1) At the same number of training steps (263k steps), comparing columns (b), (d), and (e) reveals that the WER of the MoE-1B model (3.93) is slightly worse than that of the Dense-1B model (3.72), but both significantly outperform the Dense-225M baseline (4.50).
    
  2) With the same training time (25.9 days), comparing columns (c), (d), and (f) shows that the WER of the MoE-1B model (3.80) is very close to that of the Dense-1B model (3.72), and both substantially surpass the Dense-225M model (4.18).


These results suggest that on a dataset of 160k hours, a larger number of parameters (from 225M to 1B) leads to better model performance. Moreover, when the number of parameters is the same, MoE models can achieve WER levels comparable to Dense models.

Furthermore, in Table.<ref>, we compare the inference speeds of the three models, with the results showing:

    
  1) Although the MoE-1B and Dense-1B have the same number of parameters, the former is 2.5 times faster than the latter.
    
  2) Even though the parameter count of MoE-1B is 4.7 times that of Dense-225M, the absolute difference in RTF between the two is only around 0.03 (for cpu) or 0.0004 (for gpu).


Overall, combining the WER and RTF results, we can confirm that the MoE-1B model can achieve Dense-1B level accuracy with Dense-225M level inference cost.











 §.§ Streaming Capability


Empirically, training a large model to accommodate both streaming and non-streaming modes simultaneously could potentially compromise performance. In response, this paper introduces a two-stage training pipeline. Initially, we train a non-streaming base model (such as MoE-1B and Dense-225M that is described in Section <ref> and Table <ref>), which then serves as the foundation for initializing the proposed U2++-MoE-1B model (and also U2++-Dense-225M, U2++-Dense-1B). The MoE-1B model shares an identical architecture with the U2++-MoE-1B model, with the only distinction lying in their approach to chunk masking. While the MoE-1B employs a full chunk strategy, the U2++-MoE-1B adopts a dynamic chunk method as detailed in section <ref>. This approach stabilizes the training process for a unified system capable of handling both streaming and non-streaming functionalities.

In Table <ref>, by comparing three different streaming models, we can draw the same conclusion as in the non-streaming models (section <ref>), which is that our proposed MoE model significantly outperforms the Dense counterpart in terms of WER while maintaining a similar RTF. Please note that the WER for the U2++-Dense-1B model is not included. This is due to the frequent occurrence of gradient explosions during the training process, which, despite the initialization with a non-streaming Dense-1B model, made the training unsustainable.






 §.§ Scaling Law










§ CONCLUSION




The proposed U2++ MoE provides a clean setup and little task-specific design. Through the straightforward substitution of all FFN layers in the baseline model with MoE FFNs, coupled with the adoption of the U2++ training framework, we attain notable enhancements in WER alongside streaming recognition capabilities, all without a considerable increase in RTF.



§ ACKNOWLEDGEMENTS

We thank Wenpeng Li and Jianwei Niu for their feedbacks on this work.







IEEEbib


