Simple and Controllable Music Generation

Jade Copet, Felix Kreuk, Itai Gat, Tal Remez, David Kant, Gabriel Synnaeve, Yossi Adi, Alexandre Défossez

TL;DR

MusicGen is a single-stage Transformer language model capable of generating high-quality, 32kHz music conditioned on text descriptions or melodic prompts. By introducing clever "codebook interleaving" patterns, the researchers eliminated the need for the complex, multi-stage hierarchies typical of previous state-of-the-art models while achieving superior performance in both human and automated evaluations.

What Problem Does This Paper Address?

Generating high-fidelity music is significantly harder than generating speech. Music requires the full frequency spectrum (typically 44.1kHz or 48kHz), meaning models must handle much longer sequences. Furthermore, music demands strict harmonic and melodic coherence; humans are incredibly sensitive to "wrong notes" in a way they aren't to slight artifacts in speech.

Existing solutions like Google's MusicLM often rely on "cascaded" architectures—multiple models stacked together (e.g., one for semantic meaning, one for acoustic details, and another for upsampling). These systems are complex to train, slow to run, and can suffer from error propagation between stages. The authors of MusicGen set out to prove that a single, streamlined model could do it all better.

Methods

The secret sauce of MusicGen is how it handles audio "tokens."

  1. Audio Tokenization: The model uses EnCodec, a neural audio compressor. EnCodec turns raw waveforms into several parallel streams of discrete tokens using a technique called Residual Vector Quantization (RVQ). In RVQ, the first stream captures the most important info, and subsequent streams capture the remaining error (the "residue").
  2. Codebook Interleaving Patterns: This is the paper's primary innovation. Usually, modeling multiple parallel streams of tokens is computationally expensive. MusicGen introduces several patterns to "interleave" these streams:
Comparison of codebook interleaving patterns, including the efficient Delay Pattern.
  • Delay Pattern: By shifting the streams relative to each other by one time step, the model can predict tokens for all codebooks in parallel for a given time step. This keeps the sequence length manageable while maintaining the benefits of autoregressive modeling.
  • Conditioning:
    • Text: The model uses a frozen text encoder (like T5) to process descriptions like "90s rock song with a heavy guitar riff."
    • Melody: To give creators more control, the model can also follow a specific melody. It does this by taking a "chromagram" (a representation of pitch over time) from a reference track and passing it through an information bottleneck so the model learns the structure of the melody without just copying the original audio's texture.
  • Architecture: A standard Transformer decoder (ranging from 300M to 3.3B parameters) that uses cross-attention to incorporate the text or melody prompts.

Datasets

  • Training: The model was trained on 20,000 hours of licensed music, including an internal dataset of 10k high-quality tracks and professional libraries from ShutterStock and Pond5.
  • Evaluation: The primary benchmark used was MusicCaps, a publicly available dataset of 5.5k music-text pairs prepared by expert musicians.

Key Insights and Ideas

  • Simplicity Wins: You don't need a hierarchy of models to generate high-fidelity audio. A single-stage model is sufficient if you use an efficient interleaving strategy.
  • The Power of the "Delay": The "Delay Pattern" allows the model to predict multiple codebooks at once. The authors found that this "inexact" decomposition performs nearly as well as "exact" flattening (which is much slower) but is significantly more efficient.
  • Stereo for "Free": By simply adding more streams to the interleaving pattern (four for the left channel, four for the right), the model learns to generate stereo audio without any fundamental changes to the architecture.
  • Melody Bottlenecks: Providing a raw chromagram leads to overfitting (the model just recreates the source). By quantizing the chromagram and picking only the dominant frequency, the model becomes a "creative collaborator" that follows the tune but changes the style.

Key Results

  • Human Preference: In "blind" tests, human raters gave MusicGen an overall quality score of 84.8/100, significantly higher than the best baseline (MusicLM at 80.5).
  • Objective Metrics: MusicGen outperformed baselines like Riffusion and Mousai on the Fréchet Audio Distance (FAD), a metric that measures how "plausible" the generated audio sounds compared to real music.
  • Scaling: While the 3.3B parameter model was best at understanding complex text prompts, the 1.5B parameter model was often cited as the "sweet spot" for overall audio quality.

Limitations and Future Work

  • Fine-grained Control: While the model follows text and melody well, it lacks "knobs" for precise control over things like tempo or specific key changes without re-prompting.
  • Data Bias: The training data is predominantly Western-style music. The authors acknowledge that the model may not perform as well on diverse global musical traditions.
  • Melody Augmentation: The authors suggest that while text augmentation is well-studied, more work is needed on how to "augment" melody data during training to make the model even more robust to different types of melodic input (like humming or whistling).

Summary updated

BibTeX
@inproceedings{copet2023simple,
  author = {Jade Copet and Felix Kreuk and Itai Gat and Tal Remez and David Kant and Gabriel Synnaeve and Yossi Adi and Alexandre Défossez},
  title = {{Simple and Controllable Music Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=jtiQ26sCJi},
}
Figure