Audio in, tokens out
Whisper is a speech recogniser: an encoder–decoder transformer that reads audio and writes its transcript. Unlike the codecs on the EnCodec and Mimi tabs, it never turns audio into discrete ids: a fixed front end with no learned weights makes a log-mel spectrogram, a grid of real numbers the encoder reads. Only the output side is tokenized: into byte-level BPE pieces, and special tokens that mark the language, the task and where in time the text falls. The page shows both halves.
The checkpoint is openai/whisper-base, 72.6 M parameters, and the input is the 2.04 s LibriSpeech clip “where is my brother now”, already at Whisper's 16 kHz. Whisper's authors trained on 680,000 hours of audio paired with transcripts collected from the internet, a weakly supervised set, and found that models trained this way do well on standard benchmarks without fine-tuning on them.
Thirty seconds of power spectra
The model always reads 30 s. The front end pads the clip with 27.96 s of silence to 480,000 samples, then takes a short-time Fourier transform: 400-sample (25 ms) Hann windows , one centred on every 160th sample (every 10 ms, the signal reflected at its start), each giving the power at 201 frequencies spaced 40 Hz apart up to 8 kHz:
That gives 3,001 frames; the last is dropped, leaving 3,000 frames of 10 ms. The One frame panel draws one as its Power spectrum; the slider picks it.
Mel bands and the logarithm
Hearing resolves low frequencies more finely than high ones. The mel scale of Stevens, Volkmann and Newman (1937) was built from listeners' judgements of equal steps in pitch; Whisper uses Slaney's version of it, linear below 1 kHz and logarithmic above:
Eighty triangular filters , with edges evenly spaced in from 0 to 8 kHz and each of unit area, sum the power into band energies: the Mel bands chart, where a click on a band draws its filter over the spectrum. A logarithm then compresses their range. Whisper floors it 8 decades (80 dB) below the loudest cell of the whole 30 s and scales the result to roughly −1 to 1:
The Log-mel input row shows the 80 numbers the encoder reads for the frame, and the line under it follows one band through the three steps. From frame 206 on, the padded silence, every value sits at the floor. Log energies in mel-spaced bands are the classic speech features: Davis and Mermelstein (1980) took their cosine transform to make mel-frequency cepstral coefficients. Whisper gives the log-mel values themselves to the network.
From 10 ms frames to 20 ms positions
The Audio → log-mel frames column draws the waveform beside the log-mel spectrogram of the clip's 204 frames. The encoder begins with two convolutions of width 3 with GELU activations, the second with stride 2, so the 3,000 frames become 1,500 positions of 20 ms, of which the clip fills 102. Sinusoidal position embeddings are added and transformer layers follow; the Speech tab of the Transformer Explainer shows the model itself.
The 20 ms spacing returns on the text side as the step of the timestamp tokens. The trace drawn over the spectrogram is the decoder's cross-attention while it writes the selected token: the mean of the 8 alignment heads over the 1,500 positions, the heads whose attention follows the speech in time.
The text vocabulary
The decoder writes ids from a vocabulary of 51,865, drawn as a bar in the Text tokens column. The first 50,257 are byte-level BPE pieces: the Whisper paper uses GPT-2's tokenizer for its English-only models and refits a vocabulary of the same size for the multilingual ones, such as this one (the GPT-2 tab shows how byte-level BPE splits text). Special tokens follow: <|endoftext|> (50,257), <|startoftranscript|> (50,258), 99 language tokens from <|en|> (50,259), the tasks <|translate|> and <|transcribe|> (50,358 and 50,359), and <|notimestamps|> (50,363). The last 1,501 ids are timestamps, one every 20 ms from <|0.00|> to <|30.00|>:
A transcript starts from a prompt of special tokens: <|startoftranscript|>, a language, a task, and <|notimestamps|> unless timestamps are wanted. The recording gives <|en|> and <|transcribe|>; the Language chart shows the model's own first prediction over the 99 language tokens, 99.4 % for <|en|>.
Greedy decoding and the timestamp rules
The Greedy decoding strip steps through a decode. At each step the decoder writes the likeliest token that Whisper's rules allow; the strip shows the five likeliest after the rules and the raw probability before them. The rules always suppress 88 tokens, and forbid a space or <|endoftext|> as the first token. With the toolbar's <|notimestamps|> decode, the four-token prompt is followed by 7 steps, Where, is, my, brother, now, ? and <|endoftext|>, each also the raw model's first choice.
With the with timestamps decode the prompt ends after the task, the text is bracketed by timestamp tokens, and two more rules apply. The first token must be a timestamp no later than <|1.00|>. And when the 1,501 timestamp tokens together have more probability than any other single token, only a timestamp may be written. At the first step the raw model put 0.64 on <|notimestamps|> and 0.36 on all timestamps together; the rules leave only timestamps, and the likeliest is <|0.00|>. After ? the timestamps together have 0.97, against under 0.001 for the best other token, and the decoder writes <|2.00|>, id 50,464, closing one segment from 0.00 to 2.00 s.
The plain decode also has token timestamps, drawn on the time axis under the Output. Transformers aligns the tokens to the 20 ms positions by dynamic time warping over the alignment heads' cross-attention: with a cost that is low where token attends to position , the cheapest monotonic path through the matrix follows
and each token starts at the position where the path enters its row. The first word's span starts at 0, silence included.
Where it came from
Dynamic time warping (Sakoe and Chiba, 1978) was how early recognisers matched a spoken word against templates, and log-mel features have fed recognisers since 1980. Whisper (2022) kept that front end, put an encoder–decoder transformer behind it, and turned the parts of a recognition system into one token sequence: language, task, timestamps and transcript are all tokens the decoder predicts. The EnCodec and Mimi tabs take the other road and turn audio itself into tokens, so that a model can write speech as well as read it.
Papers
- Robust Speech Recognition via Large-Scale Weak Supervision Whisper, the model this tab records: the 30 s log-mel front end, the encoder–decoder transformer and the multitask token format with language, task and timestamp tokens.
- Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences Log energies of mel-spaced filters and their cosine transform, the mel-frequency cepstral coefficients, as speech-recognition features.
- A Scale for the Measurement of the Psychological Magnitude Pitch The mel scale of perceived pitch, which spaces Whisper's 80 filters.
- Neural Machine Translation of Rare Words with Subword Units Byte-pair encoding for subword vocabularies, the method behind the 50,257 text pieces of Whisper's decoder.
- Dynamic programming algorithm optimization for spoken word recognition Dynamic time warping, which aligns the decoded tokens to the audio for the token timestamps.
- Librispeech: An ASR corpus based on public domain audio books The corpus of read audiobooks the clip on the audio tabs comes from (dev-clean, 1272-135031-0012).