![圖片](https://mmbiz.qpic.cn/sz_mmbiz_png/KmXPKA19gW9OnnzCX2HjxlUqj24Vnns9NNNzu0PPwaOst5iciaSdlMlBvia0nHGUtk9XQhXRqPP6P8KXz8wUyXicmg/640?wx_fmt=other&from=appmsg&wxfrom=5&wx_lazy=1&wx_co=1&tp=webp)
AIxiv專欄是機器之心釋出學術、技術內容的欄目。過去數年,機器之心AIxiv專欄接收報導了2000多篇內容,覆蓋全球各大高校與企業的頂級實驗室,有效促進了學術交流與傳播。如果您有優秀的工作想要分享,歡迎投稿或者聯絡報導。投稿郵箱:liyazhou@jiqizhixin.com;zhaoyunfeng@jiqizhixin.com
新一代 Kaldi 團隊是由 Kaldi 之父、IEEE fellow、小米集團首席語音科學家 Daniel Povey 領銜的團隊,專注於開源語音基礎引擎研發,從神經網路聲學編碼器、損失函式、最佳化器和解碼器等各方面重構語音技術鏈路,旨在提高智慧語音任務的準確率和效率。
目前,新一代 Kaldi 專案 (https://github.com/k2-fsa)主要由四個子專案構成:核心演算法庫 k2、通用語音資料處理工具包 Lhotse、解決方案集合 Icefall 以及服務端引擎 Sherpa,方便開發者輕鬆訓練、部署自己的智慧語音模型。
近日,小米集團新一代 Kaldi 團隊關於語音識別演算法的論文《CR-CTC: Consistency regularization on CTC for improved speech recognition》被 ICLR 2025 接收。
- 論文連結:https://arxiv.org/pdf/2410.05101
- 論文程式碼:https://github.com/k2-fsa/icefall/pull/1766(已 merge 進 icefall 框架)
主流的自動語音識別(ASR)模型包括 CTC [1]、transducer [2] 和混合系統 CTC/AED [3]。CTC 是其中最簡單、最便於部署的方法,但由於它的效能通常明顯落後於 Transducer 和 CTC/AED,這限制了它的實際應用。為此,新一代 Kaldi 團隊提出了 Consistency-Regularized CTC (CR-CTC),可以讓純 CTC 模型的識別效能比肩 Transducer 和 CTC/AED。CR-CTC 在多個主流的 ASR 資料集,包括 LibriSpeech、Aishell-1、GigaSpeech 等資料集上,取得新的 SOTA 結果(不依賴外部訓練資料和外部語言模型)。例如,在 LibriSpeech 資料集上訓練 Zipformer-L,標準 CTC 的 WER 為 2.5/5.72,CTC/AED 的 WER 為 2.09/4.59, Pruned Transducer 的 WER 為 2.00/4.38;CR-CTC 的 WER 為 2.02/4.35;CTC/AED 和 Pruned Transducer 掛上 CR-CTC 聯合訓練後,WER 可分別進一步降低到 1.96/4.08 和 1.88/3.95。如 Figure 1 所示,CR-CTC 方法非常簡單,先從同一個輸入 Mel-spectrogram x 得到兩個不同的 augmented views
和
,分別輸入引數共享的 encoder 模型 f,得到對應的兩個 CTC 機率分佈
和
,除了計算兩個 CTC loss
和
,還引入 consistency regularization loss 來約束兩個分佈的一致性:
。系統總體 loss 為:其中 α 為控制正則的超引數,預設設定為 0.2。Different augmented views我們對同一個輸入 x 的兩個 copy 獨立地使用 SpecAugment [4] 來獲得不同的 augmented views
和
。SpecAugment 包含 time warping、frequency masking 和 time masking。由於 time warping 會顯著改變輸出的時間戳,因此我們在建立 copy 前先應用 time warping,防止兩個分支的輸出分佈在時間戳上嚴重不匹配。接著,分別對兩個 copy 獨立應用 frequency masking 和 time masking,得到了
和
。相較於普通的 ASR 系統,我們特意使用了更大程度的 time masking。Consistency regularization loss我們在CTC 分佈的每一幀上應用 consistency regularization,透過最小化每一對分佈
和
之間的雙向 KL 散度:
和
。此處,sg 表示 stop-gradient,防止這一項的梯度影響目標分佈。Consistency regularization loss 公式為:論文從三個不同的角度來解釋 CR-CTC 的本質行為:1)self-distillation;2)masked prediction;3)peak suppression。當我們在訓練中使用 dropout [5] 和 stochastic depth [6] 等模型正則技術,可以看作我們正在隱式地訓練隨機取樣的不同 sub-model,這些 sub-model 最終被整合為一個 ensemble 用於推理。與 R-Drop [7] 和 cosub [8] 類似,CR-CTC 在進行對不同 sub-model 之間的 self-distillation,監督訊號為對方提供的幀級別的 token 分佈。另外,CR-CTC 使用了不同的 augmented views(以及更大程度的 time-masking),讓這些 sub-model 接觸輸入資料的不同角度的資訊,加強他們預測的多樣性,這樣有利於更豐富、更完備的知識蒸餾。在 CR-CTC 中,那些覆蓋在 time masking 區域的幀,被要求著基於其他沒有被 masked 的區域,去預測對方提供的 token 分佈。這個過程類似於 masked-based 自監督模型 [9,10,11],鼓勵模型去學習非 mask 部分的上下文表徵資訊,併發掘模型隱式的語言建模能力。我們在 CR-CTC 中使用不同的 augmented views,減少兩邊同時被覆蓋在 time masking 區域的幀的出現,提高這些被 masked 位置所接收的 token 分佈的質量。另外,使用更大程度的 time masking 可以加強 masked prediction 行為,進而增強模型對上下文表徵資訊的學習。 眾所周知,CTC 通常會學習到非常尖的機率分佈。如 Figure 2 (left) 所示,non-blank token 只佔 1 幀,其他的都是 blank,它們的機率都非常高。這種現象表明模型有可能已經過擬合了,泛化能力不強。CR-CTC 的 consistency regularization 引導著模型學習兩邊分佈的平均,這使得模型學習到的 CTC 分佈會更加平滑。這個 peak suppression 行為減少了在訓練資料上的過度置信,從而增強模型的泛化能力。如 Figure 2 (right) 所示,CR-CTC 學習到的分佈更加平滑,機率更低,伴隨著更多 non-blank 的 repeat 出現。論文主要使用 Zipformer [12] 作為 speech encoder 進行實驗驗證。由於 CR-CTC 訓練時需要進行兩次 forward,我們對 CR-CTC 模型的 batch size 和 epoch 數都設定為標準 CTC 模型的一半,來確保兩者訓練代價可比較。具體使用的 GPU 數量和 epoch 數在論文附錄中。Table 1、2、3 分別展示了不同模型在 LibriSpeech、Aishell-1、GigaSpeech 三個資料集上的表現(不依賴外部訓練資料和外部語言模型)。總的來說,CR-CTC 的效能顯著超越標準 CTC,和 CTC/AED 與 Transducer 模型效果相當。另外,掛上 CR-CTC 聯合訓練,可以進一步提升 CTC/AED 和 Transducer 的效能。在這三個資料集上,我們取得了新的 SOTA 結果。Table 4、5、6 分別展示了 CR-CTC 關於不同解釋角度 self-distillation、masked prediction、peak suppression 的消融實驗結果,具體說明可參考論文。與掛一個 auxiliary head 聯合訓練相比較想要提升 CTC 系統的效能,一個最直接的方法便是掛一個 AED head 或者一個 Transducer head 聯合訓練。如 Table 7 所示,CR-CTC 的效能明顯超過這兩個方法,引數還更少。如 Table 17 所示,使用 Conformer [13] 作為 speech encoder 時,CR-CTC 同樣可以顯著提升 CTC 的效能,並且略微超過 CTC/AED 和 Transducer。[1] Graves, A., Fernández, S., Gomez, F., & Schmidhuber, J. (2006, June). Connectionist temporal classification: labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd international conference on Machine learning (pp. 369-376).[2] Graves, A. (2012). Sequence transduction with recurrent neural networks. arXiv preprint arXiv:1211.3711.[3] Watanabe, S., Hori, T., Kim, S., Hershey, J. R., & Hayashi, T. (2017). Hybrid CTC/attention architecture for end-to-end speech recognition. IEEE Journal of Selected Topics in Signal Processing, 11 (8), 1240-1253.[4] Park, D. S., Chan, W., Zhang, Y., Chiu, C. C., Zoph, B., Cubuk, E. D., & Le, Q. V. (2019). Specaugment: A simple data augmentation method for automatic speech recognition. arXiv preprint arXiv:1904.08779.[5] Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. (2014). Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15 (1), 1929-1958.[6] Huang, G., Sun, Y., Liu, Z., Sedra, D., & Weinberger, K. Q. (2016). Deep networks with stochastic depth. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part IV 14 (pp. 646-661). Springer International Publishing.[7] Wu, L., Li, J., Wang, Y., Meng, Q., Qin, T., Chen, W., ... & Liu, T. Y. (2021). R-drop: Regularized dropout for neural networks. Advances in Neural Information Processing Systems, 34, 10890-10905.[8] Touvron, H., Cord, M., Oquab, M., Bojanowski, P., Verbeek, J., & Jégou, H. (2023). Co-training 2L submodels for visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 11701-11710).[9] Devlin, J. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.[10] Baevski, A., Zhou, Y., Mohamed, A., & Auli, M. (2020). wav2vec 2.0: A framework for self-supervised learning of speech representations. Advances in neural information processing systems, 33, 12449-12460.[11] Hsu, W. N., Bolte, B., Tsai, Y. H. H., Lakhotia, K., Salakhutdinov, R., & Mohamed, A. (2021). Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM transactions on audio, speech, and language processing, 29, 3451-3460.[12] Yao, Z., Guo, L., Yang, X., Kang, W., Kuang, F., Yang, Y., ... & Povey, D. (2023, October). Zipformer: A faster and better encoder for automatic speech recognition. In The Twelfth International Conference on Learning Representations.[13] Gulati, A., Qin, J., Chiu, C. C., Parmar, N., Zhang, Y., Yu, J., ... & Pang, R. (2020). Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100.