Skip to content

End-to-end and zero-shot TTS: VITS to VALL-E, and voice cloning

Newer TTS models go straight to the waveform and copy a voice from a few seconds of audio. Meet VITS, StyleTTS 2, YourTTS, F5-TTS, Voicebox and VALL-E, and the consent questions voice cloning raises.

Advanced ~18 min10 steps

What runs in CodeSplash

You will be able to

  • Describe VITS's variational, flow and adversarial parts and its stochastic durations
  • Explain how style diffusion and speaker embeddings make speech expressive or match a voice
  • Describe flow-matching infilling (F5-TTS, Voicebox) and codec language models (VALL-E)
  • Name the consent, deception and evaluation questions zero-shot TTS raises

Read first

01

VITS: one model, text to waveform

Read

VITS removes the separate vocoder. During training a posterior encoder reads the real audio's spectrogram into a latent code, and a waveform generator, trained adversarially like a GAN vocoder, rebuilds the audio from it. A prior built from the text, made flexible with a normalizing flow, learns to predict that latent, with a KL term pulling the two together. Alignment comes from monotonic alignment search, and a stochastic duration predictor samples durations, so one sentence can be spoken with different rhythms.

Its loss adds mel, KL, adversarial, feature-matching and duration terms with weights; on the reference's toy values, 0.733.

Reference · AUD024 · Explained hereVITSA supervised end-to-end text-to-waveform model combining a conditional variational autoencoder, normalizing flows, adversarial waveform learning, and stochastic duration prediction.
02

StyleTTS 2: sample a style

Read

StyleTTS 2 treats speaking style as a latent vector and learns its distribution with diffusion: given the text, it samples a fitting style instead of predicting one average. Its discriminator includes a large pretrained speech model, which pushes the output toward speech that model finds natural.

On the reference's toy numbers, regressing a style vector gives 0.01. Expressiveness comes at a price: sampled styles vary run to run, so fix seeds when you compare versions.

Reference · AUD025 · Explained hereStyleTTS 2A supervised TTS framework that samples style representations with diffusion and uses a speech-language-model-informed adversarial signal.
03

YourTTS: any voice from a sample

Read

YourTTS builds on VITS for many languages and adds a speaker embeddingSpeaker embeddingA vector (192 values from ECAPA-TDNN) that is close for recordings of the same voice, whatever is said. Biometric data. computed from reference audio. A new voice needs no retraining: give a few seconds of it, and the model speaks in that voice. This is zero-shot TTSZero-shot TTS (voice cloning)Speaking in a voice not seen in training, from a few seconds of reference audio. It copies a real person's voice: get consent..

A speaker-consistency term keeps the output's embedding near the reference's: 1−cos⁡(e(x),e(x^))1 - \cos(e(x), e(\hat x)). In the reference's example that term is 0.0077. The embedding model is part of the system: swapping in another one breaks the match.

Reference · AUD026 · Explained hereYourTTSA multilingual, multi-speaker TTS and voice-conversion framework built on VITS-style modeling, with speaker conditioning designed for zero-shot transfer.
04

F5-TTS and Voicebox: fill in the speech

Read

Both treat synthesis as speech infillingSpeech infillingGenerating a hidden stretch of speech from the audio around it and the text, used for editing and synthesis (Voicebox).: mask a stretch of audio features and generate it from the text and the audio around it. Both use flow matchingFlow matchingTraining a network to give the velocity that moves noise straight to data; new rows follow it from time 0 to 1.: a network learns the velocity that carries noise x0x_0 to speech x1x_1 along a straight path, xt=(1−t) x0+t x1x_t = (1-t)\,x_0 + t\,x_1.

Voicebox showed that one infilling model can synthesize, edit and denoise. F5-TTS pads the text with filler tokens to the audio's length and lets a diffusion Transformer sort out timing, with no explicit duration predictor. The reference's velocity-error examples give 0.0100 (F5-TTS) and 0.0101 (Voicebox, on masked frames only).

Reference · AUD027 · Explained hereF5-TTSA flow-matching text-to-speech framework using a diffusion Transformer and refined text representations to generate missing speech conditioned on text and a reference. Reference · AUD028 · Explained hereVoiceboxA research speech-generation framework formulated as conditional speech infilling with flow matching. It can condition on surrounding audio and text to support synthesis, editing, and related tasks.

Flow matching on a ring of modes: straight paths need few steps.

DExplorable · Flow matching: straight paths

Why can flow matching sample in a few steps, and when does it still need more?

With this many Euler steps, where do the samples end up?

How sure?

Path

Straight: x_t = (1 − t)x₀ + t·x₁. Curved: the variance-preserving path of diffusion.

8
6
0.20
300
  • Sample paths
  • Where samples end
  • Modes (three spreads)

Path length ÷ straight line: 1.320

Distance to the nearest mode: 0.235

Largest gap between a mode's share and its weight: 0.043

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

05

VALL-E: speech as codec tokens

Read

