Abstract
HiFi-Codec introduces Group-Residual Vector Quantization (GRVQ), a novel technique that allows neural audio codecs to achieve superior reconstruction quality using significantly fewer codebooks. By reducing the number of discrete tokens needed to represent audio, HiFi-Codec makes it much easier and more efficient to train downstream generative models like Text-to-Speech (TTS) and music generators.
Introduction
Modern audio generation models, such as VALL-E or AudioLM, typically generate "tokens" from a neural audio codec like Encodec or SoundStream. These codecs use Residual Vector Quantization (RVQ) to compress audio into multiple layers of codebooks. However, RVQ has a major drawback: to achieve high-fidelity sound, models often require 12 or more codebooks. For a Transformer model, this leads to massive sequence lengths, heavy computational burdens, and difficulty in modeling long-range dependencies. Furthermore, standard RVQ often crams most useful information into the first codebook, leaving subsequent layers with sparse details that are difficult for generative models to learn.
Methods
The authors propose Group-Residual Vector Quantization (GRVQ), a "divide and conquer" strategy for audio quantization. The process involves three main steps:
- Feature Splitting: The latent vector $z$ produced by the encoder is split into several groups (e.g., $z_1$ and $z_2$).
- Parallel RVQ: Each group undergoes its own RVQ process independently, forcing the model to capture more essential information in the "first layer" of codebooks across all groups.
- Fusion: The quantized outputs from all groups are concatenated and fed into the decoder.
The architecture follows an encoder-decoder structure with a two-layer LSTM for sequence modeling. To ensure high-quality output, a GAN-based training objective is employed using three types of discriminators: Multi-Scale STFT (MS-STFT) for frequency domain consistency, Multi-Period Discriminator (MPD) for periodic patterns, and Multi-Scale Discriminator (MSD) for waveform resolution.
Experimental Setup
The models were trained on over 1,000 hours of publicly available TTS data, including LibriTTS, VCTK, and AISHELL. The authors also released AcademiCodec, an open-source toolkit providing training code and pre-trained weights for Encodec, SoundStream, and HiFi-Codec to lower the barrier for researchers in audio generation.
Key Results
HiFi-Codec demonstrates a clear "less is more" advantage in audio reconstruction. At a 24kHz sample rate, HiFi-Codec with only 4 codebooks achieved a PESQ score of 3.63, outperforming the official Encodec model which scored 3.01 with 8 codebooks and 3.21 with 12 codebooks.
When expanded to 8 codebooks, HiFi-Codec reached a peak PESQ of 3.92 and an STOI of 0.95, representing very high-fidelity reconstruction. The model maintains high performance across different downsampling rates and sampling frequencies (16kHz and 24kHz).
Discussion and Future Work
By reducing the codebook count from 12 to 4, HiFi-Codec effectively reduces the sequence length for downstream generative models by 3x. This increased information density ensures that the primary quantization layers—which are the easiest for generative models to predict—carry more of the heavy lifting for audio reconstruction.
Future work will involve testing HiFi-Codec on more diverse datasets beyond speech, such as complex environmental sounds or music. Additionally, while objective metrics like PESQ and STOI are promising, future studies will incorporate subjective listening tests and validate the codec's performance in practical downstream generation tasks.
Summary updated