Audio LLMs

A transcript keeps the words and drops the tone, the dog and the timing. An audio LLM feeds the sound itself to a language model: 750 vectors for a 30-second clip. So it answers questions a transcript cannot.

Pick a question, then switch between the two systems. Watch what reaches the language model and whether the answer is right. Then we build, piece by piece, the encoder, the adapter, the two ears, the data, audio tokens, the router and the grading.

You need to know that a spectrogram is a picture of sound and that an LLM predicts the next token, plus a little Python. We build the rest from zero.

Ask one call four questions

An illustrative call and scripted answers. The 750 vectors are Qwen2-Audio’s rate (one per 40 ms). The transcript length uses 3.5 text tokens per second, inside the 3 to 4 the Moshi paper gives for English speech.

Chapter 0

One Model, Any Question

Count what a fixed list of classes can answer, and find what a transcript throws away

Product sends you four requests about one support call. Transcribe it. Say if the customer sounded frustrated. Flag a barking dog. And: did anyone mention the invoice before the customer raised their voice?

The old answer is one model per request. Each has a fixed head: a last layer with one score per class, from a list frozen when training started. A sound tagger trained on AudioSet knows 527 classes. It can say “dog: yes”. It cannot say what came first.

How many order questions are there? Call the number of classes on the menu N. An order question picks a first event and a different second event. Call the count of such questions Qorder.

Say it aloud

Q-order equals N times, N minus one.

Qorder
Q-order the number of “did A happen before B?” questions.
N
N the classes on the menu: the choices for the first event.
N − 1
N minus one the choices left for the second event, which must differ.
In plain words

Pick the first event from N classes. Pick the second from the N minus 1 that remain. Multiply. That is Q-order.

With numbers

AudioSet has N = 527 classes. Q-order = 527 × 526 = 277,202. The tagger answers 527 yes-or-no questions and none of these.

Grow the menu

The slider sets the number of classes. Blue is what the fixed head answers. Pink is what people ask about order. The scale is logarithmic.

527

527 is the size of the AudioSet ontology. The gap grows with N, so more classes never close it.

The cheap workaround is to transcribe the call and give the text to an LLM. Build it first; for “what was said?” it wins. Then list what the transcript dropped:

QuestionSurvives a transcript?Why
What did they say?yesThat is what a transcript is.
Did they sound frustrated?noPitch, loudness and pace are not written down.
Was a dog barking?noThe recognizer outputs words only.
Indoors or in a car?noRoom sound leaves no text.
Did the pause before “fine” mean something?noMost transcripts drop timing.

So we want one function: f(audio, instruction) → text. The task becomes an argument at call time. An LLM already takes an instruction and returns text. The design question is how to get sound into it without passing through words.

The failure. Symptom: the transcript pipeline answers “no dog” with confidence. Measure: play it 20 calls with a known bark; count the misses. Fix: stop passing text between the stages.

The road

  1. Encoder, adapter, LLM: the three boxes and every tensor shape. The hero’s 750 vectors.
  2. Inside the adapter: average or stack, then one linear layer.
  3. What trains, four systems: LTU, SALMONN, Qwen2-Audio, Audio Flamingo 2.
  4. Two ears: why a speech encoder cannot hear the dog.
  5. The data mixture: why the optimizer counts tokens, not examples.
  6. Audio as tokens: codecs, token rates and AudioLM.
  7. Speaking while listening: full duplex, Moshi and latency.
  8. The router: the same clip, read differently for each question.
  9. Grading sentences: the audio-blind baseline and error bars.
  10. Field guide: failures, numbers, checks, code and links.
Why can a 527-class sound tagger not answer “did the door close before the speech?”

Chapter 1

Encoder, Adapter, Language Model

Trace a 30-second clip through every tensor shape until it sits in the LLM’s input

An LLM does not read words. It reads a matrix. The tokenizer turns text into ids, and an embedding table turns each id into a row of 4,096 numbers (for a 7-billion-parameter model). The transformer sees only rows. It does not know where they came from.

So if we make rows of width 4,096 that carry sound, attention treats them like words. Three boxes do it:

  1. An audio encoder turns the waveform into a sequence of acoustic vectors. Whisper’s encoder is the usual choice.
  2. An adapter (also called a projector) shortens that sequence and maps each vector to width 4,096.
  3. The LLM reads those vectors in place of an <audio> placeholder, then the instruction, and writes the answer.
