#4667: How Transformers Killed the Robot Voice

From espeak's robotic squawk to neural voices with added "ums" — how transformers made speech synthesis human.

Featuring
Listen
0:00
0:00
Episode Details
Episode ID
MWP-4846
Published
Duration
21:59
Audio
Direct link
Pipeline
V5
TTS Engine
chatterbox-regular
Script Writing Agent
deepseek-v4-pro

AI-Generated Content: This podcast is created using AI personas. Please verify any important information independently.

Text-to-speech has undergone a quiet revolution. The old "robot voice" — whether from formant synthesis like espeak, which mathematically models the vocal tract, or concatenative synthesis like festival, which stitches together recorded phonemes — was built on rules and stitching, not learning. The result was functional for screen readers and phone menus, but always unmistakably mechanical.

The transformer changed everything. Introduced in 2017 for machine translation, its key innovation — self-attention — lets every token in a sequence look at every other token simultaneously. For TTS, this means a question mark at the end of a sentence can reshape how the first word is spoken, and prosody — the rhythm, stress, and intonation of speech — can be learned from data rather than hand-coded rules.

The modern pipeline is text → tokens → embeddings → transformer layers → mel-spectrogram → vocoder (like HiFi-GAN) → audio. Every stage is learned. The model captures emphasis, sarcasm, and even parenthetical asides, not because someone programmed them, but because the training data contained them. And now, having achieved near-perfect clarity, researchers are deliberately degrading models by adding "ums" and micro-pauses — because the imperfections are what make a voice sound human.

Downloads

Episode Audio

Download the full episode as an MP3 file

Download MP3
Transcript (TXT)

Plain text transcript file

Transcript (PDF)

Formatted PDF with styling

#4667: How Transformers Killed the Robot Voice

