Jukebox: A Generative Model for Music

Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, Ilya SutskeverarXiv 2020

Introduction

Generating music in the raw audio domain presents a significant challenge due to the multi-scale nature of the data. High-fidelity audio requires modeling local textures at millisecond scales, while musical coherence requires maintaining structure over several minutes. Jukebox addresses this by using a hierarchical approach to compress raw audio and large-scale Transformers to model the resulting discrete tokens.

Problem Statement

Traditional music generation often relies on symbolic representations like MIDI, which lack the expressive richness of human vocals and complex instrumental timbres. Modeling raw audio directly avoids these limitations but faces a "curse of dimensionality": a standard CD-quality song contains millions of timesteps. Previous models like WaveNet could produce realistic local sounds but failed to maintain global musical structure for more than a few seconds. Jukebox aims to bridge this gap, producing full songs with singing that remain musically consistent for minutes.

Methodology

Hierarchical VQ-VAE

To manage the high dimensionality of raw 44.1kHz audio, Jukebox employs a hierarchical Vector Quantized-Variational Autoencoder (VQ-VAE). The model compresses audio into three distinct levels of discrete tokens:

  • Bottom level: 8x compression, preserving fine-grained acoustic details.
  • Middle level: 32x compression.
  • Top level: 128x compression, capturing high-level musical semantics.
Hierarchical VQ-VAE architecture showing three levels of audio compression and reconstruction.

To prevent "codebook collapse," where higher levels of the hierarchy are ignored, the authors utilized separated autoencoders and random restarts for codebook vectors. A multi-resolution spectral loss was also introduced to prioritize frequency-domain accuracy over exact phase alignment.

Scalable Transformers and Hierarchical Generation

Once tokenized, music generation is treated as a sequence modeling task. Jukebox uses a series of autoregressive Transformers:

  1. Top-Level Prior: A 5-billion parameter model that generates the global structure.
  2. Upsamplers: Two 1-billion parameter models that progressively "fill in" details for the middle and bottom levels, conditioned on the levels above.
The hierarchical generation pipeline, showing the top-level prior and subsequent upsamplers conditioned on external information.

These models utilize axis-aligned sparse attention to handle sequences up to 8,192 tokens efficiently.

Conditioning and Lyrics

The model is conditioned on artist and genre embeddings. For lyrics, an encoder-decoder architecture aligns text characters with music tokens. This allows the model to generate singing that follows the natural prosody of the provided text.

Dataset

The model was trained on a dataset of 1.2 million songs scraped from the web, paired with metadata from LyricWiki. Preprocessing involved vocal isolation via Spleeter and word-level alignment using NUS AutoLyricsAlign to facilitate synchronized singing generation.

Results

Jukebox demonstrates long-range coherence, maintaining a consistent melody and style for several minutes. Key capabilities include:

  • Controllable Singing: Generating vocals for novel lyrics in specific artist styles.
  • Style Blending: Performing "re-renditions" of songs in entirely different genres.
  • Musical Completion: Extending existing 12-second audio clips (primed sampling) while preserving the original artist's style.

Analysis of artist embeddings via t-SNE revealed that the model naturally learns musical relationships, clustering similar genres and related artists together without explicit supervision.

Limitations

Despite its success, Jukebox faces significant computational hurdles. Sampling is extremely slow, requiring approximately 9 hours of GPU time to generate one minute of audio. Additionally, while the model is coherent over minutes, it lacks an explicit understanding of large-scale musical forms like repeating verse-chorus structures. The output also contains audible artifacts, particularly in higher frequencies.

Summary updated

BibTeX
@misc{dhariwal2020jukebox,
  author = {Prafulla Dhariwal and Heewoo Jun and Christine Payne and Jong Wook Kim and Alec Radford and Ilya Sutskever},
  title = {{Jukebox: A Generative Model for Music}},
  year = {2020},
  eprint = {2005.00341},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.00341},
}
Figure