TL;DR
Tacotron 2 is a text-to-speech system built entirely from neural networks trained on pairs of text and recorded speech. Its first network reads characters and predicts a mel spectrogram, a compact picture of the sound with one column every 12.5 milliseconds. Its second network, a modified WaveNet, turns that picture into a waveform. Human raters scored its speech 4.53 out of 5, close to the 4.58 they gave recorded human speech.
Builds on: WaveNet, Encoder-Decoder Architecture, Attention Mechanism, Mel Spectrogram, Teacher Forcing · Leads to: HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech
Why it mattered
Before this paper, the most natural-sounding systems, WaveNet among them, needed hand-built inputs: linguistic features, pronunciation lexicons and phoneme durations, all produced by a text-analysis pipeline that took a lot of expertise to build. Tacotron 2 showed that one trained system could replace that pipeline and still produce speech that listeners rated close to a human speaker. Its two-stage shape, a sequence model that predicts a spectrogram followed by a neural vocoder, is the one many later neural speech systems follow.
The evaluation is the reason to take the claim seriously. Raters scored the system on a 1 to 5 scale, at least eight ratings per sample, on 100 test sentences. The result, 4.526 with a 95 percent interval of plus or minus 0.066, sits next to 4.582 for the ground truth recordings.
The problem
Speech synthesis had improved in three steps, and each left a gap.
Concatenative synthesis stitches short pre-recorded pieces of speech together. It sounded natural in its own recordings, but the joins between pieces produced audible artifacts. Statistical parametric synthesis generates smooth trajectories of speech features and passes them to a vocoder, a component that turns those features into a waveform. It avoids the joins, but the output often sounds muffled.
WaveNet, a network that generates raw audio one sample at a time, produces much better sound. But its inputs, linguistic features and a predicted fundamental frequency with phoneme durations, need an elaborate front end to produce.
Tacotron removed the front end. It is a sequence-to-sequence model that maps characters to magnitude spectrograms. Its own vocoder was Griffin-Lim, an iterative algorithm that estimates the phase missing from a magnitude spectrogram so the signal can be rebuilt with an inverse Fourier transform. Griffin-Lim leaves characteristic artifacts, so the sound quality was limited by the vocoder. Tacotron 2 keeps the text-to-spectrogram model and replaces the vocoder with a WaveNet.
How it works
The walkthrough follows one second of speech through the pipeline. The numbers are the paper's settings: 24 kHz audio, frames every 12.5 ms, and 80 mel channels.
flowchart LR T["Characters"] --> E["Embedding and convolutions"] E --> B["Bidirectional LSTM encoder"] B --> A["Attention"] A --> D["Decoder LSTM with pre-net"] D --> M["Mel frame"] M --> P["Post-net residual"] P --> W["WaveNet vocoder"] W --> S["16-bit waveform"]
-
Read the text. The input is spelled out in words, so "16" becomes "sixteen". Each character is mapped to a learned 512-number vector, then passed through three convolutional layers that look at five characters at a time. The result is a short sequence of feature vectors, one per character, that now also carries information about nearby letters.
-
Encode the sequence. A bidirectional LSTM reads the feature sequence forwards and backwards and gives each character a summary of its surroundings. Check: each character's output depends on both its left and right context, which matters because pronunciation depends on what comes next.
-
Decode one frame at a time. The decoder is autoregressive: it produces one mel frame, then uses that frame as input for the next. Before it sees the previous frame, that frame goes through a small pre-net, which the paper calls an information bottleneck that makes attention learnable.
-
Attend to the text. At each decoder step, attention produces a weighted summary of the encoder's outputs. The weights depend on the decoder's state and on the attention weights from earlier steps, which keeps the model moving forward through the text. Check: the cumulative weights push attention forward through the text, which guards against the repeated and skipped words that attention models often produce.
-
Emit the frame and a stop signal. The decoder output is projected to one frame of 80 mel values. A separate sigmoid output estimates the probability that speech has ended, and generation stops at the first frame where that probability exceeds 0.5. Check: the model decides its own length instead of using a fixed duration.
-
Refine the frames. A five-layer post-net predicts a residual that is added to the whole predicted spectrogram. Check: the post-net sees past and future frames together, which the decoder cannot do while it is still generating.
-
Vocode. WaveNet is conditioned on the mel frames. Each frame covers 12.5 ms, which is 300 audio samples at 24 kHz, so one second of audio is 80 frames and 24,000 samples. WaveNet produces each sample from the frame that covers it and the samples before it. Check: 80 frames times 300 samples per frame is 24,000 samples, one second.
The math
Here is the true mel frame at time , is the predicted frame and is the number of frames in the utterance. Each frame has mel channels.
A mel spectrogram is a matrix whose columns are frames of log-compressed mel-band magnitudes. Each frame is taken from a 50 millisecond window with a 12.5 millisecond hop, weighted by a Hann window. The mel filterbank covers 125 Hz to 7.6 kHz with 80 channels, and magnitudes are clipped at a minimum of 0.01 before the logarithm.
Step 3 in symbols: the autoregressive decoder
The decoder predicts each frame from the frame before it and the attention context produced at step 4:
During training the true previous frame replaces . That substitution is teacher forcing, and it is why the paper discusses a gap between training and generation.
Step 4 in symbols: location-sensitive attention
The attention weights say how much output step looks at encoder position . The paper adds the cumulative weights from earlier steps as a location feature, so the score for position depends on where attention has already been:
Here is the encoder output at position and is the score. The denominator is the softmax over all positions, so the weights are positive and sum to one.
Step 5 in symbols: the stop probability
A sigmoid output estimates whether the utterance has ended at frame . Generation stops at the first where .
Step 6 in symbols: the training loss
The paper sums the mean squared error before and after the post-net, so both the raw and the refined frames are pushed towards the target:
The post-net output is , where is the residual the post-net predicts.
Step 7 in symbols: the WaveNet vocoder
The waveform is modelled one sample at a time, conditioned on the mel frame that covers it. The network has 30 dilated convolution layers in three cycles, so the dilation of layer is for . Each sample has a distribution from a mixture of ten logistic components rather than a softmax over buckets. The loss is the negative log-likelihood of the true sample:
Here is the frame index, since 300 samples fall in each 12.5 millisecond frame at 24 kHz.
- One frame covers 12.5 ms. Convert to seconds: 0.0125 s.
- At 24,000 samples per second, a frame covers 0.0125 times 24,000 = 300 samples.
- One second of speech has 1 divided by 0.0125 = 80 frames.
- Check: 80 frames times 300 samples is 24,000 samples, which is one second of audio at 24 kHz.
Try it: how many frames and samples does 3 seconds of speech need? Answer: 240 frames and 72,000 samples, because 3 divided by 0.0125 is 240 and 240 times 300 is 72,000.
Take three encoder positions with scores at one decoder step.
- Exponentiate each score: , , .
- Sum them: .
- Divide each by the sum: weights , and .
- Check: , so the weights form a valid mix.
- Mix three encoder vectors , and (one number each for illustration). The context is .
Interpretation: the context is pulled towards the position with the highest score, but it still carries information from all three. This is what lets the decoder read the whole sentence at each step.
A 2 second sentence at 24 kHz is 48,000 samples. The mel spectrogram has frames of 80 values each, which is numbers. The waveform has 48,000 samples, so the spectrogram is about 27 percent of the waveform's size. The vocoder therefore does most of the work, turning 12,800 numbers into 48,000 samples while keeping timing and pitch.
Try it: the paper's WaveNet scales the waveform targets by 127.5 before training, so an amplitude of 1.0 becomes 127.5. Given a sample at 0.5, what does it become? Answer: .
Results
- Human ratings (Table 1, MOS on 100 test sentences). Parametric 3.492, Tacotron with Griffin-Lim 4.001, concatenative 4.166, WaveNet with linguistic features 4.341, Tacotron 2 4.526 and ground truth 4.582. The Tacotron 2 interval overlaps the ground truth interval, so the paper calls the two comparable.
- Side by side against the recordings. Raters preferred the ground truth by a small margin, with a mean of minus 0.270 on a scale from minus 3 to 3. The comments point to occasional mispronunciation as the main reason.
- Custom and out-of-domain sets. On a separate 100-sentence test set the system scored 4.354. On 37 news headlines it scored 4.148, against 4.137 for WaveNet with linguistic features, a tie within the error bars. Raters said the neural system sounded more natural but sometimes mispronounced names.
- Error analysis. In a manual count, 6 sentences had mispronunciations, 1 had a skipped word, none had repeated words, and 23 had unnatural prosody. End-point prediction failed once, on the longest input.
- Predicted or ground truth features (Table 2). Training and synthesis on predicted features gives 4.526; ground truth for both gives 4.522. Training on ground truth but synthesising from predicted features gives 4.362, which the authors attribute to predicted spectrograms being smoother than real ones.
- Mel versus linear spectrograms (Table 3). Linear spectrograms with Griffin-Lim give 3.944, linear with WaveNet 4.510, and mel with WaveNet 4.526. The WaveNet vocoder matters more than the spectrogram type.
- Post-net (Section 3.3.3). Without the post-net the score is 4.429; with it, 4.526.
- Smaller WaveNet (Table 4). The 30-layer baseline with a 255.8 ms receptive field scores 4.526; a 12-layer model with a 10.5 ms receptive field scores 4.481, a difference inside the intervals. Removing dilation drops the receptive field to 2.5 ms and the score to 3.930.
Limits, from the paper's own analysis. The training data is 24.6 hours from one female speaker, so the results are for one voice. Prosody remains a weak point, and the system depends on training data that covers the text it will read. The authors also note that predicted spectrograms are smoother than real ones, which costs quality.
Reading guide
- Introduction (Section 1). Needs sequence-to-sequence learning and the history of concatenative and parametric synthesis. The key term is a vocoder, which WaveNet fills in this paper.
- Feature representation (Section 2.1). Needs Discrete Fourier Transform and Fourier Transform, plus Mel Spectrogram for the scale.
- Spectrogram prediction network (Section 2.2). Needs Encoder-Decoder Architecture, Bidirectional Recurrent Neural Network, Long Short-Term Memory, Attention Mechanism and Neural Machine Translation by Jointly Learning to Align and Translate for additive attention, Dropout, Batch Normalization and Mixture Density Network, which the authors tried and set aside.
- WaveNet vocoder (Section 2.3). Needs WaveNet, Dilated Convolution and Autoregressive Model.
- Training (Section 3.1). Needs Teacher Forcing, Adam Optimizer, Mean Squared Error and Exponential Moving Average, which the paper uses to average weights for inference.
- Evaluation and ablations (Sections 3.2 and 3.3). Needs Rectified Linear Unit (ReLU) and Sigmoid Function for the activations and the stop token, and Recurrent Neural Network for the recurrent layers. The results are the paper's own numbers, read against the listed intervals.
Check yourself
QuestionRecall: why does the model predict a mel spectrogram instead of raw waveform samples?Show answer
A spectrogram frame is smoother than samples and is invariant to phase within the frame, so a squared error loss suits it. It is also much smaller: 80 numbers per 12.5 ms frame, against 300 samples in the same time. That makes the prediction problem easier for the first network, and the WaveNet fills in the fine detail.
QuestionComputation: how many mel frames and waveform samples does 3 seconds of speech at 24 kHz need?Show answer
Frames: 3 divided by 0.0125 is 240. Samples: 3 times 24,000 is 72,000. Check: 240 frames times 300 samples per frame is 72,000.
QuestionWhy: why does the decoder pass each predicted frame through a pre-net with a bottleneck, and why is dropout kept on at inference?Show answer
The paper says the pre-net acting as an information bottleneck was essential for learning attention, so the decoder cannot simply copy its previous output. Dropout with probability 0.5 is applied only inside the pre-net at inference time, which adds variation so that the same text can be spoken in slightly different ways.
QuestionApplied: a team wants a faster vocoder. The 12-layer model scores 4.481 and the 30-layer baseline scores 4.526. Is the trade-off worth it?Show answer
The gap is small compared with the intervals, which are plus or minus 0.059 and 0.066, so the two models are not clearly different in listener ratings. The 12-layer model uses fewer layers and a much smaller receptive field. The team should test on its own voice and text, because the paper's data is one speaker and read sentences.
Sources
- Shen, J., Pang, R., Weiss, R. J., et al. (2017). Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions. arXiv: 1712.05884
- DOI: 10.48550/arXiv.1712.05884