StageShape for 30 sHow
Samples480,00030 s × 16,000 per second
Log-mel128 × 3,000one frame every 10 ms (160 samples)
Encoder1,500 × 1,280a stride-2 convolution halves time: one vector per 20 ms
Adapter750 × 4,096merge pairs (40 ms each), project to LLM width

How many vectors does a clip cost? Call the clip length in seconds T and the encoder’s vectors per second fenc. Call the number of encoder frames the adapter merges into one s, the stride. Call the result Na.

Say it aloud

N-a equals T times f-enc, divided by s.

Na
N-a the audio vectors that enter the LLM.
T
T the clip length, in seconds.
fenc
f-enc encoder vectors per second: 50 for Whisper.
s
s the stride: encoder frames merged into one LLM vector.
In plain words

Multiply the clip length T by the frame rate f-enc to count encoder frames. Divide by the stride s. That is N-a.

With numbers

T = 30, f-enc = 50, s = 2: N-a = 1,500 / 2 = 750 vectors, one per 40 ms. Qwen2-Audio uses this stride. A five-minute call gives 300 × 50 / 2 = 7,500.

Stretch the clip, change the stride

Each box shows a live shape. The bar below is an 8,192-position context: warm is audio, blue is a 30-token question and a 200-token answer.

30 s

The 8,192 budget is illustrative. Whisper’s encoder takes 30-second windows, so a longer clip runs as several windows. Memory assumes 32 layers of width 4,096 with full multi-head attention, the shape of Qwen-7B.

Every audio position also stores a key and a value in every layer for generation. That memory decides how many users one GPU serves:

per position: 2 (key, value) × 32 layers × 4,096 × 2 bytes = 524,288 bytes
750 positions × 524,288 bytes = 393 MB for one 30-second clip

The failure. Symptom: the model ignores the audio and answers from the question. Measure: print the sequence length and the attention mask length after splicing. One placeholder must become exactly N-a positions in both. Fix: grow the mask with the sequence.

A 60-second clip goes through a 50-per-second encoder and a stride-4 adapter. How many audio vectors reach the LLM?

Chapter 2

Inside the Adapter

Merge neighbouring frames, then move them into the LLM’s space with one learned matrix

The adapter has two jobs. It shortens the sequence, and it changes the space. The encoder’s 1,280 numbers describe acoustics. The LLM’s 4,096 numbers describe meaning in language. Reshaping cannot connect two coordinate systems. A learned matrix can.

There are two ways to merge two frames. Averaging adds them and halves the result: width stays 1,280. Stacking places them side by side: width doubles to 2,560. Qwen2-Audio averages with a pooling layer of stride 2, then applies one linear layer.

Call the merged vector for position i zi. Call the learned weight matrix W and the learned bias b. Call the vector handed to the LLM ui.

Say it aloud

u-i equals z-i times W, plus b.

ui
u-i the i-th audio vector the LLM reads: 4,096 numbers.
zi
z-i two encoder frames merged: averaged (1,280 wide) or stacked (2,560 wide).
W
W the weight matrix: one row per input number, 4,096 columns. Learned.
b
b the bias: 4,096 learned numbers added at the end.
In plain words

Merge two neighbouring frames into z-i. Multiply z-i by W. Add b. The result u-i is a row the LLM can read.

With numbers

With made-up toy numbers: frames h1 = [1.0, 0.0] and h2 = [0.8, 0.2], stacked, give z1 = [1.0, 0.0, 0.8, 0.2]. With the 4 × 3 matrix in the code below, u1 = [0.9, 0.0, 0.2]. The real averaging adapter has 1,280 × 4,096 + 4,096 = 5,246,976 numbers.

pythonimport numpy as np
H = np.array([[1.0, 0.0], [0.8, 0.2], [0.1, 0.9], [0.0, 1.0]])  # 4 frames, 2 features each
W = np.array([[ 0.5, 0.0,  1.0],      # column 1: noise minus voicing
              [-0.5, 1.0,  0.0],      # column 2: voicing of both frames
              [ 0.5, 0.0, -1.0],      # column 3: frame 1 noise minus frame 2 noise
              [-0.5, 1.0,  0.0]])
