All models

audiocraft.MusicGen-melody

MusicGen-Melody generates music from a text prompt and a reference melody with one transformer over EnCodec tokens.

Audio and speech · 1,920 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (116 KB)

Open in a new tab

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

Parameters
1.6B
Operations
1,920
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2023
Cited by
224 (as of 22 October 2026)
Authors
Jade Copet, Felix Kreuk, Itai Gat and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3564
Graph hash
03ad958cb4fe6050cfcf93acd4057e136ece8d34791e2b66c1f082be8c404d93
Skeleton hash
b1acf195f1a5a73c4420a83bb1f410bb271d532423c1fc831fa5a5e17d7dd3a4
Architecture hash
f3865422400228a6cf873934e113839dbad909918293aaeb993b33a703a1cb83
Diagram SHA-256
ae037d5d98e64ffcf7a985ff8a5aa94f836a6a6ea4994ec3e7bc4827c44b1e7a
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

About this model's family

MusicGen-Melody is a music generation model that produces audio from a text description together with a melody taken from a reference recording. It is the melody-guided variant of MusicGen, a single stage autoregressive Transformer trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz. It matters because a single-stage model with token interleaving removes the need to cascade several models.

A small delay between the codebooks lets the model predict them in parallel, so one second of audio needs only 50 autoregressive steps. The melody conditioning is provided to the transformer as a prefix of its input rather than through cross-attention. The melody is represented by a chromagram reduced to its dominant time-frequency bin at each step, an information bottleneck that keeps the model from copying the reference. This melody conditioning is unsupervised and needs no annotated melody data.

This page describes the 1.5B-parameter melody model. The model card lists sizes of 300M, 1.5B and 3.3B parameters. On the MusicCaps benchmark the card reports Fréchet Audio Distance at 4.93 for this checkpoint, as a result at the time. Vocals were removed from the training data, and the card notes the model is not able to generate realistic vocals.

Key idea. MusicGen-Melody generates music from text and a reference melody with a single transformer over interleaved EnCodec codebooks, using unsupervised chromagram conditioning.

  • music generation
  • text-to-music
  • melody conditioning
  • chromagram
  • audio codec tokens
  • codebook interleaving
  • autoregressive
  • language model

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{copet2024simplecontrollablemusicgeneration,
      title={Simple and Controllable Music Generation}, 
      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},
      year={2024},
      eprint={2306.05284},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2306.05284}, 
}