
torchaudio.models.hubert_pretrain_large
Audio and speech815 ops316.6M params
HuBERT's pre-training wrapper: a wav2vec 2.0-style encoder predicting k-means cluster labels for masked frames.
Audio and speech · 520 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
The base builder sets a 768-dimensional encoder with 12 layers. Its default is 100 target classes, matching the first-iteration k-means teacher.
About this model's family
HuBERT, the Hidden-Unit BERT, is an approach to self-supervised speech representation learning. The members here are the model as used for pre-training, which wraps the encoder with a mask generator that produces the mask for masked prediction during training, rather than exposing the encoder alone. Speech is hard for self-supervision for three reasons the paper names: multiple sound units per utterance, no lexicon of units during pre-training, and variable-length units with no explicit segmentation.
The trick is an offline clustering step that provides aligned target labels for a BERT-like prediction loss. The prediction loss is applied over the masked regions only, which forces the model to learn a combined acoustic and language model over continuous inputs. The targets come from a simple k-means teacher of 100 clusters, refined over two iterations of clustering. The first-iteration labels come from k-means with 100 clusters on 39-dimensional MFCC features. Later iterations use 500 clusters on latent features extracted from the previous iteration's HuBERT model. Architecturally the models follow wav2vec 2.0: a convolutional waveform encoder, a BERT encoder, a projection layer and a code embedding layer. The waveform encoder is identical across configurations, composed of seven 512-channel layers. It produces a feature sequence at a 20ms framerate for audio sampled at 16kHz.
The forward pass of the pre-training model returns logits for the masked frames, logits for the unmasked frames, and a feature mean value used for an additional penalty loss. Three sizes exist, BASE, LARGE and X-LARGE, the last expanding the model to about 1 billion parameters. With that 1B model, HuBERT shows up to 19% and 13% relative WER reduction on the dev-other and test-other subsets.
Key idea. HuBERT pre-trains a speech encoder by predicting offline k-means cluster labels for masked frames only, relying on the consistency of the clustering rather than the intrinsic quality of the labels.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{hsu2021hubertselfsupervisedspeechrepresentation,
title={HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units},
author={Wei-Ning Hsu and Benjamin Bolte and Yao-Hung Hubert Tsai and Kushal Lakhotia and Ruslan Salakhutdinov and Abdelrahman Mohamed},
year={2021},
eprint={2106.07447},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2106.07447},
}