Skip to content

Audio–language models and voice agents: SALMONN, Qwen2-Audio, Moshi, Qwen2.5-Omni

Language models that listen: an audio encoder feeds a language model that answers in text (SALMONN, Qwen2-Audio) or speaks back (Moshi, Qwen2.5-Omni). Learn the designs, and how to test that an answer really comes from the audio.

Advanced ~15 min9 steps

What runs in CodeSplash

You will be able to

  • Describe the encoder–connector–language-model design of audio–language models
  • Explain why a fluent answer can be ungrounded, and design checks for grounding
  • Describe full-duplex dialogue over parallel token streams (Moshi)
  • Describe the Thinker–Talker split and time alignment across modalities (Qwen2.5-Omni)

Read first

01

Encoder, connector, language model

Read

An audio–language modelAudio–language modelA language model that reads encoded audio plus a text instruction and writes a text answer. A fluent answer can still be ungrounded. lets a large language modelLarge language modelA neural network trained on text to give a probability for the next token, used repeatedly to write text. take audio as input. Three parts: one or more audio encoders turn the sound into feature vectors; a connector compresses and maps them into the language model's token space; the language model reads them alongside a text instruction and writes the answer:

L=−∑ulog⁡pθ(yu∣y<u, Q(E(x)), d),\mathcal{L} = -\sum_u \log p_\theta\bigl(y_u \mid y_{<u},\, Q(E(x)),\, d\bigr),

with EE the encoder, QQ the connector, dd the instruction and yy the answer. Training stages usually align audio and text first, then tune on instructions, sometimes with preference data.

02

SALMONN: two ears

Read

SALMONN uses two encoders: Whisper's encoder for speech and BEATs for general sound. A window-level connector turns their joint features into a few query tokens per window, and a language model, adapted with low-rank updates, answers. Instructions can ask for a transcript, a caption, a question answered, or reasoning about speech and sounds together.

Its training loss is next-token cross-entropy on the answer, 0.459 on the reference's toy table. That loss says nothing about whether the answer used the audio.

Reference · AUD064 · Explained hereSALMONNAn audio-language model combining speech and general-audio encoders with a language model through a learned connector.
03

Qwen2-Audio: listen, answer in text

Read

Qwen2-Audio pairs a Whisper-style audio encoder with a large language model and supports two styles: voice chat, where the spoken audio is the instruction, and audio analysis, where a text instruction asks about a recording. Instruction tuning and a preference-optimization stage shape its behavior.

It outputs text only: hearing speech doesn't mean it can speak. In the reference's example the answer loss is 0.459, and the mean of the top token probabilities is 0.633: a measure of how sure the model is of its wording, not of whether the answer is in the audio.

Reference · AUD068 · Explained hereQwen2-AudioAn audio-language model accepting speech and other audio, with optional textual instructions, and generating text responses. It supports voice-instruction and audio-analysis interaction styles.
04

Is the answer in the audio?

Predict

Predict first

Asked "what instrument plays the melody?", an audio–language model answers "a cello, played softly" with high token probabilities. Is the answer grounded in the recording?

Yes, the answer is detailed and confidentNot yet: test with silence and swapped recordingsYes, if the token probabilities are high
Reveal

Not yet known. Language models produce plausible answers from the question alone. Test grounding: ask the same question about silence and about a recording with a different instrument, and use questions whose answers can only come from listening. Fluency and token confidence measure wording, not hearing.

05

Moshi: talking while listening

Read

Voice assistants usually take turns: recognize, think, speak. Moshi is full-duplexFull-duplex speech dialogueA speech model that listens and talks at once, modeling both sides' audio streams, so it can handle interruptions and overlap.: it models the user's audio and its own audio as two parallel streams of Mimi codec tokens, frame by frame, plus a time-aligned stream of its own text. It can be interrupted, talk over, and add "mm-hm" while listening.

A large temporal Transformer moves through time; a small depth Transformer predicts the codebooks within each frame. In the reference's example the user-stream and assistant-stream losses are 0.459 and 1.243. Latency matters as much as quality here: every frame of lookaheadStreaming latencyHow long a system waits before answering for a stretch of audio: lookahead plus chunk plus compute. Offline models see the whole file. is felt in conversation.

Reference · AUD066 · Explained hereMoshiA full-duplex speech–text dialogue model that represents incoming and outgoing audio as concurrent token streams.
06

Qwen2.5-Omni: Thinker and Talker

Read

Qwen2.5-Omni reads text, images, audio and video and answers in text and speech. A Thinker, a multimodal language model, writes the text answer; a Talker turns the Thinker's hidden states into speech tokens; a streaming decoder renders the waveform. Splitting meaning from voice lets speech start before the whole answer is written.

Audio and video must share a clock. With 80 ms audio frames, the reference's example maps video times of 0, 0.5 and 1 second to audio frames 0, 6 and 12.

Reference · AUD069 · Explained hereQwen2.5-OmniA multimodal system processing text, images, audio, and video while supporting text and speech responses. Its Thinker–Talker division connects semantic response generation with acoustic output, making it relevant to…
07

Where it stands in CodeSplash

Read
EntryIn CodeSplash
SALMONN (AUD064)Explained here; its language model's license and size rule it out
Moshi (AUD066)Explained here; a voice agent, not an analysis tool
Qwen2-Audio (AUD068)Explained here
Qwen2.5-Omni (AUD069)Explained here

CodeSplash's AI features don't take audio as input; you can transcribe recordings and analyze the text. The reference programs are component checks, verified in Python and R.

08

Check: audio–language models

Checkpoint

Check yourself

Why does SALMONN use two audio encoders?

Show the answer

Answer: b

Speech content and environmental sound need different features; the connector merges both for the language model.

Check yourself

SALMONN trains on next-token cross-entropy of answers. What does a low loss guarantee about grounding?

Show the answer

Answer: b

Grounding needs its own tests, such as silent or swapped recordings.

Check yourself

What does Qwen2-Audio output?

Show the answer

Answer: a

It listens and answers in text; speaking back needs an audio-generating system.

Check yourself

A model's mean top-token probability on an answer is high. What does that tell you?

Show the answer

Answer: b

Token confidence and grounding are different things; test grounding directly.

Check yourself

What makes Moshi full-duplex?

Show the answer

Answer: b

Parallel streams let it handle interruptions, overlap and backchannels.

Check yourself

In Moshi, what do the temporal and depth Transformers each model?

Show the answer

Answer: a

Splitting time from depth keeps the large model working at the low frame rate of the Mimi codec.

Check yourself

What does Qwen2.5-Omni's Talker do?

Show the answer

Answer: b

The Thinker decides what to say; the Talker decides how it sounds, so speech can start early.

Check yourself

With 80 ms audio frames, which audio frame (counting from 0) lines up with a video frame at 2 seconds?

Show the answer

Answer: 25

2/0.08=252 / 0.08 = 25. Shared timestamps let audio and video tokens refer to the same moment.

09

Recap

Recap
  • Audio–language models join encoders, a connector and a language model; answers are text.
  • Fluent, confident answers can be ungrounded: test with silence, swapped audio and listening-only questions.
  • Moshi models both sides of a conversation as parallel codec-token streams.
  • Qwen2.5-Omni splits meaning (Thinker) from voice (Talker). All four are explained here.

Concepts in this lesson