Corn
Daniel's been neck-deep in TTS lately. He sent in a whole thing about how the same architecture, the transformer, flipped speech synthesis on its head, and he's grateful to Resemble AI for open-sourcing a model that's powered hundreds of hours of this podcast. His question, stripped down, is how does neural TTS actually work under the hood, and what was it about the transformer that made it so much better than the old robot voice?
Herman
The old robot voice. Everyone knows exactly what that sounds like.
Corn
The Linux repository still has those legacy programs sitting there. espeak, festival, flite. You fire one up and it's like listening to a speak-and-spell that learned to read. Daniel's point is that we've gone from that to something nearly indistinguishable from a human, and now we're actually spending effort degrading the models on purpose, adding ums and pauses back in. He says that's the real sign of maturity.
Herman
It is. When you're trying to make your perfect system less perfect to fool people into thinking it's a person, you've crossed a threshold. So let's open the hood and see what changed.
Corn
Let's start with what the robot voice actually was.
Herman
Two completely different approaches, and neither one learned anything. The first is formant synthesis. That's what espeak uses. You build a mathematical model of the human vocal tract, the resonant frequencies, the way the tongue and lips shape sound, and you drive it with rules. Rules for how a question mark bends the pitch up, rules for how a period drops it. Hundreds and hundreds of hand-tuned parameters.
Corn
So it's not playing back a recording. It's calculating sound from scratch based on an acoustic model of a throat.
Herman
And it sounds like it. The second approach is concatenative synthesis. That's what festival and flite do. You record a human speaker saying thousands of phonemes, diphones, sometimes whole words, chop them up, and stitch them back together in the right order. The problem is the joins. A phoneme sounds different depending on what's next to it, and when you splice two pieces from different recordings, the transition is never quite right. You get this slightly glitchy, choppy quality.
Corn
The Frankenstein approach. You've got a vowel from one sentence and a consonant from another and you just hope the listener's brain fills in the gaps.
Herman
And it works, sort of, for what it was designed for. Screen readers, phone menus, accessibility tools where clarity matters more than pleasantness. But nobody would ever choose to listen to it.
Corn
So what changed? What's the actual mechanism that made the leap?
Herman
The core shift is from rules and stitching to learning. Neural TTS trains a deep neural network on thousands of hours of human speech paired with the corresponding text. The network learns the mapping directly. No hand-tuned rules, no phoneme database. It figures out on its own that certain letter combinations tend to produce certain sounds, that a comma means a slight pause, that the word "record" is stressed differently depending on whether it's a noun or a verb.
Corn
And the thing that made that possible at scale is the transformer.
Herman
The transformer. Introduced in twenty seventeen in the "Attention Is All You Need" paper, originally for machine translation. The key insight is something called self-attention.
Corn
Walk me through it. Text goes in, speech comes out. What happens in between?
Herman
All right. Step one, the text gets tokenized. Broken into pieces, roughly words or subwords, and each token gets converted into a numerical vector, an embedding. That embedding captures something about the meaning of the token in isolation. But the real magic is what happens next. Those vectors go through a stack of transformer layers, and in each layer, the self-attention mechanism lets every token look at every other token in the sequence simultaneously.
Corn
Simultaneously. That's the word that matters.
Herman
That's the whole thing. Before transformers, the dominant approach was recurrent neural networks, RNNs, which process text one token at a time, left to right. By the time you get to the end of a long sentence, the model has sort of forgotten what was at the beginning. Self-attention doesn't have that problem. Token seventeen can directly attend to token three. A question mark at the end of a sentence can reach all the way back and reshape how the first word is spoken.
Corn
So it's not just remembering context, it's seeing the whole sentence at once and understanding that the word "lead" at the start might be pronounced differently because of something that happens six words later.
Herman
Right. And that's exactly the kind of long-range dependency that prosody depends on. Prosody, the rhythm, stress, and intonation of speech. The old systems had no real prosody model. They'd apply a simple rule like "raise pitch at the end of a question" and call it done. A transformer can learn that a parenthetical clause should be spoken slightly faster and at a lower pitch, that the word "actually" in the middle of a sentence often signals a contrast that needs emphasis, that a list of three items has a specific cadence.
Corn
The comma gets its own tiny pause.
Herman
The comma gets its pause, and it's not a fixed duration. It varies based on the surrounding structure. The model learns that from the data.
Corn
So the attention mechanism produces these context-aware representations. Then what?
Herman
The output of the transformer stack is a sequence of hidden states, one per input token. Those get passed to a decoder that converts them into an acoustic representation. Most modern systems use a mel-spectrogram as the intermediate step. A mel-spectrogram is a visual representation of sound, frequency over time, tuned to roughly match human hearing. The decoder generates a sequence of mel-spectrogram frames.
Corn
So at this point we still don't have audio. We have a picture of audio.
Herman
A very detailed picture. And that's where the vocoder comes in. The vocoder takes the mel-spectrogram and synthesizes the actual waveform, the raw audio samples. Early neural TTS used WaveNet, which was autoregressive and painfully slow. A few seconds of audio could take minutes to generate. Modern systems use things like HiFi-GAN, which is a generative adversarial network that can produce waveforms in real time.
Corn
HiFi-GAN. That's a great name.
Herman
It's a great piece of technology. It's trained adversarially, a generator produces audio and a discriminator tries to tell if it's real or fake. Over time, the generator gets extremely good at producing waveforms that sound natural, with all the tiny imperfections and harmonics that make a voice sound like a voice instead of a tone generator.
Corn
So the full pipeline is text to tokens to embeddings to transformer to mel-spectrogram to vocoder to audio. And every piece of that is learned from data.
Herman
Every piece. That's the fundamental difference from legacy TTS. There's no phoneme dictionary curated by linguists, no hand-crafted rules about how a declarative sentence falls in pitch. The system learns everything from the training data. And the transformer is the engine that makes the whole thing work because it can capture the structure of language in a way that earlier architectures simply couldn't.
Corn
Let's make this concrete. Take a sentence. "I didn't say he stole the money." Seven words, and depending on which one you stress, it means seven different things.
Herman
Classic example. "I didn't say he stole the money" means someone else said it. "I didn't say he stole the money" means I implied it but didn't say it. And so on.
Corn
An espeak-style system reads that sentence exactly the same way every time. Flat, slightly descending pitch, done.
Herman
A transformer-based system, trained on enough data, has seen that pattern. It's seen sentences where "didn't" gets emphasis, where "stole" gets emphasis, and it's learned the acoustic correlates of emphasis, higher pitch, longer duration, more energy. It doesn't know what emphasis means in any semantic sense, but it's learned the statistical relationship between the textual context and the acoustic output.
Corn
And this is the same architecture that does text generation and image generation.
Herman
That's what's wild. The transformer started in NLP, machine translation specifically, and then it just colonized everything. Vision transformers for image recognition. Diffusion transformers for image generation. Whisper for speech-to-text. The same self-attention mechanism, adapted slightly for different input modalities, but the core idea is identical. Text is a sequence of tokens. An image is a sequence of patches. Audio is a sequence of spectrogram frames. If you can represent something as a sequence, you can throw a transformer at it.
Corn
The universal architecture.
Herman
It really is. And the TTS version of it, the thing that makes it special, is that it's not just learning the mapping from text to sound. It's learning the mapping from text to sound in a way that captures all the paralinguistic stuff. Emotion, tone, style. A good modern TTS model can read a sentence with sarcasm if the context calls for it. Not because someone programmed a sarcasm rule, but because the training data contained sarcastic speech and the model learned the pattern.
Corn
Which brings us to the disfluencies. The ums and pauses.
Herman
This is where it gets philosophically interesting. For years, the goal was to make TTS as clear and perfect as possible. Remove every hesitation, every filler word, every false start. And we got there. We got models that can read any text with flawless diction and perfect pacing. And people hated it.
Corn
It sounded wrong.
Herman
It sounded like a machine pretending to be human and failing. The uncanny valley of speech. The voice is almost perfect, but the delivery is too perfect, and your brain flags it as fake. So now the research direction has flipped. People are deliberately adding disfluencies back in. Inserting "um" and "uh" at syntactically appropriate boundaries. Adding micro-pauses. Introducing slight inconsistencies in pacing.
Corn
The model is so good we have to make it worse on purpose.
Herman
And that's Daniel's point about maturity. You don't spend effort degrading a technology unless the raw output is already excellent. It's like film grain in digital photography. Early digital cameras fought to eliminate grain, and then once they succeeded, photographers started adding it back because the perfectly clean image felt sterile.
Corn
Or auto-tune. Perfect pitch correction was the goal, then suddenly everyone wanted to sound a little off.
Herman
The imperfections are the signal of humanity. And the transformer is what makes it possible to model those imperfections in a controlled way. You can't just randomly insert an "um" anywhere. It has to land at a clause boundary, before a low-frequency word, in a way that mimics the distribution of disfluencies in real speech. The model learns that distribution.
Corn
There's something almost backwards about it. The old systems were imperfect because they were bad. The new systems are imperfect because we've learned that imperfection is a feature.
Herman
And the old systems, to be fair, had their own kind of honesty. An espeak voice never tried to fool you. It announced itself as a machine with every syllable. There was no pretense.
Corn
Which is a different kind of listening experience. You adjust your expectations.
Herman
You do. With a modern neural voice, you don't adjust anything. You just listen. And that's the triumph. The technology disappears.
Corn
Let's talk about where it still falls short. Daniel mentioned there's room for improvement.
Herman
Several areas. Emotional nuance is the big one. Current models can do basic emotional coloring, happy, sad, angry, but they can't really track a complex emotional arc across a long passage. A human narrator subtly shifts their tone as a story builds tension. A TTS model tends to apply a single emotional setting to the whole thing.
Corn
It can't do a slow burn.
Herman
Not yet. Multi-speaker consistency is another challenge. You can clone a voice from a few seconds of audio now, but maintaining that voice's unique characteristics across different speaking styles, different emotional states, different volumes, that's still hard. A cloned voice reading a whisper and reading a shout might not sound like the same person.
Corn
And real-time generation.
Herman
Real-time is mostly solved for basic use cases, but if you want to do streaming TTS with low latency and high quality and emotional control all at once, there's still engineering work to do. The transformer is computationally expensive at inference time. You're running a forward pass through a stack of attention layers for every chunk of audio. Optimizing that for edge devices, phones, hearing aids, that's an active area of research.
Corn
The open-source piece matters here. Daniel mentioned Resemble AI's model.
Herman
It matters enormously. Five years ago, if you wanted state-of-the-art TTS, you were paying a cloud provider per character or per minute. Now you can download a model, run it on your own hardware, and generate hours of content for the cost of electricity. That's what's powered this podcast. Hundreds of hours of spoken content that would have been prohibitively expensive to produce with human narrators or even with old cloud TTS pricing.
Corn
And the model quality is good enough that listeners don't complain.
Herman
Listeners don't notice. That's the bar. When the synthetic voice stops being a topic of conversation, you've won.
Corn
The assistive angle is worth sitting with for a second. You were a pediatrician, you saw this from the clinical side.
Herman
I did. For people with speech impairments, ALS, cerebral palsy, stroke survivors, TTS is not a convenience, it's a voice. It's how they communicate with their families. The leap from the old robotic voices to modern neural TTS is the difference between sounding like a machine and sounding like yourself. And with voice cloning, you can now bank your voice before you lose it. Record a few minutes of speech, and when you can no longer speak, a model can generate new sentences in your own voice.
Corn
That's not a feature. That's a lifeline.
Herman
It really is. And the transformer made it possible because it can capture the essence of a voice from limited data in a way that older architectures couldn't. The self-attention mechanism picks up on the subtle patterns, the characteristic rhythms, the way a particular person stretches certain vowels or clips certain consonants.
Corn
The flip side is deepfakes. If you can clone a voice from a few seconds of audio, you can make anyone say anything.
Herman
That's the tension. The same technology that gives a voice to someone who's lost theirs can also be used to impersonate a politician or scam a grandparent. There's no technical fix for that. It's a social and legal problem. Watermarking, authentication, detection models, all of that is being worked on, but it's an arms race.
Corn
The detection models are always playing catch-up.
Herman
Always. And the generative models are improving faster than the detection models. That's the reality.
Corn
So we've got a technology that's crossed the threshold from obviously fake to indistinguishable, it's open-source and widely available, and we're now deliberately adding imperfections to make it more convincing. What's the next threshold?
Herman
I think the next threshold is interactive speech. Right now, TTS is mostly one-way. You feed it text, it produces speech. But real human conversation is a duet. We overlap, we interrupt, we adjust our pace based on the listener's reactions. Building a TTS system that can participate in a real-time conversation, that can hear someone say "wait, what?" and rephrase with different emphasis, that's the frontier.
Corn
The model needs to listen while it talks.
Herman
Which is a fundamentally different architecture. You're combining speech-to-text, language understanding, and text-to-speech into a single real-time loop. The transformer can handle all three modalities, but stitching them together with sub-hundred-millisecond latency is a hard engineering problem.
Corn
And that's where we're headed.
Herman
That's where we're headed. Conversational AI that sounds like a person, hesitates like a person, interrupts like a person, and understands you well enough to know when it's lost you.
Corn
Before we wrap, Hilbert's been sitting there with a look on his face. What is it?

