Tacotron

On this page 6

Tacotron is an end-to-end neural text-to-speech model that converts a sequence of characters or phonemes directly into a mel spectrogram using an encoder, an attention mechanism and an autoregressive decoder. In speech & language AI, it marked the shift from multi-stage parametric and concatenative synthesis toward a single trainable network that learns pronunciation, timing and much of the prosody from paired text and audio.

The original Tacotron appeared in 2017, and Tacotron 2 followed in 2018 by pairing a simplified spectrogram predictor with a WaveNet vocoder, which produced speech rated close to human recordings in listening tests. Within artificial intelligence, the Tacotron family became the standard sequence-to-sequence baseline for speech synthesis and shaped later systems such as FastSpeech, VITS and many voice cloning pipelines.

How Tacotron turns text into a spectrogram

Tacotron generates speech in two conceptual steps: it predicts an acoustic representation from text, and a separate vocoder renders that representation as a waveform. The model itself handles only the first step, which keeps the learning problem tractable.

The encoder turns input symbols into learned embeddings and processes them with convolutional layers and a bidirectional LSTM, producing one hidden vector per symbol. The decoder then generates the spectrogram frame by frame. At each step, the attention module decides which input symbols are relevant, so the model learns the alignment between text and audio without hand-labeled durations.

Each decoder step outputs one or more 80-band mel spectrogram frames, typically with a 12.5 ms hop, plus a stop token that signals the end of the utterance. A convolutional post-net refines the predicted frames before the vocoder uses them. The table below summarizes the building blocks in Tacotron 2.

ComponentTypical designRole
Character embedding512-dimensional vectorsRepresents input symbols
Encoder3 convolutions plus a bidirectional LSTMEncodes local and global text context
Location-sensitive attentionContent plus previous alignmentAligns text with audio frames
DecoderPre-net and 2 LSTM layersPredicts mel frames autoregressively
Post-net5 convolutional layersAdds spectral detail
VocoderWaveNet or HiFi-GANConverts mel frames to audio
Components of the Tacotron 2 architecture

Tacotron 1 and Tacotron 2 compared

The two versions share the sequence-to-sequence idea but differ in network blocks and in how audio is produced. Tacotron 1 used a CBHG module and predicted linear spectrograms that the Griffin-Lim algorithm converted into audio, which sounded noticeably buzzy. Tacotron 2 replaced that path with a neural vocoder and simpler layers.

AspectTacotron 1Tacotron 2
Encoder blocksCBHG moduleConvolutions plus BiLSTM
Attention typeContent-basedLocation-sensitive
Predicted outputLinear spectrogramMel spectrogram
Waveform generationGriffin-Lim, no trainingNeural vocoder
Perceived qualityClear but artificialNear natural in tests
Main differences between the two Tacotron versions

Later research added style tokens and reference encoders for expressive speech, and multi-speaker conditioning through speaker embeddings, which allows one Tacotron model to speak in many voices.

The move to a neural vocoder explains most of the quality gain. Griffin-Lim estimates phase iteratively from magnitude alone and leaves audible artifacts, whereas a trained vocoder learns realistic phase and fine harmonic detail from data. Because the mel spectrogram acts as a clean interface, teams can swap vocoders independently, for example replacing the slow original WaveNet with HiFi-GAN or WaveGlow for real-time output without retraining the spectrogram predictor.

Training data and practical requirements

Tacotron learns from paired text and audio, and the quality of that data limits the quality of the voice. A clean single-speaker model usually needs about 10 to 25 hours of studio-grade recordings, although fine-tuning a pretrained model can work with one to a few hours.

Preprocessing matters as much as the network. Input text requires text normalization so that numbers, dates and abbreviations are spelled out, and many systems feed phonemes from grapheme-to-phoneme conversion instead of raw characters to reduce pronunciation errors. The following table lists the requirements that most affect results.

FactorTypical requirementConsequence when neglected
Recording qualityQuiet room, consistent microphoneNoise is reproduced in output
Transcript accuracyVerbatim match to audioMispronunciations and skips
Utterance lengthMostly 1 to 10 secondsUnstable attention on long clips
Sample rate22.05 or 24 kHzMismatch with the vocoder
Training timeDays on one GPUPoor alignment if stopped early
Data and training factors that shape output quality

Strengths, limitations and failure modes

Tacotron produces highly natural prosody because it learns intonation and rhythm from data instead of hand-written rules. Its main weakness comes from the same source: autoregressive attention can fail, and inference is slower than in parallel models.

  • Attention failures: the model may repeat words, skip words or stop early, especially on long or unusual sentences.
  • Slow inference: frames are generated one after another, so latency grows with utterance length.
  • Limited control: speaking rate and emphasis are hard to adjust without extra conditioning or SSML-style features.
  • Exposure bias: training uses true previous frames, while inference uses its own predictions, which can amplify errors.

A practical diagnostic is the alignment plot, a matrix of attention weights over decoder steps and input symbols. A healthy model shows a clean diagonal line; a blurred or broken diagonal reveals that the model has not yet learned stable alignment or that the input contains problem text.

Mitigations include guided attention losses, monotonic or duration-based alignment, and moving to non-autoregressive successors. The next table compares Tacotron with neighboring approaches.

ApproachAlignment methodInference speedRobustness
Concatenative synthesisUnit selectionFastStable but less flexible
Tacotron 2Learned attentionModerateOccasional skips or repeats
FastSpeech 2Explicit durationsFast, parallelVery stable
VITSMonotonic alignment searchFast, end to endStable, single model
Tacotron compared with other speech synthesis approaches

The short version

Tacotron is a computer model that reads text aloud. It does not glue together recorded snippets. Instead, it learns how speech should look as a sound picture. A second model then turns that picture into audio you can hear.

It learns by listening to many hours of a person reading known sentences. Over time, it figures out which letters match which sounds. It also learns where to pause and how to stress words. The result can sound remarkably human.

Where it makes a difference

A regional public broadcaster wants spoken versions of its daily news articles for listeners with visual impairments. It records a professional narrator reading about 15 hours of news text in a treated studio. Engineers then fine-tune a pretrained Tacotron 2 model on these recordings and pair it with a HiFi-GAN vocoder for fast audio generation.

Before synthesis, a normalization step expands dates, currency values and abbreviations. Each article of about 600 words is converted to audio in well under a minute on one GPU. Editors listen to a sample of every batch and flag any skipped or repeated words. After launch, the service publishes dozens of audio articles per day, and listener feedback rates the voice as clear and pleasant to follow.