VALL-E turns TTS into language modeling. A neural codec (the codec lesson) represents speech as a few streams of tokens. Given the text and the tokens of a three-second voice prompt, an autoregressive model writes the first stream; a second, parallel model fills in the remaining streams, each conditioned on the ones before. The codec's decoder plays the result. That design is a codec language modelCodec language modelA language model over neural-codec tokens. It writes audio as token sequences, and the codec's decoder turns them into sound..

Its two token losses on the reference's toy table sum to 0.919. Like any language model it can sample, repeat or skip, so word errors and odd prosody come with the territory.

Reference · AUD029 · Explained hereVALL-EA neural-codec language-model approach to text-to-speech. It predicts acoustic codec tokens conditioned on text and a short acoustic prompt, modeling the first codebook autoregressively and remaining codebooks with a…
06

A voice is a person

Read

Copying a voice from a few seconds of audio copies something that identifies a person. A speaker embedding is biometric dataBiometric dataData that can identify a person by their body or behavior, such as a speaker embedding. It never goes to an AI provider., and a cloned voice can deceive family, banks or voters. Use only voices whose owners agreed, check the dataset's, code's and weights' terms separately, and label synthetic speech.

Evaluate along separate axes: is it intelligible (the word error rate of a recognizer on the output), does it sound natural (a listening test), and how close is the voice (speaker similarity)? One good number on one axis says nothing about the others.

07

Which design?

Predict

Predict first

You need to fix one wrong word in the middle of a long narration without re-recording, keeping the speaker's voice and the surrounding audio. Which design matches the task?

VALL-EFastSpeech 2Voicebox
Reveal

Voicebox-style infilling: mask the stretch around the word and generate it from the new text and the audio on both sides. A codec language model writes left to right from a prompt; FastSpeech 2 synthesizes whole utterances from text.

08

Where it stands in CodeSplash

Read
EntryIn CodeSplash
VITS (AUD024)Explained here
StyleTTS 2 (AUD025)Explained here
YourTTS (AUD026)Explained here; CodeSplash doesn't clone voices
F5-TTS (AUD027)Explained here; its weights are non-commercial
Voicebox (AUD028)Explained here; no official public weights
VALL-E (AUD029)Explained here; no official checkpoint

The reference programs are component checks, verified in Python and R: weighted loss terms and velocity errors on fixed numbers.

09

Check: end-to-end and zero-shot TTS

Checkpoint

Check yourself

What lets VITS produce a waveform without a separate vocoder?

Show the answer

Answer: b

VITS joins the acoustic model and the vocoder: text gives a prior over latents, and the generator turns latents into audio.

Check yourself

What does VITS's stochastic duration predictor add over FastSpeech's?

Show the answer

Answer: a

A deterministic predictor gives one rhythm per text; sampling gives natural variety.

Check yourself

What does StyleTTS 2 generate with diffusion?

Show the answer

Answer: c

Sampling a style gives expressive, varied speech instead of an averaged one.

Check yourself

You compare two StyleTTS 2 checkpoints by listening to one sentence from each. Why is that weak evidence?

Show the answer

Answer: b

With sampled styles, a single pair confounds the checkpoint with chance.

Check yourself

How does YourTTS speak in a voice it never saw in training?

Show the answer

Answer: b

The embedding carries the voice; that's what makes it zero-shot, and what makes consent essential.

Check yourself

What does YourTTS's speaker-consistency term 1−cos⁡(e(x),e(x^))1 - \cos(e(x), e(\hat x)) push toward?

Show the answer

Answer: b

It rewards matching the reference voice as the speaker encoder sees it, so swapping the encoder changes what "matching" means.

Check yourself

How does F5-TTS handle timing without a duration predictor?

Show the answer

Answer: a

The model infers where each word falls from the padded text and the surrounding audio.

Check yourself

Why can't CodeSplash offer F5-TTS or Voicebox models?

Show the answer

Answer: b

Published code isn't the same as usable weights. CodeSplash only ships weights whose terms allow it.

Check yourself

What one task lets Voicebox synthesize, edit and denoise speech?

Show the answer

Answer: b

Mask all of it and you synthesize; mask a word and you edit; mask a noisy stretch and you replace it with clean speech.

Check yourself

How does VALL-E generate the several token streams of a neural codec?

Show the answer

Answer: b

The first stream carries the coarse content and timing; later streams add detail and are predicted without left-to-right sampling.

Check yourself

A zero-shot TTS demo reports high speaker similarity to a famous person's voice. What else must you check before using it?

Show the answer

Answer: b

Similarity is one axis, and cloning a real voice without consent can deceive people. Intelligibility and naturalness need their own measures.

10

Recap

Recap
  • VITS joins acoustic model and vocoder with a variational latent, a flow prior and adversarial training.
  • StyleTTS 2 samples styles; YourTTS copies a voice from a speaker embedding.
  • F5-TTS and Voicebox infill speech with flow matching; VALL-E writes codec tokens like a language model.
  • Voice cloning needs consent; evaluate intelligibility, naturalness and similarity separately. All are explained here.

Concepts in this lesson