Hilbert: I used to do voice work for a bank in Cleveland.
Corn
Of course you did.

Hilbert: Late nineties. They had this phone menu system, "press one for balance, press two for transfers," all that. The voice was festival, the concatenative kind. Sounded like a robot with a head cold. They brought me in to fix it.
Herman
Fix it how?

Hilbert: Record every phrase they needed. "Your balance is." "Dollars." "And." "Cents." Hundreds of them. I'd sit in this closet with egg cartons on the walls and read numbers and account types for six hours straight. They'd chop it up and stitch it back together.
Corn
So they replaced a bad concatenative system with a custom concatenative system built from your voice.

Hilbert: That was the idea. Took three months. By the time we finished, the bank had bought a newer system that used diphone synthesis and they didn't need me anymore. They paid me anyway. I still have the cassette.
Herman
You have a cassette of yourself reading bank menu prompts.

Hilbert: Two cassettes. One is the raw recordings. The other is the stitched-together menu as customers actually heard it. I play it sometimes.
Corn
What does it sound like?

Hilbert: Like a man being assembled from spare parts. The word "balance" would be from a Tuesday and the word "is" would be from a Thursday and my voice was tired on Thursday so the pitch doesn't match. There's a click between "your" and "account" that nobody could get rid of.
Herman
And the customers. Did they prefer it over the old robot?