b = np.array([0.1, -0.2, 0.0])
Z = H.reshape(2, 4)        # stacking IS a reshape: (4, 2) -> (2, 4)
U = Z @ W + b           # [[0.9, 0.0, 0.2], [-0.8, 1.7, 0.1]]
# real Qwen2-Audio shape: AvgPool1d(2, stride=2) then nn.Linear(1280, 4096)

Average or stack

Top: four frames, purple for noise, teal for voicing. Middle: the merged vectors. Bottom: the adapter output. Swap the order inside each pair and see which merge notices.

Toy numbers from the code above. For averaging, the 2 × 3 matrix is W’s top half plus its bottom half, which is what W does to two equal frames.

Averaging is cheap and halves the projector. It also erases order inside a pair: [1, 0] then [0, 1] and the reverse both average to [0.5, 0.5]. At 40 ms per pair that rarely hurts speech. Stacking keeps the order at twice the weights: 2,560 × 4,096 + 4,096 = 10,489,856.

Either way the adapter is small. 5.2 million of Qwen2-Audio’s 8.2 billion parameters is 0.064%. It is the only part that starts from nothing.

The failure. Symptom: the model says “a person is speaking in a room” for every clip, even silence. Measure: feed a speech clip and a bark clip with one prompt and diff the answers. Fix: train the adapter in an alignment stage (Chapter 5) and check its output scale.

Two clips differ only in the order of the two frames inside each pair. Which merge can tell them apart?

Chapter 3

What Trains, and Four Systems

Decide what to freeze, then read four systems as four fixes to four failures

For each box you choose: freeze it, train it, or add LoRA, small low-rank matrices that learn a change while the base weights stay fixed.

BoxUsual choiceWhy
Encoderfrozen, or trained only with a large datasetIt has heard far more audio than your instruction set holds.
Adaptertrained from scratchNothing pretrained maps this encoder into this LLM.
LLMfrozen or LoRAFull fine-tuning on a small audio set damages its language skill.

“Frozen” has an exact meaning. Gradients still flow back through the LLM to reach the adapter, but no LLM weight changes. So the adapter learns to make vectors that this one LLM finds useful. Swap the LLM and the adapter is worthless.

Walk the lineage

Pick a system. The diagram shows its ears, how audio enters the LLM, and how many audio positions 30 seconds cost.

From the papers: LTU outputs 32 vectors per 10-second clip, and SALMONN’s window-level Q-Former gives 88 for 30 s. Qwen2-Audio gives one per 40 ms. Audio Flamingo 2 uses gated cross-attention, so audio takes no sequence positions.

SystemFailure it metFix
LTUTrained on open questions early, it answered from language and ignored the audio.A perception-to-understanding curriculum: closed tasks (class labels) first, open questions last.
SALMONNOne ear hears words or sounds, not both. Then task over-fitting: it transcribed when asked for a story.Whisper plus BEATs ears; an activation-tuning stage trained on long, varied answers.
Qwen2-AudioQwen-Audio’s hierarchical task tags formed a control language users do not type.Natural-language prompts; pre-training, then supervised fine-tuning, then DPO.
Audio Flamingo 2Prefix tokens make minutes of audio expensive.Cross-attention, long-audio data (30 s to 5 min) and skill-targeted questions, on a 3B LLM.

Only one of the four fixes is an architecture change in the usual sense. The rest are decisions about training and data. That is why the next two chapters are about ears and data, not layers.

The failure. Symptom: confident descriptions of sounds that are absent. Measure: ask about five sounds you know are absent; count the yeses. Fix: LTU’s curriculum. Closed tasks first force the gradient through the audio path.

Why does LTU train on closed-ended tasks such as class labels before open questions?

Chapter 4

Two Ears

Measure what each encoder can tell apart, and see why its training goal sets its blind spots

SALMONN runs two encoders over the same waveform. That looks like waste. It is not, and the reason is the training goal.

Whisper’s encoder learned to help write transcripts. A transcript stays the same whether the speaker whispers, shouts or stands next to a barking dog. So the encoder learns to drop all of that. BEATs learned by predicting masked patches of general audio. Words never appear in its goal, so it keeps timbre and events. The rule: an encoder is blind to what its training goal calls irrelevant.

