# HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units

HuBERT learns speech representations by predicting clustered hidden units

Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, Abdelrahman Mohamed · arXiv · 2021-6-14

- **Problem** Speech has no fixed vocabulary of sound units and no marked boundaries during pre-training, so masked prediction, which works for text, has no ready targets.
- **Method** HuBERT clusters speech features offline with k-means, then trains a BERT-style model to predict the cluster IDs at masked frames only.
- **Results** On 10-minute labeled splits, HuBERT X-LARGE brings test-other WER down to 6.8%, matching or improving on wav2vec 2.0.

## Why speech breaks text-style masked prediction

Masked prediction works for text because each word is a discrete token, so the model has a fixed vocabulary to predict from. Speech gets none of that for free: several sounds can sit in one utterance, no lexicon of sound units exists during pre-training, and the edges between units aren't marked. Pseudo-labeling sidesteps the missing lexicon by borrowing labels from a teacher, but a student can only copy that teacher and stays tied to its task.

The authors therefore want targets that come from the speech itself, with no transcripts needed.

## Offline clusters as targets

HuBERT clusters the speech features offline and trains a model to predict those cluster IDs at masked frames. The labels are noisy, and the authors argue that consistency of the labels across utterances matters more than their correctness. The idea draws on DeepCluster for visual learning, but the masked prediction loss over sequences lets HuBERT model temporal structure as well.

The first targets come from k-means with 100 clusters on 39-dimensional MFCC features, which are 13 coefficients plus their first and second derivatives. Using a crude teacher on purpose tests how far a weak teacher can carry the method.

## Loss over masked frames only

Masks follow SpanBERT and wav2vec 2.0: p percent of timesteps start a mask, and each mask spans l steps. The default is p = 8% and l = 10. The masked waveform passes through the convolutional encoder and the BERT-style transformer, and the encoder emits one feature every 20 ms for 16 kHz audio. A projection and cosine-similarity logits, scaled by a temperature τ set to 0.1, give a distribution over codewords at each masked frame.

The total loss is \\( L = \\alpha L\_m + (1-\\alpha) L\_u \\), where Lm sums the log probability of the target over masked timesteps and Lu does the same over unmasked ones. Setting α to 1 makes the loss masked-only, which the authors liken to language modeling, while α = 0 gives an unmasked-only loss that is closer to hybrid acoustic modeling.

The authors expect the masked-only setting to be more robust to poor targets, and the ablation later tests that expectation.

## Iterations, models and fine-tuning

The BASE model runs two iterations on 960 hours of LibriSpeech, with 250k steps on MFCC labels and then 400k steps on labels from the sixth transformer layer of the first model. Re-clustering needs a sample, because the 768-dimensional features are too large to load in full, so the authors fit k-means on 10% of the data. The fitting uses mini-batches of 10,000 frames, with k-means++ initialization and 20 random starts.

LARGE and X-LARGE train for one iteration on 60,000 hours of Libri-light, using labels from layer 9 of the second BASE model. Fine-tuning uses CTC on characters, updates all weights except the convolutional encoder, and replaces the projection with a new softmax.

## Low-resource fine-tuning results

The authors fine-tuned on Libri-light splits of 10 minutes, 1 hour and 10 hours, plus the LibriSpeech 100-hour split, and scored test WER with language-model decoding. HuBERT X-LARGE brought test-other down to 6.8% in the same 10-minute setting.

At 100 hours, HuBERT LARGE is 0.1% WER higher than wav2vec 2.0 LARGE on test-clean, and HuBERT BASE is 0.1% higher on test-other. Outside those two cells the authors report HuBERT ahead of the wav2vec 2.0 rows. HuBERT also beats DiscreteBERT by a large margin in every setup, even though both predict discovered units with a masked objective.

The ablations vary the loss, the targets, the ensembles and the hyperparameters, but none of them tests the input type that separates the two models.

## Full 960-hour LibriSpeech results

The authors expect HuBERT to gain from self-training too, but that expectation is not measured in the paper.

## Which frames the loss covers

For this ablation the models pre-train for 100k steps, fine-tune on the 10-hour Libri-light split, and report dev-other WER with an n-gram language model. With 100 MFCC clusters, WER is 17.86 when α = 1.0, compared to 29.57 at α = 0.5 and 96.37 at α = 0.0. Adding loss on unmasked frames costs more as the targets get worse, because those frames then copy a poor teacher.

With those better targets, α = 0.5 gives 11.59, so the unmasked loss hurts less but still doesn't beat α = 1.0. Supervised chenone labels reach their best value at α = 0.5, with 9.16, so unmasked loss helps when the targets are good.

## Combining cluster targets

The first ensemble mixes k-means models with 50, 100 and 500 clusters, and the second applies product quantization to spliced MFCC features. Product quantization over three 39-dimensional subspaces, each with a codebook of 100 entries, gives a teacher WER of 16.73. That is lower than the 17.56 of the multi-granularity k-means ensemble. The authors read this as ensembles helping, but the table reports teacher WER, and the paper gives no downstream score for these teachers.

## How well clusters track phones

