ESC: Efficient Speech Coding with Cross-Scale Residual Vector Quantized Transformers

Yuzhe Gu, Enmao Diao

Abstract

Neural speech coding has traditionally relied on Convolutional Neural Networks (CNNs) and Generative Adversarial Networks (GANs) to achieve high-fidelity reconstruction. However, these architectures often require significant parameter counts and struggle to capture local redundancies efficiently. This paper introduces ESC (Efficient Speech Codec), a fully transformer-based audio codec that utilizes hierarchical Swin Transformers and a novel Cross-Scale Residual Vector Quantization (CS-RVQ) scheme. ESC achieves comparable audio quality to state-of-the-art models while being nearly five times smaller and offering significantly faster decoding speeds.

Introduction

Modern neural speech codecs, such as EnCodec and DAC, have set high benchmarks for audio compression. Despite their success, these models are primarily built on CNN architectures. CNNs are not inherently optimized for the specific local redundancies found in speech signals, often requiring massive parameter counts or heavy reliance on GAN-based "hallucination" to restore missing details. Furthermore, standard Residual Vector Quantization (RVQ) typically occurs only at the network's narrowest bottleneck, potentially ignoring fine-grained details present in earlier layers.

To address these limitations, the ESC framework shifts the paradigm from time-domain CNNs to frequency-domain Transformers. By leveraging the hierarchical nature of Swin Transformers and injecting quantization at multiple scales, ESC provides a more efficient and scalable solution for high-fidelity speech coding.

Methodology

Swin Transformer Backbone

ESC operates on complex Short-Time Fourier Transform (STFT) spectrograms rather than raw waveforms. The architecture employs mirrored hierarchical Swin Transformer blocks. By using window-based self-attention, the model can efficiently capture both local spectral features and global dependencies within the audio spectrum. This approach allows the model to process audio with a more nuanced understanding of frequency-domain relationships than traditional convolutional filters.

Cross-Scale Residual Vector Quantization (CS-RVQ)

In traditional codecs, all information must pass through a single, highly compressed bottleneck. ESC introduces Cross-Scale Residual Vector Quantization (CS-RVQ), which quantizes the residuals—the differences between encoder and decoder features—across multiple resolutions. This multi-scale approach allows the decoder to progressively refine the audio signal, moving from coarse structural components to fine-grained details. By injecting information at different scales, the model avoids the information loss associated with a single narrow bottleneck.

Stability and Optimization

To ensure training stability and prevent "codebook collapse"—a common issue where only a fraction of the available codewords are utilized—the researchers implemented two key strategies:

  1. Product Vector Quantization: Vectors are split into sub-vectors, allowing for more efficient and diverse quantization.
  2. Pre-training Paradigm: The model undergoes a "warm-start" phase, training as a simple autoencoder without quantization. This ensures the encoder and decoder are well-optimized before the discrete VQ layers are activated, leading to better bitrate efficiency.

Experimental Setup

The ESC models were trained on a robust dataset comprising 150 hours of 16kHz multilingual clean speech from the DNS Challenge. To evaluate the model's generalization across different languages and speaker profiles, testing was conducted on 1,158 speech clips from LibriSpeech (English), Multilingual LibriSpeech, and AIShell (Mandarin).

Key Results

Efficiency and Scale

ESC demonstrates remarkable efficiency compared to existing baselines. ESC-Large, with only 15.6 million parameters, achieves performance comparable to DAC-Base, which contains 74 million parameters. This represents a 4.8x reduction in model size without sacrificing reconstruction quality.

Real-Time Performance

Computational speed is critical for real-time communication. ESC significantly outperforms DAC-Base in decoding speed, achieving a Real-Time Factor (RTF) approximately 6.4x faster. This makes ESC an ideal candidate for low-latency, on-device applications.

Objective Quality

Across bitrates ranging from 1.5 to 9.0 kbps, ESC variants consistently matched or exceeded state-of-the-art models in objective metrics. In terms of Perceptual Evaluation of Speech Quality (PESQ) and Signal-to-Interference-plus-Signal-to-Distortion Ratio (SI-SDR), ESC proved that a transformer-based approach can outperform similarly sized CNN models even without the use of a GAN discriminator.

Conclusion and Future Work

ESC represents a significant step forward in efficient speech coding, proving that Transformers are superior backbones for speech foundation models. By utilizing CS-RVQ and hierarchical Swin Transformers, ESC delivers high-fidelity audio with a fraction of the computational overhead of previous models.

While objective metrics are promising, future research will focus on formal MUSHRA (listening) tests to confirm subjective human preference. Additionally, the researchers plan to explore ESC’s utility as an "acoustic tokenizer" for downstream generative AI tasks, such as text-to-speech, and investigate methods to mitigate the slight latency increases observed at higher bitrates due to the multi-scale decoder structure.

Summary updated

BibTeX
@inproceedings{gu2024esc,
  author = {Yuzhe Gu and Enmao Diao},
  title = {{ESC: Efficient Speech Coding with Cross-Scale Residual Vector Quantized Transformers}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.562},
}
Figure