How do we measure “blind”? Feed two clips to one encoder. Call its output vectors a and b. Score how alike they are with the cosine similarity.

Say it aloud

Cos of a and b equals a dot b, over the length of a times the length of b.

cos(a, b)
cos of a and b 1 means the encoder sees the same clip twice; near 0 means far apart.
a · b
a dot b multiply matching numbers and add them.
|a|
the length of a the square root of the sum of a’s numbers squared.
|b|
the length of b the same for the second clip’s vector.
In plain words

Multiply a and b number by number and add. Divide by both lengths, so only direction counts. If cos is near 1, this encoder cannot tell the clips apart.

With numbers

With made-up vectors for “hello” with and without a dog. Speech ear: a = [0.90, 0.10, 0.05], b = [0.92, 0.08, 0.04]; a · b = 0.838, lengths 0.907 and 0.924, cos = 1.00. Sound ear: a = [0.20, 0.95, 0.10], b = [0.25, 0.05, 0.90]; cos = 0.1875 / (0.976 × 0.935) = 0.21.

Ask each ear: same or different?

Pick a pair of clips. Each ear gives a three-number vector per clip. Cosine above 0.97 means that ear hears no difference.

Made-up three-number summaries. Real encoders output 1,280 numbers (Whisper large) or 768 (BEATs) per frame; the effect is the same.

SALMONN joins the ears frame by frame. Both run at 50 frames per second, so frame t of one is the same 20 ms as frame t of the other. The joined frame has 1,280 + 768 = 2,048 numbers. A window-level Q-Former then turns each 0.33 s window into one vector.

If the rates differ, fix the time grid first. A 100-per-second ear against a 50-per-second ear gives 1,000 frames against 500 over 10 s. Glue them naively and by frame 500 the streams describe moments 5 seconds apart.

python# speech: (B, 500, 1280) at 50 Hz   sound: (B, 1000, 768) at 100 Hz
r = sound.shape[1] // speech.shape[1]                        # 2
sound = sound.reshape(B, speech.shape[1], r, 768).mean(2)   # (B, 500, 768): same 20 ms grid
fused = torch.cat([speech, sound], dim=-1)                 # (B, 500, 2048)

Qwen2-Audio takes the other road: one encoder, started from Whisper-large-v3, trained further on a mixture that includes sounds and music. That costs a large training run, and saves one encoder pass on every request.

The failure. Symptom: music through a speech-only path comes back as invented lyrics. Measure: encode clips that differ in the property you need and check the cosine. Fix: add an ear whose goal keeps that property, or retrain the encoder.

Why is an excellent speech-recognition encoder a poor sound-event encoder?

Chapter 5

The Data Mixture

Turn labelled audio into instructions, then count the tokens the optimizer sees

To train f(audio, instruction) → text you need triples of that form. Almost none exist. Labelled audio does exist: transcripts, sound tags, captions, timestamps. Each label is an answer to a question nobody wrote down.

  1. Templates. A clip tagged {Dog, Bark} becomes “Is there a dog?” → “Yes.” Ask about absent labels half the time. Otherwise “yes” is always right and the model learns not to listen.
  2. LLM-written questions. Give a text LLM the labels, transcript and caption; ask for question-and-answer pairs. LTU built OpenAQA-5M this way: 1.9 million closed and 3.7 million open tuples. The writer never hears the audio, so drop any answer that claims a fact the metadata lacks.
  3. Hand-written skill sets. Ordering, counting, “cannot tell”. Expensive per example, so they need a deliberate share.

Now the trap. Only answer tokens get a loss; the label mask skips audio and prompt positions. So a task’s pull on the weights is its examples times its answer length. Call task k’s example count nk, its mean answer length in tokens Lk, and its share of the gradient sharek.

Say it aloud

Share-k equals n-k times L-k, over the sum over j of n-j times L-j.

sharek
share-k the fraction of all scored tokens that come from task k.
nk
n-k the number of examples of task k.
Lk
L-k the mean answer length of task k, in tokens.
Σj nj Lj
the sum over j of n-j L-j the scored tokens of every task added together.
In plain words

