Tacotron 2 consists of two parts: a spectrogram prediction network and a WaveNet vocoder. The left side of the figure at the top of the article shows the overall flow, and the right side shows the inside of location-sensitive attention.
The intermediate representation is an 80-channel mel spectrogram. A short-time Fourier transform with 50 ms frames, a 12.5 ms hop, and a Hann window is applied, the result is passed through an 80-channel mel-scale filterbank spanning 125 Hz to 7.6 kHz, values below 0.01 are clipped up, and the logarithm is taken. The mel scale represents the low frequencies important for intelligibility in fine detail and the noisier high frequencies coarsely, so it captures the essentials of speech in few dimensions.
The spectrogram prediction network processes inputs in the following order.
- Character embedding: Characters are mapped to 512-dimensional vectors.
- 3 convolutional layers: Convolutions with 512 filters of width 5 (spanning 5 characters), each followed by batch normalization and ReLU, are applied three times. They capture longer-range context in the character sequence.
- Bidirectional LSTM: One layer with 512 units (256 per direction) produces the encoder output.
- Location-sensitive attention: At each decoder step, the entire sequence of encoder outputs is summarized into a single context vector.
- Pre-net: The frame predicted at the previous step passes through 2 fully connected layers of 256 units (ReLU). The paper reports that this information bottleneck was essential for learning attention.
- Decoder LSTM: The pre-net output and the context vector are concatenated and fed into 2 unidirectional LSTM layers (1,024 units).
- Linear projection: The LSTM output and the context vector are concatenated, and a linear projection predicts the mel spectrogram one frame at a time.
- Stop token: A separate linear projection maps the same concatenation to a scalar, and a sigmoid predicts the probability that the output has finished. At inference, generation stops at the first frame where this probability exceeds 0.5.
- Post-net: 5 convolutional layers (512 filters of width 5, batch normalization, and tanh on all but the last layer) predict a residual that is added to the prediction from step 7 to refine details.
Location-sensitive attention (Chorowski et al. 2015) extends additive attention by adding the cumulative attention weights from previous steps as a feature. With decoder state siβ, the j-th encoder output hjβ, and location features fi,jβ obtained by applying a 1D convolution F to the cumulative weights βk<iβΞ±kβ, it is computed as follows.
fiβei,jβΞ±i,jββ=Fββk<iβΞ±kβ=wβ€tanh(Wsiβ+Vhjβ+Ufi,jβ+b)=βjβ²βexp(ei,jβ²β)exp(ei,jβ)β,ciβ=jββΞ±i,jβhjββ
In the paper's setup, inputs and location features are projected to 128 dimensions, and location features are computed with 32 1D convolution filters of length 31. Knowing "where it has looked so far" makes it easier to move forward through the input characters consistently, reducing failures where parts are repeated or skipped.
The WaveNet vocoder modifies the original WaveNet as follows.
- 30 dilated convolution layers: Grouped into 3 cycles of 10 layers, with the dilation rate of layer k (k=0,β¦,29) being 2kmod10 (dilated convolution).
- Conditioning upsampling: To match the 12.5 ms frame hop, the conditioning stack uses 2 upsampling layers instead of 3.
- Output distribution: Instead of selecting a value bin with a softmax, it generates 16-bit samples at 24 kHz using a mixture of 10 logistic distributions (MoL).
Compared with Tacotron, it replaces CBHG and GRUs with plain LSTMs and convolutions, and drops the trick of emitting multiple frames per step (reduction factor), emitting one frame per step.