What is a Spoken Language Model?

Authors
What is a Spoken Language Model?

A Spoken Language Model is an AI model that learns language directly from speech audio, so that it can listen to speech and continue it or reply in speech, without needing to turn the speech into text first.

In this blog, we will learn about what a Spoken Language Model is. We will also see how it differs from a text LLM, how speech is turned into speech tokens, how the model predicts the next speech token and turns it back into sound, the main types of Spoken Language Models, and where they work well and where they struggle.

We will cover the following:

  • What is a Spoken Language Model?
  • The problem with turning speech into text first
  • How a Spoken Language Model works
  • Turning speech into speech tokens
  • Predicting the next speech token
  • Turning speech tokens back into sound
  • Types of Spoken Language Models
  • Text LLM vs Spoken Language Model
  • Where Spoken Language Models work well and where they struggle

I am Amit Shekhar, Founder @ Outcome School, I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.

I teach AI and Machine Learning at Outcome School.

Let's get started.

What is a Spoken Language Model?

A Spoken Language Model (SLM) is a model that learns the patterns of a language from speech audio and can predict what comes next in speech, the same way a text LLM predicts what comes next in text.

A text LLM (Large Language Model) reads text as tokens, where a token is a word or a part of a word. During training, the LLM sees trillions of tokens and learns one job: given the tokens so far, predict the next token.

For example, if the text is "The cat sat on the", the LLM predicts "mat" as a likely next token.

A Spoken Language Model does the same job, but on speech. Instead of text tokens, it works with speech tokens. A speech token is a small piece of sound turned into a number. Given the speech tokens so far, the model predicts the next speech token.

Means, if we speak "The cat sat on the" into a Spoken Language Model, it can continue the sentence in a voice, and we hear "mat" as sound. No text is written anywhere in between.

A text LLM learns language from reading. A Spoken Language Model learns language from listening.

Now, the question is: why do we even need this when we already have very good text LLMs? Let's understand that.

The problem with turning speech into text first

Let's say we want to build a voice assistant. The common way to build it is a pipeline of three models, as below:

+----------------------+
|  User speaks         |
+----------------------+
           ↓
+----------------------+
|  Speech-to-Text      |
|  (audio to text)     |
+----------------------+
           ↓
+----------------------+
|  Text LLM            |
|  (text to text)      |
+----------------------+
           ↓
+----------------------+
|  Text-to-Speech      |
|  (text to audio)     |
+----------------------+
           ↓
+----------------------+
|  User hears reply    |
+----------------------+

Here, the speech is first written down as text, the LLM reads the text and writes a reply, and then the reply is spoken out loud.

This works, and many products use it today. But the following issues arise.

Problem 1: We lose everything that is not words. When we speak, we share much more than words. We share our tone, our emotion, our speed, our pauses, our laughter, and our stress on certain words. Consider the sentence "I am fine." Said in a happy voice, it means we are fine. Said in a sad, slow voice, it means we are not fine at all. Once the speech is written as text, both become the same "I am fine." The LLM never hears the difference.

Problem 2: Delay. Each model has to wait for the previous one. The full sentence is often converted to text first, then the LLM writes the reply, then the voice starts speaking. These waits add up, and the conversation feels slow.

Problem 3: Unnatural turn-taking. In a real conversation, we say "hmm", "yeah", and we sometimes interrupt each other. A pipeline that waits for text at every step finds this hard to handle.

So, the question is: can a model understand and produce speech directly, without the text step in the middle? The answer is yes. Here comes the Spoken Language Model into the picture.

Planning your move into AI?

No matter which tech domain you work in today, with your effort, you can transition to these roles:

  • AI Engineer
  • Forward Deployed Engineer
  • AI Agent Engineer
  • Harness Engineer
  • Voice AI Engineer
  • AI Architect
  • LLM Engineer
  • LLM Inference Engineer
  • Gen AI Engineer
  • MLOps Engineer
  • ML Engineer
  • Deep Learning Engineer

Our AI and Machine Learning Program at Outcome School takes you there.

How a Spoken Language Model works

A Spoken Language Model has three parts working together, as below:

+---------------------------+
|  Input speech (audio)     |
+---------------------------+
             ↓
+---------------------------+
|  Speech Tokenizer         |
|  audio to speech tokens   |
+---------------------------+
             ↓
+---------------------------+
|  Language Model           |
|  predicts next token      |
+---------------------------+
             ↓
+---------------------------+
|  Speech Decoder           |
|  speech tokens to audio   |
+---------------------------+
             ↓
+---------------------------+
|  Output speech (audio)    |
+---------------------------+
  • Speech Tokenizer: It listens to the audio and turns it into a sequence of speech tokens.
  • Language Model: It reads the speech tokens and predicts the next speech tokens, one after another.
  • Speech Decoder: It turns the predicted speech tokens back into sound that we can hear.

