HiFi-GAN Explained: Periodic Discriminators, Quality, and Speed
A paper-focused guide to HiFi-GAN’s generator, multi-period and multi-scale discriminators, training losses, and the measured quality–speed trade-off across V1, V2, and V3.
HiFi-GAN Explained: Modeling Speech Periodicity and Texture Together
HiFi-GAN is a non-autoregressive neural vocoder that converts a mel-spectrogram into a waveform. Its generator gradually upsamples mel features; a multi-period discriminator (MPD) and a multi-scale discriminator (MSD) detect different kinds of errors. Multi-receptive-field fusion (MRF), mel reconstruction, and feature-matching losses support the generator.
From input to waveform
In the paper’s design, a fully convolutional generator receives a mel-spectrogram and uses transposed convolutions to increase its time resolution to that of the waveform. An MRF module follows each upsampling stage. It sums residual-block outputs with different kernel sizes and dilation rates, so the generator can model patterns over multiple time spans. The paper does not feed separate random noise into the generator.
What the discriminators inspect
**MPD:** rearranges waveform samples according to several periods; the paper uses 2, 3, 5, and 7. Each sub-discriminator sees regularly spaced samples and is intended to detect disrupted periodic structure and harmonics.
**MSD:** evaluates the original waveform and two average-pooled versions at lower resolutions. It is designed to inspect local texture and broader continuity at different scales.
Neither discriminator is a complete measure of what listeners prefer. They provide training signals. The generator also uses a mel-spectrogram loss to match the input condition and a feature-matching loss comparing intermediate discriminator representations of real and generated audio. In simplified form, its objective combines adversarial, weighted feature-matching, and weighted mel-reconstruction terms. The paper’s weights should not be copied blindly to different data or preprocessing.
V1, V2, and V3: one measured trade-off
The paper compared generator sizes with 22.05 kHz LJSpeech. These are 5-point mean-opinion scores and CPU speeds from that study’s setup, not a current-device promise.
| Variant | Parameters | MOS | CPU speed vs. real time |
|---|---|---|---|
| V1 | 13.92M | 4.36 | 1.43× |
| V2 | 0.92M | 4.23 | 9.74× |
| V3 | 1.46M | 4.05 | 13.44× |
V1 scored highest among the three in that evaluation. V2 used the fewest parameters and retained a high score. V3 was fastest on the tested CPU but scored lower. The comparison used one speaker dataset and a 2.6 GHz Intel i7 MacBook Pro CPU; rankings can change with language, speaker, device, accelerator, or preprocessing.
Reproduce and diagnose
Check the checkpoint’s sample rate, mel bands, FFT/window/hop, and normalization. The paper used 80 mel bands, FFT/window 1024, and hop 256; checkpoints may differ.
Use the same mel-extraction code in training and inference. Matching tensor shape does not guarantee matching log scale, clipping, or normalization.
First run analysis–synthesis: extract mel features from a recording and reconstruct audio. Compare listening, waveform, and reconstructed mel with the reference.
If this works but TTS sounds poor, compare predicted mel distributions and noise with the vocoder’s training inputs.
Evaluate varied speakers and sentences for naturalness, intelligibility, sibilants, voiced periodic texture, latency, and memory. MOS is an average preference score for a particular sample group, not a diagnosis of every error.
Choose a HiFi-GAN checkpoint by its input contract and measured quality–latency balance in your target environment, not by the model name or paper’s best speed claim. A separate neural-vocoder article covers the broader model families; this article focuses on the HiFi-GAN paper and its variants.
References
[Kong, Kim & Bae (2020), HiFi-GAN](https://arxiv.org/abs/2010.05646)
[Official implementation](https://github.com/jik876/hifi-gan)