Audio-Language Models: the Whisper to Audio Flamingo 3 Arc
Whisper (Radford et al., December 2022) settled speech recognition with 680k hours of weakly-supervised multilingual speech, a simple encoder-decoder transformer, and a benchmark that later ASR releases kept citing. But recognition is not reasoning. Asking "what instruments are in this recording" or "what emotion is the speaker expressing" or "what happened at minute 3" requires audio understanding, not transcription. Qwen-Audio, SALMONN, LTU, and NVIDIA's Audio Flamingo 3 (AF3, July 2025) built that stack step by step: keep Whisper-class encoders, bolt on Q-formers, train on audio-text instruction data, add chain-of-thought reasoning. This lesson walks the arc.
Learning Objectives
- Compute a log-Mel spectrogram from a waveform: windowing, FFT, filter banks, log transform.
- Compare encoder options: Whisper encoder, BEATs, AF-Whisper hybrid. When each wins.
- Build an audio Q-former: N learnable queries cross-attending to spectrogram patches.
- Explain cascaded (Whisper-then-LLM) vs end-to-end audio-LLM training: why end-to-end scales better for reasoning.
The Problem
Whisper handled speech recognition, and transcription is now a commodity. That's where the commodity ends. If the model can't reason over what it heard (timing, speakers, emotion, music structure, environmental sounds), a transcript alone can't drive product features.
Three routes:
-
Cascade: Whisper transcribes, an LLM reasons over the transcript. Good for pure-speech scenarios. Struggles with music, environmental audio, overlapping speakers, and emotion.
-
End-to-end audio-LLM: an audio encoder feeds audio tokens straight into an LLM and skips transcription. This keeps the acoustic information (emotion, speaker, environment) but needs new training data.
-
Hybrid: an audio encoder plus a text decoder that can both transcribe and reason. Qwen-Audio and Audio Flamingo take this route.
The Concept
Log-Mel spectrogram: the input feature
Most audio encoders start from the same feature, a log-Mel spectrogram.
- Resample to 16 kHz.
- Short-time Fourier transform with 25ms windows, 10ms hop.
- Take magnitude of the FFT result.
- Apply Mel filter banks (typically 80 filters log-spaced 0-8000 Hz) to warp to perceptual frequency.
- Log compress (log(1 + x)) for dynamic range.
The result is a 2D array of shape (T, 80), where T is the number of time frames. A 30-second clip at a 100 Hz frame rate gives (3000, 80).
Whisper's encoder
Whisper's encoder is a 12-layer ViT-style transformer that reads the log-Mel spectrogram as a sequence of time frames and outputs one hidden-state vector per frame.
For ASR, the decoder is a cross-attention transformer that generates text tokens conditioned on the encoder output. Standard encoder-decoder.
For ALMs (audio-LLMs) you want the encoder output to feed a different LLM. The pattern is a frozen Whisper encoder, a trainable Q-former, and an LLM that is either frozen or tuned.
BEATs and audio-specific encoders
Whisper was trained on speech-dominant data, so it is weaker on music and environmental audio.
BEATs (Chen et al., 2022) is a self-supervised transformer trained on AudioSet. At the same parameter count it captures music and environmental sounds better than Whisper.
AF-Whisper, the hybrid in Audio Flamingo 3, concatenates Whisper and BEATs features as the audio input. Whisper carries the linguistic signal and BEATs carries the acoustic one.
Audio Q-former
Same pattern as BLIP-2's visual Q-former. A fixed number of learnable queries (often 32 or 64) cross-attend over the audio encoder's output frames, and the queries become the audio tokens the LLM consumes.
Training happens in two stages. In the alignment stage only the Q-former trains, with contrastive and captioning losses on audio-text pairs (AudioCaps, Clotho). In the instruction stage you train end-to-end, unfreeze the LLM, and use instruction data.
The arc: SALMONN, Qwen-Audio, AF3
SALMONN (Tang et al., 2023) is Whisper + BEATs + Q-former + LLaMA, the first open audio-LLM with serious reasoning ability. Benchmarks on MMAU show ~0.55 composite.
Qwen-Audio (Chu et al., 2023) has a similar architecture, a richer training set, and tuning for multi-turn dialogue. MMAU ~0.60.
LTU (Listen, Think, Understand; Gong et al., 2023) uses explicit reasoning data and focuses on chain-of-thought over audio clips. Smaller, more focused.
Audio Flamingo 3 (Goel et al., July 2025) is the current open SOTA. It has an 8B LLM backbone (Qwen2 7B), a Whisper-large encoder concatenated with BEATs, a 64-query Q-former, and training on 1M+ audio-text instruction pairs. MMAU 0.72, and it matches the proprietary frontier on some sub-tasks.
AF3 also adds on-demand chain-of-thought for audio. The model can optionally emit thinking tokens ("let me identify the instruments first: ...") before the final answer. Accuracy on complex reasoning tasks goes up 3-5 points when thinking is enabled.
Cascaded vs end-to-end
The cascaded pipeline has two steps:
- Whisper transcribes audio to text.
- An LLM reasons over the text.
That works well for "summarize this podcast." It falls short on:
- "What's the mood of this song?" The mood is in the sound, not the words.
- "Who is speaking, Alice or Bob?" This needs speaker identification.
- "At what second does the explosion happen?" Temporal grounding is lost in the text.
- "Is this real or generated audio?" Deepfake detection needs acoustic features.
End-to-end keeps the acoustic signal. Qwen-Audio and AF3 handle music, environment, and emotion natively.
2026 production recipe
For a new audio-understanding product:
- Go cascaded if transcription is the goal, with no music and no emotion inference.
- Go with AF3 or the Qwen-Audio family if you need music, emotion, multi-speaker handling, or complex audio reasoning.
Cascaded is cheaper and simpler. End-to-end is more capable.
MMAU: the audio reasoning benchmark
MMAU (Massive Multimodal Audio Understanding) is the 2024-2025 audio reasoning benchmark:
- 10,000 audio-text QA pairs across speech, music, environmental sounds.
- Covers classification, temporal reasoning, causal reasoning, open-ended QA.
- Tests what cascaded pipelines tend to miss.
Open SOTA (AF3) is at 0.72, and the proprietary frontier is ~0.78 (Gemini 2.5 Pro, Claude Opus 4.7). The gap is smaller than VideoMME's open-vs-closed delta, which suggests audio-LLMs are maturing.
Use It
main.py:
- Computes a log-Mel spectrogram in stdlib: windowing, naive DFT, and a simplified Mel filter bank.
- Runs an audio Q-former skeleton: given encoder output frames, compute Q, K, V, attention, and emit N tokens.
- Prints a cascaded-vs-end-to-end comparison table for a set of audio tasks.
Ship It
This lesson produces outputs/skill-audio-llm-pipeline-picker.md. Given an audio task (transcription, music tagging, emotion inference, multi-speaker diarization, environment classification), it picks cascaded, end-to-end AF3, or a hybrid.
I'd run main.py first and read its output knowing what it simplifies. The spectrogram demo uses 20 mel bins instead of 80, and its filter bank splits 64 DFT bins into equal linear bands rather than warping to the Mel scale. The naive DFT runs on the first frame only. What carries over is the shape arithmetic: a 1-second clip with a 25ms window and 10ms hop gives 98 frames, and the same hop gives roughly 100 frames per second of audio.
The Q-former is the part I'd poke at. Its queries are random draws and nothing trains them, and the input frames are random Gaussian noise rather than the spectrogram above, so the attention weights mean nothing. What you can see is the mechanics: 98 frames in, 8 tokens out, each token a softmax-weighted average over every frame. Try n_queries=64 and watch only the token count change. That count is the bottleneck the LLM sees.
The cascaded-vs-end-to-end table is hardcoded, so it records a claim and measures nothing. I'd treat it as a rule of thumb for picking a pipeline, then test on my own audio before committing to one.
Exercises
-
Compute the log-Mel spectrogram dimension for a 30-second clip at 16kHz, 25ms window, 10ms hop, 80 Mel bins. How does this change at 48kHz?
-
Why does Whisper underperform on music? What audio features does BEATs capture that Whisper does not?
-
Audio Q-former with 64 queries vs 32: at what task complexity does 64 pay off? 32 save compute for what?
-
Read AF3 Section 4 on on-demand thinking. Propose three audio tasks where chain-of-thought helps the most.
-
Implement a minimal diarization pipeline using AF3's output. How do you signal speaker changes?
Key Terms
| Term | What people say | What it actually means |
|---|---|---|
| Log-Mel spectrogram | "Mel features" | 2D (time, frequency) array of log-magnitude values after Mel filter banks |
| Audio Q-former | "Audio Perceiver" | Cross-attention bottleneck from audio encoder output to fixed-length queries feeding the LLM |
| Cascaded | "ASR-then-LLM" | Pipeline where Whisper transcribes and a text LLM reasons; loses acoustic information |
| End-to-end | "Audio-LLM" | Audio features enter the LLM directly via Q-former; preserves acoustic signal |
| BEATs | "Audio AudioSet encoder" | SSL transformer trained on AudioSet; strong on music + environmental sounds |
| MMAU | "Audio reasoning bench" | 10k QA pairs across speech, music, environment; 2024 eval standard |
| On-demand thinking | "Audio CoT" | Model can optionally emit reasoning tokens before final answer, lifts accuracy 3-5 pts |
Code
- main.py (python, 166 lines)