We will learn about each of them in detail. Let's start with the first step.

Turning speech into speech tokens

A computer stores sound as a long list of numbers called samples. Each sample tells how loud the sound wave is at one tiny moment. Speech models often use audio with 16,000 samples for every second.

That is far too many numbers for a language model to work with directly. One second of speech holds only two or three words, but it is stored as 16,000 numbers. So, we need a way to make speech short and meaningful, like text tokens.

The best way to learn this is by taking an example.

Suppose we have a big box of crayons with only 100 colors. Now, we look at a photo, and for every small patch of the photo, we pick the closest crayon color and write down its number. In the end, the photo becomes a short list of crayon numbers.

The speech tokenizer does the same thing with sound. It works as below:

Step 1: The audio is cut into tiny slices of time, for example 20 milliseconds each. That gives about 50 slices for every second.

Step 2: A trained speech model, for example HuBERT, listens to each slice and describes it as a list of numbers. This model has learned which sounds are important by listening to thousands of hours of speech.

Step 3: These descriptions are grouped into a fixed number of groups, for example 100 groups, using a method called k-means clustering. Each group is like one crayon color. Similar sounds land in the same group.

Step 4: Each slice is replaced by the number of its group.

So, a short piece of speech becomes something like below:

[23, 23, 87, 87, 87, 5, 61, 61, 14, ...]

Here, each number is one speech token. The same number appearing again and again means the same sound is held for a few slices.

These speech tokens roughly match the small sounds of a language, like the "k" sound or the "a" sound. The best part is that no human had to label anything. These sound groups are discovered automatically, just from a lot of unlabeled speech.

Note: There are two kinds of speech tokens that we must know:

  • Semantic tokens capture mostly what is being said, the sounds that carry meaning. The tokens we just made with HuBERT and k-means are of this kind.
  • Acoustic tokens capture how it sounds, the voice, the tone, and the quality of the recording. They come from a neural audio codec, a model that compresses audio into tokens and can rebuild it back.

Many Spoken Language Models use semantic tokens to understand the content and acoustic tokens to produce a natural-sounding voice.

Now, our speech has become a list of tokens. It is time for the language model.

Predicting the next speech token

Now, the speech tokens look just like text tokens to a language model. They are a list of numbers, one after another. So, we can use the same kind of model that powers text LLMs, a Transformer, and train it with the same job: predict the next token.

During training, the model sees thousands of hours of speech as speech tokens. For example, it sees:

[23, 23, 87, 87, 87, 5, 61, 61, ?]

And it learns to predict what comes in the place of ?. When it predicts wrong, its parameters get updated a little. After millions of such examples, it learns which sounds usually follow which sounds.

To predict the next sound well, the model has to learn much more than sounds. It has to learn:

  • Which sounds form words.
  • Which words usually come together.
  • How sentences are built.
  • How a speaker's tone rises at a question, when the tokens keep tone information.
  • Where people usually pause.

All of this is learned from listening only. This is similar to how a small child learns to speak. A child learns words and grammar by hearing people talk, long before learning to read.

Once trained, the model generates speech one token at a time, as below:

Step 1: It takes the speech tokens of what we said.

Step 2: It predicts the next speech token.

Step 3: It adds that token to the list.

Step 4: It repeats this again and again, until the reply is complete.

This is how the model continues or replies to our speech, entirely in speech tokens.

A quick note for you

No matter which tech domain you work in, get familiar with these topics:

  • LLM
  • RAG
  • MCP
  • Agent
  • Fine-tuning
  • Quantization

We put it all together in one video:

AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, and Quantization

No need to stop reading - bookmark it and watch later when you get time. Future you will thank you.

Now, let's get back to the topic.

Turning speech tokens back into sound

Now, we have a list of predicted speech tokens. But we cannot hear numbers. We need to turn them back into a sound wave.

This is the job of the Speech Decoder. It is a separate model trained to do the reverse of the tokenizer. It takes speech tokens and produces audio samples that our speakers can play.

If the tokens are semantic tokens, the decoder has to fill in the voice by itself, because semantic tokens carry mostly the content. It often speaks in one fixed voice that it was trained on. If the tokens are acoustic tokens from a neural audio codec, the codec's own decoder rebuilds the sound, including the voice and tone.

This is how the complete loop works: speech goes in, becomes tokens, the model predicts new tokens, and the new tokens come out as speech.

Now, let's see the different types of Spoken Language Models.

Types of Spoken Language Models

Spoken Language Models can be grouped into three types based on how much they depend on text.

Type 1: Pure speech language models. These learn only from speech tokens. No text is used at all. One of the first well-known examples is GSLM (Generative Spoken Language Modeling) from Meta AI in 2021. It showed that a model can learn to continue speech in a meaningful way from raw audio alone.

  • Advantage: It can work for languages that have very less written text, because it needs only recordings.
  • Disadvantage: Its replies often sound natural but carry less meaning. It is weaker at knowledge and reasoning than a text LLM, because there is far less speech data than text data, and each speech token carries very less meaning on its own.

