w2v-BERT: Combining Contrastive Learning and Masked Language Modeling for Self-Supervised Speech Pre-Training

Yu-An Chung, Yu Zhang, Wei Han, Chung-Cheng Chiu, James Qin, Ruoming Pang, Yonghui Wu

Introduction

Automatic Speech Recognition (ASR) has traditionally relied on large amounts of labeled data, which is both expensive and time-consuming to produce. Self-supervised learning (SSL) offers a solution by leveraging vast quantities of unannotated audio for pre-training. Current state-of-the-art SSL frameworks for speech typically fall into two categories: contrastive learning (like wav2vec 2.0) and masked language modeling (MLM, like HuBERT). While contrastive learning excels at discriminative tasks, MLM provides deeper contextual representations. However, MLM approaches often require iterative, offline clustering steps.

W2v-BERT introduces a unified framework that combines the strengths of both paradigms into a single, end-to-end differentiable system. By integrating contrastive learning and MLM, w2v-BERT achieves superior performance without the need for external clustering.

Architecture and Methodology

The w2v-BERT architecture utilizes Conformer blocks, which combine Transformers for global context modeling and Convolutional Neural Networks (CNNs) for local feature extraction. The framework consists of three primary components:

  1. Feature Encoder: A CNN-based module that processes raw audio into latent feature representations.
  2. Contrastive Module: This module performs a task similar to wav2vec 2.0. It uses a quantizer to map continuous features into a discrete set of tokens. A contrastive loss is applied to ensure these tokens are discriminative and represent meaningful acoustic units.
  3. Masked Prediction Module: This module implements the MLM objective. It takes context vectors from the contrastive module, applies masking, and attempts to predict the discrete token IDs generated by the quantizer.
The w2v-BERT architecture combines a contrastive stack and an MLM stack, using Conformer blocks to process speech features.

The synergy between these modules is crucial. The contrastive task provides the "vocabulary" for the MLM task on the fly, while the MLM task encourages the model to learn high-level contextual dependencies.

The Necessity of Contrastive Learning

A key finding in the development of w2v-BERT is the necessity of the contrastive module. Without the contrastive loss to guide the discretization process, the MLM module fails to converge effectively. The contrastive task acts as a regularizer, preventing "codebook collapse"—a common failure mode where the quantizer maps all inputs to a single token.

Training curves showing that the MLM module fails to learn (zero accuracy, high loss) without the accompanying contrastive module.

By training both objectives simultaneously, the model learns to produce discrete units that are both locally discriminative and globally contextualized.

Experimental Results

The model was evaluated on several benchmarks, including the Libri-Light corpus for pre-training and LibriSpeech for fine-tuning.

  • LibriSpeech Performance: w2v-BERT achieved a 5% to 10% relative reduction in Word Error Rate (WER) compared to previous state-of-the-art models like HuBERT and wav2vec 2.0. The "XXL" version (1 billion parameters) reached a WER of 1.5% on the test-clean set without an external language model.
  • Real-World Robustness: On a Google Voice Search dataset, which contains noisy and diverse audio, w2v-BERT outperformed a Conformer-based wav2vec 2.0 by over 30% relatively. This demonstrates the model's ability to generalize to challenging, non-academic environments.

Conclusion

W2v-BERT represents a significant step forward in self-supervised speech representation learning. By successfully merging contrastive learning and masked language modeling into an end-to-end framework, it eliminates the need for iterative offline clustering while setting new performance benchmarks. Future work will explore the model's efficiency in low-resource settings and further hyperparameter optimization.

Summary updated

BibTeX
@inproceedings{chung2021w,
  author = {Yu-An Chung and Yu Zhang and Wei Han and Chung-Cheng Chiu and James Qin and Ruoming Pang and Yonghui Wu},
  title = {{w2v-BERT: Combining Contrastive Learning and Masked Language Modeling for Self-Supervised Speech Pre-Training}},
  booktitle = {ASRU},
  year = {2021},
  doi = {10.1109/asru51503.2021.9688253},
}
Figure