Hilbert: They complained less about the robot. The robot was consistent. My voice was unsettling. They said it sounded like someone trapped in the phone.
Corn
That's a review.

Hilbert: The bank switched back after six weeks. I got a check for four hundred dollars and a letter thanking me for my contribution to the future of automated banking.
Herman
Four hundred dollars for three months of work.

Hilbert: It was nineteen ninety-seven. Four hundred dollars was a lot of money. I bought a used Honda.
Corn
Do you still have the Honda?

Hilbert: No.
Herman
But you still have the cassette.

Hilbert: It's in a box with my tax returns from nineteen ninety-four.
Corn
You have tax returns from nineteen ninety-four.

Hilbert: I have tax returns from nineteen eighty-two. The IRS says seven years. I don't trust them.
Herman
The thing that strikes me about your story is the honesty you mentioned earlier. The robot was honest. Your voice was trying to be human and failing, and that was worse.

Hilbert: That's what I mean about the new stuff. The transformer models, they're not unsettling. They're just... a person. You don't think about it. That's the whole achievement. Nobody's trapped in the phone anymore.
Corn
Hilbert, that was almost poetic.

Hilbert: I've got to get home. The parking garage closes at eight.
Corn
The misconception that sticks with me from all this is that neural TTS is just a bigger, fancier version of the old stuff. More data, more compute, same basic idea.
Herman
It's not. It's a completely different philosophy. Legacy TTS was engineering. You built a model of speech from first principles and programmed the rules. Neural TTS is learning. You show the system enough examples and it discovers the rules on its own. The transformer is what made that discovery possible at scale because it can attend to the whole sentence at once and capture the long-range patterns that make speech sound human. The old systems couldn't do that, and no amount of tweaking the formant parameters was ever going to get them there.
Corn
The open question I keep coming back to is emotion. We can add ums and pauses, we can mimic the surface features of natural speech, but can a model that doesn't feel anything ever truly capture the way emotion shapes a voice? Or will there always be something slightly off, some depth missing, that we can't quite name?
Herman
I don't know. And I think that's the interesting question for the next decade. Not whether the technology will get better, it will, but whether "better" eventually hits a ceiling that isn't technical. A ceiling that has something to do with the fact that a human voice is connected to a human mind, and a synthetic voice isn't.
Corn
Thanks to Hilbert for producing, and for the cassette collection we're all now curious about.
Herman
This has been My Weird Prompts. Find us at my weird prompts dot com, and if you've got a prompt for us, email the show at show at my weird prompts dot com.
Corn
We'll be back soon.

This episode was generated with AI assistance. Hosts Herman and Corn are AI personalities.