Codec Does Matter: Exploring the Semantic Shortcoming of Codec for Audio Language Model

Zhen Ye, Peiwen Sun, Jiahe Lei, Hongzhan Lin, Xu Tan, Zheqi Dai, Qiuqiang Kong, Jianyi Chen, Jiahao Pan, Qifeng Liu, Yike Guo, Wei Xue

Abstract

Current audio Large Language Models (LLMs) frequently encounter "hallucinations" and word skipping, primarily because the underlying audio codecs are optimized for data compression rather than semantic understanding. This paper introduces X-Codec, a novel audio tokenizer designed to bridge this gap. By integrating semantic features from pre-trained self-supervised learning (SSL) models into the encoding process, X-Codec produces "semantically rich" tokens. Experimental results demonstrate that X-Codec significantly reduces Word Error Rates (WER) in speech synthesis and enhances the quality of generated music and sound, outperforming established baselines like EnCodec and DAC.

Introduction

In the evolving landscape of audio generation, models such as VALL-E and AudioLM treat audio as sequences of discrete tokens, mirroring the approach of text-based LLMs. These tokens are typically derived from neural audio codecs like EnCodec or DAC. However, these codecs were originally engineered for high-fidelity audio compression, focusing on reconstructing waveforms with minimal bitrates. This focus often neglects the semantic content of the audio, leading to a "semantic shortcoming." Consequently, LLMs struggle to map text to audio accurately, resulting in errors like mispronunciations or omitted words in text-to-speech (TTS) tasks, despite high acoustic quality.

Methodology

To address these limitations, the authors propose X-Codec, which utilizes a distinctive "X-shaped" architecture to unify acoustic detail with semantic meaning.

The X-Codec architecture featuring an Auxiliary Semantic Module and dual reconstruction paths.

The architecture consists of several key components:

  1. Auxiliary Semantic Module: X-Codec employs a frozen pre-trained SSL model (e.g., HuBERT) as a semantic encoder to extract high-level features representing the audio's content.
  2. Feature Fusion: These semantic features ($S$) are concatenated with traditional acoustic features ($A$) from a standard encoder to form a unified representation ($U$).
  3. Quantization and Reconstruction: This unified representation is passed through a Residual Vector Quantizer (RVQ) to produce discrete tokens. During training, the decoder is optimized to reconstruct both the raw waveform (acoustic) and the original semantic features. This dual-objective ensures that the resulting tokens are semantically grounded.
  4. Unified Framework: Unlike approaches that separate content and timbre into different token layers, X-Codec integrates both into a single framework, ensuring compatibility with modern "flattened" token patterns used in LLMs.

Experimental Setup

The performance of X-Codec was evaluated across three primary domains:

  • Speech: Models were trained on LibriSpeech and tested on LibriTTS for zero-shot TTS.
  • Music: Training involved an internal dataset of approximately 100,000 hours of music, with evaluation on the MUSDB18 dataset.
  • General Sound: The AudioCaps and AudioSet datasets were used for training and evaluation.
  • Semantic Benchmarking: The ARCH benchmark, encompassing 12 classification tasks, was used to assess the codec's inherent semantic understanding.

Results and Discussion

The integration of semantic information yielded substantial improvements across all benchmarks. A critical finding was the improvement in phonetic discriminability; ABX tests revealed that X-Codec distinguishes similar phonemes far better than standard compression-focused codecs.

Performance comparison of X-Codec against baselines in VALL-E AR and NAR stages.

As shown in the results table, X-Codec significantly outperforms baselines in zero-shot TTS tasks. Specifically, in a VALL-E setup, X-Codec achieved a Word Error Rate (WER) of 3.26, a marked improvement over EnCodec's 6.37. Furthermore, X-Codec showed superior performance in speech naturalness (UTMOS) and speaker similarity (SIM-O).

In the realms of music and sound, X-Codec achieved lower Frechet Audio Distance (FAD) scores, indicating that the generated content is statistically closer to real-world distributions. This suggests that semantic enrichment helps the model grasp the underlying structure of non-speech audio as well.

Conclusion

X-Codec demonstrates that "codec does matter" for audio language modeling. By injecting semantic awareness into the tokenization process, it resolves many of the "hallucination" issues prevalent in current models. While the addition of a semantic extraction layer increases computational overhead, the gains in output quality and reliability are significant. Future work will focus on optimizing the efficiency of semantic integration to make X-Codec more suitable for low-latency applications.

Summary updated

BibTeX
@inproceedings{ye2025codec,
  author = {Zhen Ye and Peiwen Sun and Jiahe Lei and Hongzhan Lin and Xu Tan and Zheqi Dai and Qiuqiang Kong and Jianyi Chen and Jiahao Pan and Qifeng Liu and Yike Guo and Wei Xue},
  title = {{Codec Does Matter: Exploring the Semantic Shortcoming of Codec for Audio Language Model}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i24.34761},
}
Figure