Question · Speech recognition
How are speech recognition models trained?
Speech recognition models are trained on recordings paired with human-written transcripts. The model predicts text from each clip, and training adjusts its weights until those predictions match the transcript. Public datasets such as LibriSpeech and Common Voice supply much of the audio, and methods such as data augmentation and pre-training make a fixed set of recordings go further.
Updated October 17, 20264 min read8 cited facts, each traced to its source
Speech recognition models are trained on recorded speech that already has a human-written transcript. The model reads each clip, predicts text, and its weights are adjusted until the predictions match what was said. Public datasets supply much of the audio, and techniques such as data augmentation and self-supervised pre-training let a fixed set of recordings go further.
Every model learns from audio paired with a human transcript
A training set is a list of pairs: an audio clip and the words spoken in it. Before the network sees the sound, the audio is converted into a mel spectrogram, a picture of energy across frequency bands over time. The network turns that picture into a guess at the text, and a loss function measures how far the guess is from the transcript. Repeating this over millions of clips is the training.
The three families in the guide to speech recognition models use different loss functions, but all of them need the pairs. Scale is the main lever. OpenAI trained Whisper on 680,000 hours of multilingual and multitask audio with transcripts 1. That is far more audio than any of the public corpora below.
Public datasets supply much of the audio, and each suits a different job
Choose a dataset by the job you need done. A model trained on read audiobooks learns read speech, and a model trained on single command words learns commands. The table lists the common options.
| Dataset | What it contains | Best for |
|---|---|---|
| LibriSpeech | 1,000 hours of read English speech 2 | Benchmarks and training on clean read speech |
| Common Voice | 2,500 hours by 2019 from over 50,000 contributors in 38 languages 3 | Varied voices and languages recorded by volunteers |
| Speech Commands | 105,829 one-second clips of single words and background noise 4 | Voice commands and keyword spotting |
| PriMock57 | Public mock primary care consultations, with audio, transcripts and notes 5 | Medical conversation testing |
| MTSamples | 5,043 medical transcription samples across 40 specialties 6 | Medical vocabulary and phrasing, as text |
If you searched for a voice commands dataset, Speech Commands is a common public starting point. It teaches a model to tell a small set of command words apart, so it does not prepare a model to transcribe full sentences. If you searched for a medical dictation dataset, be careful with the rows that hold text only. MTSamples helps a model learn medical terms and report layout, but it has no sound, so it cannot teach a model to hear them.
PriMock57 is the only row here with both audio and transcripts. It is built from mocked consultations rather than real patient visits, so it suits testing a conversation tool, but it does not stand in for a clinic's own recordings.
Training adjusts the weights to close the gap between guess and transcript
Each architecture scores its guesses differently. Connectionist temporal classification scores the frame-by-frame output, transducers score the text as it streams, and encoder-decoders score each written token. In every case the score is sent backward through the network, and the weights move a small step toward the transcript. The guide explains the three families and where each one fits.
Self-supervised pre-training uses unlabeled audio before the labeled data
Transcribed audio is expensive, so many modern systems learn in two stages. First they learn general speech patterns from unlabeled audio. Then they fine-tune on a smaller labeled set. In the wav2vec 2.0 approach, a model given just ten minutes of labeled data, after pre-training on 53,000 hours of unlabeled audio, still reached a 4.8% word error rate on the LibriSpeech clean test set 7. That result is read English in a research setup, so treat it as evidence that unlabeled audio helps, not as proof that ten minutes is enough for a noisy office.
Augmentation changes the training audio, not the finished model
Data augmentation makes the same recordings look different each time the model sees them. SpecAugment acts on the filter bank features that the network reads, and it does two things: it warps the features, and it masks blocks of frequency channels and blocks of time steps 8. The model learns to recognize speech when parts of the input are missing, which is closer to the conditions of real use. The authors tested it on Listen, Attend and Spell networks.
What to do with this
- Match the dataset to the job. Use command sets for commands, conversation sets for conversations and read speech for benchmarks.
- Check the license and the source before you use a copy. Many public corpora are mirrored on sites such as Kaggle. A mirror can be a subset, a different version or a different license, so trace it back to the original.
- Fine-tune on your own audio to adapt a model. If you need a model for a specific setting, such as a clinic or a regional accent, record speakers with consent and pair the audio with accurate transcripts. Run Whisper locally shows one way to start from an existing model.
- Test on audio the model never saw. A score on LibriSpeech or Common Voice tells you how a model does on that benchmark. Measure the word error rate on your own recordings before you rely on it.
For the training data behind a specific product, check its documentation, because companies often do not publish their full data mix. For related questions, read whether speech recognition is AI, which neural network is best for speech recognition and whether large language models can do speech recognition.
Evidence
Every number on this page, with where it comes from. Open a fact to see the exact words in its source.
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
Go deeper
Related questions
- Can large language models do speech recognition?
- What role do hidden Markov models play in speech recognition?
- Which neural network is best for speech recognition?
- Can an ESP32 or microcontroller do speech recognition?
- Can Whisper AI do text to speech?
- Can Whisper identify different speakers?
- Can Whisper run without a GPU?
- Can Whisper transcribe in real time?