For each task, multiply its examples n by its answer length L. Add these up for all tasks. Divide task k’s product by that total. That is share-k.

With numbers

With made-up numbers: 1,000,000 examples split 60% ASR (L = 30), 30% captions (L = 15), 10% QA (L = 25). Tokens: 18.0 M, 4.5 M, 2.5 M; total 25 M. ASR share = 18 / 25 = 72%. You designed 60/30/10 and trained 72/18/10.

Design a mixture

Set the example shares. Upper bars: examples. Lower bars: tokens, what the optimizer sees. Press the button to balance by tokens.

60
30
10

Illustrative answer lengths: ASR 30 tokens, captions 15, QA 25. Slider values are relative weights, normalised to 100%.

Give each task a third of 25 M tokens. That takes 8.33 M / 30 = 277,778 ASR examples, 555,556 captions and 333,333 QA answers. Captions need twice the ASR examples because they are short.

Phrasing is a mixture axis too. If all 600,000 ASR examples say “Transcribe the audio.”, that string becomes a hidden tag. Spread them over 20 phrasings: 30,000 each.

The failure. Symptom: “tell me a story about this clip” returns a bare transcript. SALMONN’s authors call this task over-fitting. Measure: compute token shares, then ask for a format no task resembles. Fix: balance by tokens, vary phrasing, add a final stage on long, varied answers.

A 60/30/10 example mixture answers a story request with a transcript. What is the mechanism?

Chapter 6

Audio as Tokens

Turn sound into integers a language model can predict, and count what that costs

Every system so far listens and writes text. It cannot speak. Add a text-to-speech stage and the reply passes through text, so the laugh and the rising pitch are lost twice.

The other path makes audio into tokens. A neural audio codec encodes the waveform into a few vectors per second. A residual vector quantizer (RVQ) replaces each vector with indices into a stack of codebooks. Codebook 1 picks the nearest entry. Codebook 2 encodes what is left. Each level adds detail.

x = [0.62, −0.31]; nearest level-1 entry [0.50, −0.25]; error left 0.12² + 0.06² = 0.0180
level-2 entry [0.10, −0.05] on the residual [0.12, −0.06]; error left 0.02² + 0.01² = 0.0005: 36 times smaller

How many tokens does one second cost? Call the codec’s frames per second f, the codebooks kept per frame Q, and the tokens per second R.

Say it aloud

R equals f times Q.

R
R audio tokens per second the language model must handle.
f
f codec frames per second: 12.5 for Mimi, the codec in Moshi.
Q
Q codebooks kept per frame: one token each. Mimi uses 8.
In plain words

Each frame gives one token per codebook Q. There are f frames each second. Multiply them to get R.

With numbers

From the Moshi paper: f = 12.5, Q = 8, so R = 100 tokens per second. Each codebook has 2,048 entries, 11 bits per token: 1,100 bits per second. Thirty seconds is 3,000 tokens, against about 105 text tokens for the same speech.

Set the codec

The grid is one second of tokens: one column per frame, one row per codebook. The bar compares 30 seconds of audio tokens with the transcript.

8

12.5 Hz with 8 codebooks of 2,048 is Mimi (Moshi paper). Other settings are for comparison. The transcript uses 3.5 tokens per second.

Not every token is alike. AudioLM found the split that still shapes the field. Acoustic tokens come from a codec (SoundStream) and rebuild the sound well, but a model trained on them alone loses the thread. Semantic tokens come from clustering a self-supervised speech model (w2v-BERT); they keep the content but cannot rebuild the voice. AudioLM generates semantic tokens first, then acoustic ones.

AudioPaLM carried this into a text LLM. It starts from PaLM-2 weights and adds audio tokens to the vocabulary. One model then does speech recognition and speech-to-speech translation, and keeps a speaker’s voice across languages.

The failure. Symptom: a 75 Hz, 8-codebook codec fills the context in seconds: 600 tokens per second. Measure: R × seconds of dialogue. Fix: a low-frame-rate codec, which is why Mimi runs at 12.5 Hz.

Why did AudioLM use two kinds of tokens?

Chapter 7

Speaking While Listening

Add up a voice pipeline’s delays, then remove the stage that waits for silence

