FastSpeech 2 is a non-autoregressive text-to-speech (TTS) model that synthesizes mel-spectrograms in a single, parallel forward pass. It replaces the autoregressive decoder of models like Tacotron 2 with a feed-forward Transformer, eliminating sequential dependency and dramatically accelerating inference. The model's core innovation is its use of explicit, separately predicted variance adaptors for pitch, energy, and phoneme duration, which are extracted directly from a ground-truth speech target during training. This approach provides fine-grained, disentangled control over speech prosody and improves the robustness and naturalness of the generated audio.
Glossary
FastSpeech 2

What is FastSpeech 2?
FastSpeech 2 is a non-autoregressive neural text-to-speech model that generates high-quality mel-spectrograms in parallel, significantly improving synthesis speed and controllability over its predecessors.
By using ground-truth targets for its variance predictors, FastSpeech 2 avoids the exposure bias and error propagation issues common in autoregressive and earlier non-autoregressive models. The generated mel-spectrogram is typically converted to a raw audio waveform using a separate neural vocoder like HiFi-GAN. The architecture's parallel nature and explicit prosody modeling make it highly suitable for real-time, high-quality TTS applications where both speed and controllability—such as adjusting speaking rate or emotional tone—are critical requirements.
Key Features of FastSpeech 2
FastSpeech 2 is a non-autoregressive neural text-to-speech model that addresses key limitations of its predecessor and autoregressive models by introducing explicit, learnable variance predictors to control speech characteristics, enabling parallel, high-speed, and highly controllable mel-spectrogram generation.
Non-Autoregressive Parallel Generation
Unlike autoregressive models like Tacotron 2 that generate output frames one at a time, FastSpeech 2 generates the entire mel-spectrogram sequence in a single, parallel forward pass. This architecture eliminates sequential dependencies, reducing latency from seconds to milliseconds. The core mechanism uses a feed-forward Transformer block that processes all phoneme embeddings simultaneously, followed by a length regulator that expands the sequence to the target mel-spectrogram length based on predicted durations.
Explicit Variance Predictors
FastSpeech 2 introduces three separate, lightweight predictor modules to model prosodic variations directly from the input, removing the need for a teacher model's approximations.
- Pitch Predictor: Models the fundamental frequency (F0) contour on a logarithmic scale, crucial for intonation and emotion.
- Energy Predictor: Captures the amplitude or loudness of speech over time.
- Duration Predictor: Estimates the number of mel-spectrogram frames each input phoneme should occupy. These predictors are trained with ground-truth extracted values, providing more accurate and stable prosody control than the previous knowledge distillation approach.
Variance Adaptor
The Variance Adaptor is the central module that integrates the predictions from the pitch, energy, and duration predictors to condition the phoneme sequence. It performs three key operations:
- Length Regulation: Expands the phoneme hidden sequence according to the predicted durations.
- Pitch & Energy Embedding: Converts the continuous pitch and energy contours into embedding vectors.
- Feature Addition: Adds the pitch and energy embeddings to the expanded phoneme sequence. This process injects rich, controllable prosodic information into the model before the final mel-spectrogram decoder, enabling fine-grained manipulation of speech style.
Feed-Forward Transformer Decoder
The decoder is based on a stack of Feed-Forward Transformer (FFT) blocks, a variant of the standard Transformer that replaces self-attention with a 1D convolutional network for local feature extraction, followed by a standard self-attention mechanism. This design is more efficient and stable for sequence generation tasks than recurrent networks. It takes the variance-adapted phoneme sequence and generates the final mel-spectrogram frames in parallel. The use of positional encoding ensures the model understands the temporal order of the output sequence.
Ground-Truth Aligned Training
FastSpeech 2 is trained using ground-truth targets extracted directly from the training audio, a significant shift from FastSpeech 1's reliance on knowledge distillation from an autoregressive teacher model. The model uses:
- Extracted Mel-Spectrograms as the generation target.
- Phoneme-level Durations from a forced aligner (e.g., Montreal Forced Aligner).
- Extracted Pitch (F0) and Energy values. This approach eliminates the teacher model's information bottleneck and exposure bias, improving training efficiency, stability, and the fidelity of the generated prosody.
Prosody and Style Control
By providing explicit control over the variance predictors, FastSpeech 2 enables precise, adjustable speech synthesis. At inference time, users can:
- Scale predicted pitch/energy values to make speech more expressive or monotone.
- Manually adjust phoneme durations to change speaking rate or add emphasis.
- Use reference audio to extract average pitch and energy values, transferring the global prosodic style to new text. This makes it highly suitable for applications requiring consistent voice characteristics with variable expressiveness, such as audiobooks, voice assistants, and emotional TTS systems.
FastSpeech 2 vs. Other TTS Architectures
A technical comparison of FastSpeech 2's non-autoregressive, parallel generation approach against other prominent text-to-speech model families.
| Architectural Feature / Metric | FastSpeech 2 (Non-Autoregressive) | Autoregressive TTS (e.g., Tacotron 2) | End-to-End TTS (e.g., VITS) |
|---|---|---|---|
Core Generation Paradigm | Parallel (Non-Autoregressive) | Sequential (Autoregressive) | Parallel (with Flow-based or Diffusion) |
Primary Training Objective | Mean Squared Error (MSE) on mel-spectrograms | Maximum Likelihood Estimation (MLE) on mel-spectrograms | Maximum Likelihood via Variational Inference |
Explicit Variance Predictors | |||
Duration Predictor | |||
Pitch & Energy Predictors | |||
Inference Latency | < 0.1 seconds | ~1-2 seconds | ~0.2-0.5 seconds |
Training Stability | High (stable, monotonic alignment) | Medium (prone to attention failures) | Medium (requires careful KL balancing) |
Controllability (Prosody) | High (explicit pitch/energy/duration control) | Low (implicit, latent control) | Medium (latent variable manipulation) |
Audio Quality (MOS) | 4.0 - 4.2 | 4.2 - 4.4 | 4.3 - 4.5 |
Separate Vocoder Required | |||
Robustness to Long Sentences |
Frequently Asked Questions
FastSpeech 2 is a landmark non-autoregressive neural text-to-speech model that generates high-quality, controllable speech in parallel. These questions address its core mechanisms, advantages, and practical applications.
FastSpeech 2 is a non-autoregressive neural text-to-speech (TTS) model that generates a mel-spectrogram from text in a single, parallel forward pass. Its architecture consists of a phoneme encoder, a variance adaptor, and a mel-spectrogram decoder. The key innovation is the variance adaptor, which uses separate, explicitly trained predictors to model duration, pitch (F0), and energy directly from the phoneme sequence, replacing the duration predictor and teacher-student alignment used in the original FastSpeech. These predicted variance features are added to the phoneme hidden sequence as conditional inputs, allowing the decoder to generate the full mel-spectrogram in parallel with precise prosodic control.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
FastSpeech 2 is a pivotal architecture in neural text-to-speech. Understanding its components and related technologies is essential for engineers working on speech synthesis, voice cloning, and audio generation systems.
Non-Autoregressive TTS
A class of text-to-speech models that generate all output tokens (e.g., mel-spectrogram frames) in parallel, as opposed to sequentially. This is the core architectural paradigm of FastSpeech 2, enabling significant inference speedups (often 100x faster than autoregressive models like Tacotron) by eliminating sequential dependencies.
- Key Benefit: Drastically reduced latency for real-time applications.
- Challenge: Requires accurate upfront prediction of output sequence length (duration modeling).
- Example: FastSpeech 2, Parallel Tacotron.
Variance Adaptor
The component within FastSpeech 2 responsible for predicting and injecting prosodic features into the speech. It uses separate, explicit predictors for:
- Duration: The number of mel-spectrogram frames per phoneme.
- Pitch (F0): The fundamental frequency, controlling vocal pitch.
- Energy: The amplitude of the signal, affecting loudness and emphasis.
These predicted variance features are added to the hidden phoneme sequence, providing fine-grained controllability over the speaking style and improving naturalness by modeling prosody separately from linguistic content.
Neural Vocoder
A deep learning model that converts an intermediate acoustic representation (like a mel-spectrogram) into a raw audio waveform. FastSpeech 2 generates mel-spectrograms; a separate neural vocoder is required for the final synthesis.
- Function: Acts as a differentiable, learned inverse of the audio feature extractor.
- Examples: HiFi-GAN (efficient, GAN-based), WaveNet (high-quality, autoregressive), Diffusion-based vocoders.
- Importance: Vocoder quality is critical for the final audio fidelity and naturalness of any TTS pipeline.
Prosody Modeling
The computational task of predicting and controlling the suprasegmental features of speech: rhythm (duration), stress, and intonation (pitch). Poor prosody leads to robotic, monotonous speech.
- FastSpeech 2's Approach: Uses explicit, frame-level predictors for pitch, energy, and duration, allowing for fine-grained control.
- Contrast with Tacotron: Earlier sequence-to-sequence models often learned prosody implicitly and could suffer from unstable attention or over-smoothing.
- Application: Essential for expressive TTS, emotional speech synthesis, and conveying meaning beyond the literal text.
Teacher-Student Knowledge Distillation
A training methodology where a smaller, faster student model (FastSpeech 2) learns to mimic the output of a larger, more accurate teacher model. FastSpeech 1 & 2 used this to acquire alignment information.
- Process: An autoregressive teacher model (e.g., Transformer TTS) generates mel-spectrograms and its internal attention alignments.
- Use Case: The student model uses the teacher's alignments to derive duration labels, bypassing the need for a separate aligner and enabling parallel generation.
- Benefit: Allows the non-autoregressive student to achieve high quality while being far faster than the teacher.
Mel-Spectrogram
A time-frequency representation of audio that is the primary intermediate target for most modern neural TTS systems, including FastSpeech 2. It is created by:
- Computing the Short-Time Fourier Transform (STFT) of the waveform.
- Mapping the frequency bins to the mel scale, which approximates human auditory perception.
- Converting amplitude to decibels.
- Why it's used: It provides a compressed, perceptually-relevant representation that is easier for neural networks to generate than raw waveforms.
- Role in TTS: The TTS model (e.g., FastSpeech 2) predicts a mel-spectrogram sequence from text; the vocoder then converts this spectrogram back into a waveform.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us