Music Consistency Models

Zhengcong Fei, Mingyuan Fan, Junshi HuangarXiv 2024

TL;DR

MusicCM adapts consistency models to text-to-music generation, slashing the required sampling steps from 50 down to just 4. This enables high-quality, long-form music synthesis at nearly 60x real-time speed (generating 1 minute of music in ~1.2 seconds) while maintaining competitive audio fidelity and actually reducing the risk of training data plagiarism.

What Problem Does This Paper Address?

State-of-the-art text-to-music models typically rely on diffusion, a process that generates data by iteratively removing noise. While effective, this is slow; generating a high-quality clip often requires 50 or more sequential steps (e.g., using DDIM sampling). This high computational cost makes real-time applications—like interactive music generation for games or live performance—virtually impossible.

While "consistency models" have recently solved this speed bottleneck for images and video, applying them to music is non-trivial. Music requires high temporal coherence (rhythm and structure) and spectral detail that can easily be lost during the "distillation" process used to speed up these models.

Methods

The authors introduce MusicCM (Music Consistency Models), which uses three key strategies to bridge the gap between speed and quality:

  1. Consistency Distillation: They take a pre-trained "teacher" model (MusicLDM) and train a "student" model to map any point on a noise-to-data trajectory directly to the origin. This allows the student to generate a sample in a single step, or a few steps for better quality.
  2. Adversarial Discriminator: To combat the "blurriness" often found in distilled models, they add a discriminator based on the AudioMAE architecture. This forces the model to generate mel-spectrograms that stay on the manifold of "authentic" music, preserving sharp spectral details.
  3. Shared Restricted Process: To generate long, coherent tracks (beyond the standard 10-second window), they use a parallel restriction process. They take overlapping "crops" of a long mel-spectrogram, compute denoising directions for each in parallel, and then fuse them using a global least-squares optimization. This ensures that the transitions between segments are seamless and musically consistent.
Figure 1: Overview of music consistency models. Given a source music mel-spectrogram x0, a forward diffusion operation is first performed to add noise to the music. Then, the noised xn+k is entered into the student and teacher model to predict music clips. ˆxn is estimated by the teacher model and fed into the EMA student model. To learn self-consistency, a distillation loss is imposed to constrain the output of the two student models to be consistent, and an adversarial loss is used to fool a discriminator which is trained to distinguish the generated samples xpred 0 from real music x0. The whole consistency distillation is conducted in the latent space, and conditional guidance is omitted for ease of presentation. The teacher model is a music diffusion model, and the student shares the same network structure as the teacher model and is initialized with the parameters of the teacher model.

Datasets

The model was trained and evaluated using:

  • Audiostock: 9,000 music tracks (approx. 455 hours) with detailed text descriptions.
  • MagnaTagATune: 5,000 additional clips used to augment the diversity of musical styles and emotional tags.
  • Evaluation: A 1,000-track test set from Audiostock was used to compare MusicCM against baselines like Riffusion, MuBERT, and AudioLDM.

Key Insights and Ideas

  • Adversarial Loss is Essential: The authors found that distillation alone produces blurry mel-spectrograms. The adversarial loss acts as a "quality guardrail," ensuring that even with very few steps, the output sounds like real music rather than filtered noise.
  • The 4-Step Sweet Spot: While 1-step generation is possible, the quality jumps significantly at 4 steps, reaching a point where it is quantitatively and qualitatively competitive with 50-step diffusion models.
  • Improved Novelty: Interestingly, MusicCM showed lower similarity to the training data than its teacher model (MusicLDM). This suggests that the distillation process might help the model generalize better, reducing the risk of "plagiarism" or direct copying of training samples.
  • Global Coherence via Optimization: By treating long-form generation as a global optimization problem across local crops, the model avoids the "drifting" or disjointed transitions common in other long-form audio generation techniques.

Key Results

  • Inference Speed: On an NVIDIA A100 GPU, MusicCM can generate a one-minute music clip in just 1.2 seconds. For a standard 10-second clip, latency drops from 2.19s (MusicLDM) to 0.37s.
  • Quantitative Parity: At 4 steps, MusicCM achieves a Frechet Distance (FD) and Inception Score (IS) nearly identical to the 50-step baseline.
  • Qualitative Superiority: In subjective listening tests, human subjects rated MusicCM's 60-second clips higher in quality and relevance than the original MusicLDM.
Figure 3: Qualitative visualization results under different inference steps. Larger steps generally yield better quality and time continuity of music. Importantly, our MusicCM can produce plausible results with fewer steps or even only one step.

Limitations and Future Work

  • Teacher Dependency: MusicCM is a distillation method, meaning its upper-bound quality is largely dictated by the pre-trained teacher model. It cannot easily "fix" fundamental flaws in the teacher's understanding of music.
  • Data Availability: The distillation process works best when the student has access to the same training data as the teacher, which may not always be publicly available for proprietary models.
  • Future Directions: The authors plan to explore more advanced discriminator architectures and investigate how to combine "teachers" from different domains (e.g., speech and music) into a single consistency model.

Summary updated

BibTeX
@misc{fei2024music,
  author = {Zhengcong Fei and Mingyuan Fan and Junshi Huang},
  title = {{Music Consistency Models}},
  year = {2024},
  eprint = {2404.13358},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.13358},
}
Figure