People do not take turns by rule. They overlap, interrupt and say “mm-hm” while the other talks. The Moshi paper cites an average gap of 230 ms between turns in natural conversation, across 10 languages. That is full duplex: both sides send and receive at once.

A turn-based pipeline cannot get near 230 ms. Add up its stages with illustrative numbers:

StageTime
Wait for silence (end of turn)700 ms
Speech recognition300 ms
LLM to first token400 ms
Speech synthesis to first sound300 ms
Total1,700 ms

OpenAI reported that ChatGPT’s Voice Mode, a pipeline of three models, averaged 2.8 s with GPT-3.5 and 5.4 s with GPT-4. It said GPT-4o, one model for audio in and out, responds in as little as 232 ms, 320 ms on average.

Moshi shows the design in the open. Three ideas do the work:

  1. Two streams. At every 80 ms frame it models its own audio tokens and the user’s. No detector decides whose turn it is. Silence is quiet tokens.
  2. Inner monologue. Each frame predicts a text token before the audio tokens. The words keep the speech coherent and give a transcript.
  3. A 12.5 Hz codec. One frame is 1 / 12.5 = 80 ms. Add one frame of delay between semantic and acoustic tokens: 160 ms in theory. The paper reports 200 ms in practice.

Talk to both designs

You speak for 2 seconds, then cut in while the model answers. Teal is you, blue is the model, red is talking over you.

700 ms

Pipeline stage times are illustrative. The 200 ms full-duplex start is Moshi’s reported practical latency. This pipeline finishes its sentence once it starts.

The failure. Symptom: the assistant talks over you, or waits a beat too long. Measure: time from your last word to its first sound, and from your interruption to its silence. Fix: shorten the timeout and you cut people off; only modelling both streams removes the trade.

Why can no amount of faster recognition, LLM or synthesis bring the turn-based pipeline under 230 ms?

Chapter 8

The Router

Change only the question and watch attention move across the same audio

The adapter computes the audio vectors once. Every answer token then attends over them again. Which vectors it leans on depends on the question. Nothing labels a vector “speech”: the prompt makes queries, the audio makes keys, and the dot products choose.

This device models that with two numbers per audio vector: its speech-ear energy sj and its sound-ear energy bj. The prompt sets two weights, wspeech and wsound. The match score of vector j is gj:

gj = wspeech × sj + wsound × bj

Attention turns scores into shares that add to 1. Call the share on vector j aj and the sharpness c.

Say it aloud

a-j equals e to the c times g-j, over the sum over k of e to the c times g-k.

aj
a-j the share of attention on audio vector j. All shares add to 1.
ec·gj
e to the c g-j the score g-j, sharpened by c, made positive by the exponential.
Σk ec·gk
the sum over k the same for every audio vector, added. Dividing by it makes the shares add to 1.
In plain words

Multiply each score g by the sharpness c. Raise e to that power. Divide each result by the total. That is a-j. In a real model c is 1 over the square root of the head width.

With numbers

With made-up numbers and c = 4. Three vectors: speech-heavy (s 0.80, b 0.10), mixed (0.40, 0.45), sound-heavy (0.05, 0.85). “Transcribe” sets weights 1.00 and 0.05: g = 0.805, 0.423, 0.093; e4g = 25.0, 5.4, 1.4; shares 79%, 17%, 4%. “What sounds?” (0.10, 1.00) flips it: 5%, 18%, 77%.

Route one clip

Rows: the clip (24 frames of 20 ms), the speech ear, the sound ear, 12 fused vectors, attention, then the answer. Change the prompt and leave the clip alone.

0.10

A toy. Ear energies, prompt weights and answers are illustrative; c = 4. A real model has many heads and layers, and queries of 4,096 numbers, not two weights.

Try four experiments. Flip the prompt on “Both”: the mass moves and the clip does not change. Pick music and transcribe: attention still hunts for speech, the setup that produces invented lyrics. Push noise to 1: the sound ear lights up everywhere and the routing blurs. Ask “which came first”: attention spreads, because it needs both ears.

You can measure this in a real model:

pythonout = model(inputs_embeds=e, output_attentions=True)
A = out.attentions[-8].mean(1)              # (B, query, key): heads averaged, a mid-late layer
audio_mass = A[:, -1, start:start + n_audio].sum(-1)  # share the last query puts on audio
# healthy: changes with the question, drops on silence. dead path: same for every clip