Type 2: Speech and text language models. These learn from both speech tokens and text tokens together, often mixed in the same sequence. A common approach is to start from a text LLM that already knows a lot, and then teach it speech tokens. This way, the model gets the knowledge of the text LLM and the ability to hear and speak. Some of these models even produce text and speech side by side, where the text is generated alongside the speech and guides what the speech says.

  • Advantage: It is much better at meaning, knowledge, and reasoning.
  • Disadvantage: It is built on a large text LLM, so it is bigger and costs more to train and run.

Type 3: Speech-aware text language models. These take speech as input but reply in text. They are useful for understanding speech, answering questions about audio, and etc. Some people do not call them Spoken Language Models in the strict sense, because they do not produce speech.

One more advanced idea is full-duplex models. Here, the model listens and speaks at the same time, just like humans in a real conversation. It can say "hmm" while we talk, and it can stop when we interrupt. Moshi from Kyutai is one example of a full-duplex Spoken Language Model.

If we want to go deep into LLM Fundamentals, Transformer Architecture, and Multimodal AI, and build a Large Language Model (LLM) from scratch, we can check out our AI and Machine Learning Program at Outcome School.

Text LLM vs Spoken Language Model

Let me tabulate the differences between a text LLM and a Spoken Language Model for your better understanding.

PointText LLMSpoken Language Model
Learns fromTextSpeech audio, sometimes with text
TokenA piece of a wordA short slice of sound
Time slices per secondNot tied to timeOften about 12 to 50, based on tokenizer
Hears tone and emotionNoYes, if its tokens keep that information
Replies inTextSpeech
Knowledge and reasoningStrongWeaker, unless built on top of a text LLM
Training data availableTrillions of tokensFar less

Here, we can see that a Spoken Language Model is not a replacement for a text LLM. It brings the ability to hear and speak naturally, and many of the strongest Spoken Language Models are built on top of a text LLM.

Stay updated: Subscribe to our newsletter to get our latest AI and Machine Learning blogs straight to your inbox.

Where Spoken Language Models work well and where they struggle

They work well for:

  • Natural voice conversations with low delay.
  • Understanding emotion, tone, and intent from how something is said.
  • Replying with the right emotion in the voice.
  • Languages with very less written text but lots of recordings.
  • Handling natural turn-taking like "hmm", pauses, and interruptions.

They struggle with:

  • Long sequences: Speech produces many more tokens than text for the same sentence. One sentence can become hundreds of speech tokens. This makes long conversations expensive and harder for the model to remember.
  • Meaning and reasoning: Pure speech models know less about the world than text LLMs, so their long replies can drift away from the topic.
  • Speaker and noise variety: Different voices, accents, and background noise make the same word look like different tokens, which makes learning harder.
  • Evaluation: It is harder to measure how good a spoken reply is, because we must judge both what was said and how it was said.

Now we must have understood what a Spoken Language Model is, how it turns speech into tokens, predicts the next token, turns the tokens back into sound, and where it works well and where it struggles.

Frequently Asked Questions

Does a Spoken Language Model need text to learn language?

No. A pure speech language model learns only from speech tokens, and no text is used at all. GSLM from Meta AI showed in 2021 that a model can learn to continue speech in a meaningful way from raw audio alone. Many stronger models still mix in text to get better knowledge and reasoning.

What is the difference between semantic tokens and acoustic tokens?

Semantic tokens capture mostly what is being said, the sounds that carry meaning, and can be made with HuBERT and k-means clustering. Acoustic tokens capture how it sounds, like the voice, the tone, and the recording quality, and they come from a neural audio codec. Many Spoken Language Models use both.

Does a Spoken Language Model replace a text LLM?

No. A Spoken Language Model is not a replacement for a text LLM. It brings the ability to hear and speak naturally, but it is weaker at knowledge and reasoning unless it is built on top of a text LLM. Many of the strongest Spoken Language Models are built on top of a text LLM.

Why are long conversations hard for a Spoken Language Model?

Long conversations are hard because speech produces many more tokens than text for the same sentence. One sentence can become hundreds of speech tokens. This makes long conversations expensive and harder for the model to remember.

What is a full-duplex Spoken Language Model?

A full-duplex Spoken Language Model listens and speaks at the same time, just like humans in a real conversation. It can say "hmm" while we talk, and it can stop when we interrupt. Moshi from Kyutai is one example of a full-duplex Spoken Language Model.

That's it for now.

Thanks

Amit Shekhar
Founder @ Outcome School

You can connect with me on:

Follow Outcome School on:

Read all of our high-quality blogs here.