What Is wav2vec 2.0? From Unlabeled Speech Pretraining to Transcription
wav2vec 2.0 first learns speech representations from untranscribed audio, then fine-tunes on transcribed speech for ASR. This guide explains the stages, a CTC inference example, input requirements, data choices, and evaluation limits.
What Is wav2vec 2.0? From Unlabeled Speech Pretraining to Transcription
wav2vec 2.0 is a self-supervised approach: it learns useful representations from audio without transcripts, then fine-tunes with a smaller labeled speech set for automatic speech recognition (ASR). Unlabeled audio alone does not produce a ready-to-use transcript system. A transcription model still needs suitable pretrained weights, labeled data, a tokenizer or label vocabulary, and a decoder.
Two training stages
During pretraining, a convolutional encoder maps raw audio to latent speech representations. The method masks some time spans and trains a Transformer to distinguish the quantized target representation at a masked position from distractors using a contrastive objective. This stage does not require text transcripts.
For ASR fine-tuning, labeled audio and transcripts train the model to predict target units such as characters or subwords. A common setup uses Connectionist Temporal Classification (CTC) loss. Turning frame-level scores into words requires CTC collapse and decoding rules; a dictionary or language model can be added with a more elaborate decoder.
Untranscribed audio → self-supervised pretraining → fine-tuning with transcripts → frame scores → CTC decoding → transcript
Thus, “few transcripts” is different from “no transcripts at all.” Pretraining can use unlabeled speech, but building and evaluating a transcript recognizer still requires labeled data.
Interpret low-resource results carefully
The original paper reports experiments combining limited labeled English read speech from LibriSpeech with large-scale untranscribed pretraining. Its 10-minute setup reports WER 4.8/8.2 on LibriSpeech test-clean/other. This is not a guarantee for another language, microphone, noise condition, or domain. Results depend on data splits, pretraining scale, model size, and decoding choices, including language models.
Before choosing a checkpoint, check the languages, accents, and recording domains represented in pretraining; the quantity and quality of labeled transcripts; model size and GPU memory; latency; tokenizer, vocabulary, and licenses. A multilingual checkpoint does not guarantee equal quality for every language or task.
Run a short transcription example with Torchaudio
This example uses the English WAV2VEC2_ASR_BASE_960H bundle from the official Torchaudio tutorial. It is an English LibriSpeech example, not a universal model for arbitrary languages. Use compatible PyTorch and Torchaudio versions. The weights may download the first time the bundle is loaded.
import torch
import torchaudio
bundle = torchaudio.pipelines.WAV2VEC2_ASR_BASE_960H
model = bundle.get_model().eval()
waveform, sample_rate = torchaudio.load("sample.wav")
if waveform.size(0) != 1:
raise ValueError("mono audio required")
if sample_rate != bundle.sample_rate:
waveform = torchaudio.functional.resample(waveform, sample_rate, bundle.sample_rate)
with torch.inference_mode():
emissions, _ = model(waveform)
labels = bundle.get_labels()
ids = torch.argmax(emissions[0], dim=-1)
ids = torch.unique_consecutive(ids)
ids = [i.item() for i in ids if i.item() != 0]
transcript = "".join(labels[i] for i in ids).replace("|", " ").strip()
print(transcript)Read the output correctly
The bundle provides its expected sample rate and character labels; this example expects 16 kHz. Resample audio without changing playback speed.
The example requires mono input. If a recording is stereo, inspect its channels before discarding or mixing them.
The model returns character logits, not a ready transcript or calibrated probabilities. This example uses greedy CTC decoding by choosing the top score at each frame. It is simpler than beam search with a dictionary or language model, but uses less context.
The uppercase labels and vertical-bar word separator belong to this bundle. Other models can use different label sets and text normalization.
The snippet shows the documented flow from sample-rate matching to basic decoding; it is not a claim that audio was run in this environment. For another model or language, follow that model's preprocessing and decoding documentation.
Prepare fine-tuning data
Define the target language, accent, recording devices, use conditions, and evaluation question. Keep speakers or utterances from leaking between training and test splits.
Inspect audio for empty files, incorrect sample rates, clipping, long silence, and channel issues. Preserve originals and record conversion steps.
Normalize transcripts consistently: punctuation, case, numbers, contractions, whitespace, and Unicode. Characters missing from the label vocabulary can complicate training and decoding.
Check that the pretrained checkpoint, architecture, tokenizer, and label vocabulary match the fine-tuning recipe. The official fairseq recipe requires paired audio and labels plus a fairseq-format vocabulary.
Validate the pipeline on a small split. Check that validation transcripts are nonempty, labels map correctly, and training is not diverging or overfitting.
The original fairseq repository was archived read-only in March 2026. Older commands can assume an outdated environment. For new work, select a maintained implementation and model path supported by the framework you plan to use, and pin versions and checkpoint provenance. For reproduction, record the paper setup, repository commit, dependencies, and data access conditions.
What to report in evaluation
WER counts word substitutions, deletions, and insertions relative to the number of reference words. Word segmentation differs across languages, and normalization changes scores. Compare systems on the same held-out split with the same text normalization and decoding settings. Inspect representative errors by accent and domain, and measure latency and memory on the intended device. Do not repeatedly tune on the final test set.
When wav2vec 2.0 fits
| Situation | Guidance |
|---|---|
| Few transcribed hours but abundant untranscribed audio in a related language | Consider self-supervised pretraining and fine-tuning with labels. |
| Need a transcript system ready to deploy quickly | An already fine-tuned model or API for the target language may be simpler. |
| No transcripts and no reference text for evaluation | Reliable tuning and evaluation of transcription quality are difficult. |
| Need a new language | Verify the checkpoint's language coverage, scripts, and domain fit separately. |
Sources
Alexei Baevski et al., [wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations](https://arxiv.org/abs/2006.11477), 2020.
PyTorch Audio, [Wav2Vec2 speech-recognition pipeline tutorial](https://docs.pytorch.org/audio/stable/tutorials/speech_recognition_pipeline_tutorial.html)
Meta/Fairseq, [official wav2vec 2.0 implementation notes](https://github.com/facebookresearch/fairseq/tree/main/examples/wav2vec) — repository archived read-only on 2026-03-20.
Meta AI, [wav2vec 2.0 overview](https://ai.meta.com/blog/wav2vec-20-learning-the-structure-of-speech-from-raw-audio/)