The authors align frames to phones with a hybrid ASR system and score the cluster IDs with phone purity, cluster purity and PNMI. PNMI measures how much uncertainty about the phone label is removed once the cluster label is known, as a fraction of the phone entropy. \\\[ \\mathrm{PNMI} = 1 - \\frac{H(y \\mid z)}{H(y)} \\\] Across ten trials, k-means gives PNMI standard deviations from 0.000 to 0.012, so the clustering is stable across runs.

Longer pre-training helps as well: 100-cluster targets take dev-other WER from 17.86 at 100k steps to 11.68 at 800k steps.

## Limitations

The data are English LibriSpeech and Libri-light, and no experiment in the paper tests another language. At 100 hours HuBERT LARGE trails wav2vec 2.0 LARGE on test-clean, and HuBERT BASE trails on test-other. On 960 hours HuBERT trails pre-training plus self-training systems, and the authors expect self-training to close the gap without testing it.

The ablations use 100k pre-training steps and one fine-tuning split, and the Table VII caption sets p at 6.5% while the default is 8%. Phone purity can't rank target sets with different cluster counts, since one label per frame reaches 100% purity.

## Paper info

- **Authors**: Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, Abdelrahman Mohamed
- **Venue**: arXiv · Preprint
- **First published**: 2021-6-14
- **Added**: 2026-11-12
- **Updated**: 2021-6-14
- **Version**: v1
- **arXiv**: 2106.07447
- **Category**: cs.CL · cs.AI · cs.LG · eess.AS
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2106.07447v1) · [PDF ↗](https://arxiv.org/pdf/2106.07447v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, Abdelrahman Mohamed (2021). HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units. arXiv:2106.07447v1. https://arxiv.org/abs/2106.07447v1

**BibTeX**

```
@misc{hsu2021hubert,
  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},
  url = {https://arxiv.org/abs/2106.07447v1}
}
```

## Other paper commentary

- [Robust Recovery of Subspace Structures by Low-Rank Representation](https://refivu.com/en/papers/14c27646-6e22-4f5b-b820-67e75508bf84-robust-recovery-of-subspace-structures-by-low-rank.md)
- [Improved Baselines with Momentum Contrastive Learning](https://refivu.com/en/papers/b3c4bdf4-000b-4115-9c61-4869e9e62ccc-improved-baselines-with-momentum-contrastive-learning.md)
- [DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation](https://refivu.com/en/papers/b9c76a95-d60f-4b38-98c6-45cfaa2bcd30-deepsdf-learning-continuous-signed-distance-functions-for.md)
- [SimCSE: Simple Contrastive Learning of Sentence Embeddings](https://refivu.com/en/papers/be6ac7d7-6b80-4ef3-905e-9b7eecc4765c-simcse-simple-contrastive-learning-of-sentence-embeddings.md)
- [Supervised Contrastive Learning](https://refivu.com/en/papers/a5818cfe-00fa-4e85-a38e-cdce6aa6cad5-supervised-contrastive-learning.md)
- [iCaRL: Incremental Classifier and Representation Learning](https://refivu.com/en/papers/1de3af5b-26d7-4577-82d5-dabe37a7e63a-icarl-incremental-classifier-and-representation-learning.md)
- [Multi-View 3D Object Detection Network for Autonomous Driving](https://refivu.com/en/papers/f58134ec-87c8-446c-9cb7-11f607b68051-multi-view-3d-object-detection-network-for-autonomous.md)
- [Return of the Devil in the Details: Delving Deep into Convolutional Nets](https://refivu.com/en/papers/799263cd-4207-4a10-a587-306f8a7610b7-return-of-the-devil-in-the-details-delving.md)
- [Domain Randomization for Transferring Deep Neural Networks from Simulation to the Real World](https://refivu.com/en/papers/3b804ec5-0ee6-4d18-8463-1dda78a4a6bf-domain-randomization-for-transferring-deep-neural-networks.md)
- [Depth Map Prediction from a Single Image using a Multi-Scale Deep Network](https://refivu.com/en/papers/c95f6db5-ef02-41ca-945a-e4e0afa1fb1c-depth-map-prediction-from-a-single-image-using.md)
- [On Hyperparameter Optimization of Machine Learning Algorithms: Theory and Practice](https://refivu.com/en/papers/e35d8e99-a32c-4e33-acef-50ee792021f2-on-hyperparameter-optimization-of-machine-learning.md)
- [Lost in the Middle: How Language Models Use Long Contexts](https://refivu.com/en/papers/990be3e6-ce8b-473a-94d1-735a4cb6a76f-lost-in-the-middle-how-language-models-use.md)

## Terms in this paper

- [k-means](https://refivu.com/en/terms/43bff6ec1a4e-k-means)
- [LibriSpeech](https://refivu.com/en/terms/0144d6cc5a9d-librispeech)
- [CTC](https://refivu.com/en/terms/45fa7736b849-ctc)
- [WER](https://refivu.com/en/terms/8dc40f9dfe8c-wer)
- [product quantization](https://refivu.com/en/terms/24ba857fb032-product-quantization)
- [Libri-light](https://refivu.com/en/terms/6a0ee31c8510-libri-light)
- [pseudo-labeling](https://refivu.com/en/terms/720f31f1346d-pseudo-labeling)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/4fe3f455-0287-4182-b603-63ebb7e4b5fc-hubert-self-supervised-speech-representation-learning-by)