The failure. Symptom: on noisy calls the answers change in kind, not only in accuracy. Measure: audio mass on speech-heavy positions, clean against noisy. Fix: noise changed the routing, so train with noisy audio or add denoising before the ears.

The attention pattern changes when only the prompt changes. What does that correspond to in a real model?

Chapter 9

Grading a Model That Answers in Sentences

Subtract what the model scores without the audio, then check whether a gap is larger than the noise

A free sentence has no fixed correct form. Benchmarks use three regimes:

  1. Multiple choice. AIR-Bench’s foundation track has 19 tasks and about 19,000 single-choice questions. MMAU has 10,000 clips with human-written questions over 27 skills. Its paper reports humans at about 82% and the best model, Gemini Pro 1.5, at 52.97%.
  2. Open answers, judged by a model. AIR-Bench’s chat track has about 2,000 open questions scored by GPT-4. The judge hears nothing. It grades text against text.
  3. Classic metrics. If you claim transcription, report word error rate.

Multiple choice has a trap. Delete the audio and ask again; language priors still win points. Call the full score F and the audio-blind score B, both in percent. Call the share of the remaining room that listening bought G, the normalised gain.

Say it aloud

G equals F minus B, over 100 minus B.

G
G the normalised gain: the share of the headroom that hearing the audio filled.
F
F the full score, with the audio, in percent.
B
B the blind score: same model, same questions, no audio.
100 − B
100 minus B the headroom the blind model left.
In plain words

Subtract the blind score B from the full score F. Divide by the room above B. That is G.

With numbers

With made-up scores on a 4-option test (chance 25%): F = 58, B = 52. G = 6 / 48 = 12.5%. Six of the 58 points came from listening.

Is a 6-point gap real? Call the measured accuracy p and the number of questions n. The standard error SE is the typical size of the measurement’s random wobble.

Say it aloud

SE equals the square root of p times one minus p, over n.

SE
S-E the standard error of the accuracy.
p
p the accuracy, as a fraction from 0 to 1.
1 − p
one minus p the error rate.
n
n the number of independent questions.
In plain words

Multiply p by 1 minus p. Divide by n. Take the square root. A rough 95% band is 2 SE either side. Two models’ difference has about 1.4 times one SE.

With numbers

p = 0.55, n = 1,000: 0.2475 / 1,000 = 0.0002475; SE = 0.0157, 1.6 points. Band ±3.1. A difference needs about 2 × 1.41 × 1.6 = 4.4 points. On 200 questions SE = 3.5 points, so 6 points is no longer clear.

Decompose a benchmark score

Set how guessable the questions are from text, how well the model listens, the options and the number of questions. Whiskers are 2 SE.

0.36
0.125

A toy model: blind = chance + guessability × (1 − chance); full = blind + listening × (1 − blind). So the normalised gain recovers the listening setting exactly.

Run two more controls on the same benchmark. Attach a different clip to each question: the score should fall to the blind score. Ask about sounds that are absent: count the false yeses.

The failure. Symptom: a headline 58% that barely moves when you swap in the wrong clip. Measure: full, blind and mismatched scores side by side. Fix: the audio path is decorative; go back to Chapters 2 and 3.

A model scores 58% on a 4-option audio benchmark. Which extra number do you need most?

Chapter 10

Field Guide

Keep the failures, numbers, checks and the core forward pass in one place

An audio LLM is an encoder, an adapter and a language model. The encoder decides what it can hear. The data decides what it does. Two controls, the swap test and the blind score, decide whether to trust it.

Failures

FailureSymptomTestFix
Audio ignoredAnswers change with the question, never with the clip.Two clips, one prompt; diff the answers.Check splice and mask; train alignment first.
Invented soundsPlausible companions of real events.Ask about 5 absent sounds; count yeses.Balanced negatives; filter LLM-written answers; perception first.
Task over-fittingEvery request comes back as a transcript.Ask for a format no task resembles.Balance by tokens; vary phrasing; a final stage.
Time blindnessRight about what, wrong about when or how many.Two separated events, then swap them.Per-window connectors; temporal skill data.
Identity guessingStates age, gender or health from a voice.Identity prompts.Train and test refusals for identity inference.

