arXiv(opens in a new tab)Computer ScienceNov 2023Cited by 8 papers on PaperVantage

Manuscript Offprint

arXiv:2311.00430

Distil-Whisper: Robust Knowledge Distillation via Large-Scale Pseudo Labelling

Sanchit Gandhi, Patrick von Platen, Alexander M. Rush

Abstract

As the size of pre-trained speech recognition models increases, running these large models in low-latency or resource-constrained environments becomes challenging. In this work, we leverage pseudo-labelling to assemble a large-scale open-source dataset which we use to distill the Whisper model into a smaller variant, called Distil-Whisper. Using a simple word error rate (WER) heuristic, we select only the highest quality pseudo-labels for training. The distilled model is 5.8 times faster with 51% fewer parameters, while performing to within 1% WER on out-of-distribution test data in a zero-shot transfer setting. Distil-Whisper maintains the robustness of the Whisper model to difficult acoustic conditions, while being less prone to hallucination errors on long-form audio. Distil-Whisper is designed to be paired with Whisper for speculative decoding, yielding a 2 times speed-up while mathematically ensuring the same outputs as the original model. To facilitate further research in this domain, we make our training code, inference code and models publicly accessible.

1 Introduction

In recent years, Automatic Speech Recognition (ASR) systems have surpassed human-level accuracy in many academic benchmarks (Amodei et al., 2016; Baevski et al., 2020; Zhang et al., 2020), enabling a wide range of applications from transcription services to voice assistants (Aksënova et al., 2021). Whisper (Radford et al., 2022), a 1.5 billion parameter sequence-to-sequence (Seq2Seq) transformer model (Vaswani et al., 2017) pre-trained on 680,000 hours of weakly supervised speech recognition data, demonstrates a strong ability to generalise to many different datasets and domains (Gandhi et al., 2022). However, the ever-increasing size of pre-trained ASR models poses challenges when deploying these systems in low-latency settings or resource-constrained hardware (He et al., 2018; Zhang et al., 2022).

Recent efforts in natural language processing (NLP) have demonstrated promising advancements in compressing transformer-based models. Knowledge distillation (KD) has successfully been applied to reduce the size of models such as BERT (Devlin et al., 2019), without a significant performance loss on non-generative classification tasks (Sanh et al., 2019; Jiao et al., 2020; Sun et al., 2020). Inspired by machine translation methods, pseudo-labelling (PL) approaches (Kim & Rush, 2016) have also been explored for Seq2Seq summarisation (Shleifer & Rush, 2020), demonstrating the potential for substantial compression of Seq2Seq models on generative tasks. In the audio domain, KD has shown promising results for audio classification (Peng et al., 2021; Chang et al., 2021). However, similar results have not yet been achieved for the more difficult task of speech recognition.

In this paper, we apply distillation to the Whisper model in the context of Seq2Seq ASR. We address the challenge of maintaining robustness to different acoustic conditions through our construction of a large-scale open-source dataset covering 10 distinct domains. By pseudo-labelling the data, we ensure consistent transcription formatting across the dataset and provide sequence-level distillation signal. We propose a simple word error rate (WER) based heuristic for filtering the pseudo-labelled data and demonstrate that it is an effective method for ensuring good downstream performance of the distilled model.

We demonstrate that Distil-Whisper maintains the robustness of Whisper to different audio domains and noisy acoustic conditions. We measure this by evaluating the distilled models on four out-of-distribution test sets spanning multiple audio domains. The best model performs to within 1% WER of original Whisper checkpoint, while being 5.8 times faster with 51% fewer parameters. On long-form evaluation, the distilled model outperforms Whisper by 0.1% WER. We show that this performance gain is due to a lower propensity to hallucinate than the original Whisper model.

By sharing the same encoder weights as Whisper, Distil-Whisper can be used efficiently as an assistant model to Whisper for speculative decoding (Leviathan et al., 2023), for which we achieve a 2 times improvement in inference speed with only an 8% increase to parameter count. Speculative decoding algorithmically ensures that predictions of the main model are unchanged, meaning it can be used as a drop-in replacement for existing speech recognition pipelines using Whisper.

Our work suggests that large-scale pseudo-labelling of speech data has been under-explored and that it provides a promising technique for KD. To serve as a basis for further research on distillation for speech recognition, we release training code, inference code and models under https://github.com/huggingface/distil-whisper.

References (71)