Speech Recognition (ASR)
What ASR actually has to solve
Automatic Speech Recognition (ASR) takes a raw audio waveform — a sequence of air pressure measurements sampled thousands of times per second — and converts it into text. That sounds simple until you consider what's actually in the signal: the same word spoken by two people sounds different, the same person says the same word differently depending on mood and speed, background noise overlaps with speech, and words run together with no gaps between them the way text has spaces.
The raw waveform is also enormous: a single second of audio at 16kHz is 16,000 numbers. A sentence might be 100,000+ numbers, none of which look anything like letters. ASR systems have to bridge an acoustic signal to a symbolic one, through several layers of abstraction.
From waveform to features
Almost no ASR system — classical or neural — works directly on raw audio samples. The first step is almost always to convert the waveform into a spectrogram: a 2D representation showing which frequencies are present at each moment in time. This is typically computed using a Fourier transform applied to short overlapping windows of audio (tens of milliseconds each), producing a grid of (time, frequency) energy values.
A common refinement is the mel spectrogram, which warps the frequency axis to match how human hearing perceives pitch (we're much better at distinguishing low frequencies than high ones). This single preprocessing step turns a 1D wall of numbers into a 2D image-like representation that convolutional and transformer architectures can process using the same tools built for computer vision.
The classical pipeline: acoustic model + language model
For decades, ASR was built from two separate statistical models glued together. The acoustic model predicted, from short audio frames, which phoneme (basic unit of sound, like the "k" in "cat") was likely being spoken — traditionally using Hidden Markov Models combined with Gaussian mixtures, later replaced by neural networks. The language model separately scored how likely a candidate word sequence was in the target language, using statistics learned from huge text corpora — independent of any audio.
A decoder then searched over the combination: which sequence of words best explains the acoustic evidence *and* is a plausible sentence? This is why old ASR systems could "hear" the right phonemes but output grammatically plausible nonsense, or correctly guess an ambiguous-sounding word because the language model favored the more common phrase.
Classical pipeline vs. end-to-end neural ASR
| Aspect | Classical (HMM + separate LM) | End-to-end neural (Whisper-style) |
|---|---|---|
| Architecture | Separate acoustic model, language model, pronunciation dictionary, decoder | Single neural network trained end-to-end on audio-to-text pairs |
| Training | Each component trained/tuned separately | Jointly optimized on one objective |
| Handling accents/noise | Brittle — requires explicit adaptation | Learns robustness directly from diverse training data |
| Engineering complexity | High — many interacting components | Lower — one model, one forward pass |
| Data requirements | Can work with moderate labeled data | Benefits enormously from very large, diverse datasets |
Note
Why end-to-end models need so much data
Because a model like Whisper is learning acoustics and language jointly, with no hand-engineered linguistic priors, it needs to see enormous variety: different accents, background noise, recording quality, speaking speed, and vocabulary. This is exactly why these models were trained on hundreds of thousands of hours of audio rather than the hundreds of hours that sufficed for older academic benchmarks. The tradeoff is favorable: the resulting models generalize far better to real-world, messy audio than carefully tuned classical pipelines ever did, precisely because they were never fit to a narrow, clean dataset in the first place.
Where ASR still struggles
Overlapping speakers (the "cocktail party problem"), rare proper nouns and technical jargon, code-switching between languages mid-sentence, and very noisy or low-bandwidth audio remain genuinely hard. Punctuation and capitalization are also not acoustically present in the signal at all — the model has to infer where sentences end purely from learned patterns of pauses, intonation, and language statistics, which is why ASR transcripts sometimes punctuate run-on speech oddly.
What's next
Speech recognition converts audio to text; Text-to-Speech solves the reverse problem — converting text back into natural-sounding audio. Continue to Text-to-Speech (TTS) to see how that direction works, including why it was historically considered even harder than ASR.
I build these systems professionally.
Whether it's a RAG pipeline, analytics migration, or AI workflow — let's talk.