XCodec2
Neural audio codec whose tokens carry semantic as well as acoustic information.
Audio and speech · 2,698 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Audio and speech
- Parameters
- 629.3M
- Operations
- 2,698
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2025
- Source
- transformers 5.18.0
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3421
- Graph hash
- 3d4eef8ffc76ab376da92dba24c130734468fd38441cf74092f3788553c70c90
- Skeleton hash
- aee405141cee355d8a009f3b2b03166fd608ef7fcc8c7d502f41669088bb5bb7
- Architecture hash
- 7e36d97650c77586741280bd2f19f8ffeb76fd29f0f2dd4eafce7b0d43778ced
- Diagram SHA-256
- 50323ca85467cfd4b529197ef77a0938f6f42bf8c4cfa2f0c5228329e0dc69e4
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
XCodec2, a compact temporal-convolution reimplementation with random weights, fed one second of 16 kHz waveform plus 50 frames of 160-dimensional stacked fbank features.
X-Codec is a neural audio codec that integrates semantic information from self-supervised models such as HuBERT alongside traditional acoustic information. The paper's motivation is that codecs such as EnCodec were designed for audio compression, which the authors argue may lead to suboptimal performance for audio language models. X-Codec incorporates semantic features from a pre-trained semantic encoder before the Residual Vector Quantization stage and adds a semantic reconstruction loss after it. The authors report that this significantly reduces word error rate in speech synthesis and extends to music and sound generation.
The traced member here is XCodec2, a compact random-initialization reimplementation that maps one second of 16 kHz audio to a reconstructed waveform and a 50-frame code sequence, while the library's own X-Codec model was set aside after a degenerate forward. X-Codec is also used as the audio tokenizer in the YuE lyrics-to-song generation model.
Key idea. Adding semantic features from a pre-trained semantic encoder before residual vector quantization, with a semantic reconstruction loss after it, so codec tokens keep meaning for audio language models.
- X-Codec
- XCodec
- XCodec2
- neural audio codec
- audio tokenizer
- RVQ
- HuBERT
- YuE
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.