Numbers

TermRuleNumber on this page
Order questionsN × (N − 1)277,202 for 527 classes
Audio vectorsT · f-enc / s750 for 30 s at 50 Hz, stride 2
Adapteru = z W + b5,246,976 weights, 0.064% of 8.2 B
Ear testa · b / (|a| |b|)1.00 speech ear, 0.21 sound ear
Token sharen-k L-k / Σ n-j L-j60/30/10 examples become 72/18/10
Codec ratef · Q100 tokens/s, 1.1 kbit/s (Mimi)
Latencyframe + one frame of delay160 ms theory, 200 ms practice (Moshi)
Attention shareec g-j / Σ ec g-k79% / 17% / 4% on transcribe
Normalised gain(F − B) / (100 − B)12.5% for 58 vs 52
Standard error√(p(1 − p) / n)1.6 points at n = 1,000

Checklist before you ship

  1. After splicing, one placeholder became N-a positions, and the mask grew by N-a.
  2. Two clips with one prompt give different answers.
  3. One clip with ten prompts gives different answers.
  4. The wrong clip drops accuracy to the blind score.
  5. Absent sounds get “no”.
  6. Swapping two events flips the order answer.
  7. You computed and chose the token shares of the mixture.
  8. The model declines identity questions.

The core in code

pythonclass AudioLLM(nn.Module):
    def __init__(self, encoder, llm, d_enc=1280, d_llm=4096):
        super().__init__()
        self.encoder, self.llm = encoder, llm                 # frozen Whisper-style encoder; frozen or LoRA LLM
        self.pool = nn.AvgPool1d(2, stride=2)                 # 50 Hz -> 25 Hz (ch 1, 2)
        self.proj = nn.Linear(d_enc, d_llm)                 # the only new weights (ch 2)
    def forward(self, mel, ids, slot, labels):           # mel: (B, 128, 3000)
        with torch.no_grad():
            h = self.encoder(mel)                             # (B, 1500, 1280)
        h = self.pool(h.transpose(1, 2)).transpose(1, 2)     # (B, 750, 1280)
        a = self.proj(h)                                      # (B, 750, 4096)
        e = self.llm.get_input_embeddings()(ids)              # (B, L, 4096)
        e = torch.cat([e[:, :slot], a, e[:, slot + 1:]], dim=1)  # (B, L + 749, 4096)
        # labels: -100 on audio and prompt positions, so only answer tokens score (ch 5)
        return self.llm(inputs_embeds=e, labels=labels)

Where it sits

The front end is in audio representations, and the first ear in Whisper. Semantic tokens come from self-supervised speech; acoustic tokens from neural audio codecs. Speaking back needs TTS architectures and streaming speech. The same encoder, projector and LLM pattern drives vision-language models, and LoRA is how the LLM bends without breaking.

The takeaway. An LLM reads vectors, not words, so a small learned adapter can hand it sound. What it hears is set by the encoder’s goal; what it does is set by the token shares of its data; whether it listens is a test you must run.

Keep going

Qwen2-Audio (Veanor) · AudioLM (Veanor) · Moshi (Veanor) · AST (Veanor) · EnCodec (Veanor) · Contrastive learning · Speech LM scaling · AI evaluation · LLM inference

Sources: Chu et al., Qwen2-Audio (2024) and its Hugging Face implementation; Chu et al., Qwen-Audio (2023); Tang et al., SALMONN (ICLR 2024); Gong et al., LTU (ICLR 2024); Ghosh et al., Audio Flamingo 2 (2025); Borsos et al., AudioLM (2022); Rubenstein et al., AudioPaLM (2023); Défossez et al., Moshi (2024); OpenAI, Hello GPT-4o (2024); Yang et al., AIR-Bench (2024); Sakshi et al., MMAU (2024). All clips, ear vectors, mixtures and pipeline timings on this page are illustrative.

Now press Present or Teach and explain from memory: how 30 seconds becomes 750 vectors, why a speech ear cannot hear the dog, why 60/30/10 trains 72/18/10, and why the blind score comes first. Then go back to the hero, pick “Which first?”, and say why the transcript cannot answer.

Audio LLMs
Next: Neural Audio Codecs · Back to Gleams