Moûsai: Efficient Text-to-Music Diffusion Models

Flavio Schneider, Ojasv Kamal, Zhijing Jin, Bernhard Schölkopf

Introduction

Generating high-fidelity music from natural language descriptions presents significant challenges due to the high dimensionality of audio and the complex temporal dependencies of musical structure. Existing text-to-audio systems often struggle with limited duration, high computational costs, and poor controllability. Moûsai addresses these issues through a novel cascading two-stage latent diffusion architecture capable of producing 48kHz stereo music in real-time on consumer-grade GPUs.

Methodology

The Moûsai framework utilizes a two-stage process to bridge the gap between text and high-fidelity audio.

Stage 1: Diffusion Magnitude-Autoencoding (DMAE)

Rather than operating on raw waveforms, which are difficult to compress, Moûsai processes magnitude spectrograms. The DMAE compresses these representations by a factor of 64x into a compact latent space. While phase information is discarded during encoding, the diffusion process effectively reconstructs realistic phase during decoding, ensuring high-quality audio reconstruction.

Stage 2: Text-Conditioned Latent Diffusion (TCLD)

The second stage generates the compressed latent representations conditioned on text embeddings. Moûsai employs a frozen T5 language model for text extraction and utilizes classifier-free guidance (CFG) to ensure strong alignment between the generated audio and the user's prompt.

Overview of the Moûsai cascading architecture, showing the flow from text description to final audio output through the TextEncoder, DiffusionGenerator, and DiffusionDecoder.

Architectural Innovation: The 1D U-Net

A key contribution of Moûsai is the use of a specialized 1D U-Net architecture. Unlike the 2D U-Nets common in image generation, this 1D variant treats frequency bins as channels, optimizing the model for sequence data. This design choice results in significant speedups and reduced memory overhead. The architecture incorporates ResNet blocks, attention layers for capturing long-range dependencies, and cross-attention for text conditioning.

Detailed view of the 1D U-Net block and its internal components (R, M, I, A, C), which facilitate efficient processing of audio sequences.

Dataset and Training

The models were trained on the TEXT2MUSIC dataset, a newly curated collection of 50,000 high-quality (48kHz stereo) text-music pairs totaling 2,500 hours. The dataset spans diverse genres and uses metadata-based prompts. To improve long-term structural coherence, the authors used positional prompt engineering (e.g., "1 of 4") to guide the model through multi-minute compositions.

Performance and Results

Moûsai demonstrates superior efficiency and quality compared to existing baselines:

  • Efficiency: It achieves a Real-Time Factor (RTF) of 1.14 on a single consumer GPU, generating 43 seconds of music in approximately 49 seconds—nearly 5x faster than the Riffusion model.
  • Audio Quality: In Fréchet Audio Distance (FAD) evaluations, Moûsai achieved a score of 0.00015, an order of magnitude better than Riffusion (0.0018) and Musika (0.0020).
  • Text Alignment: CLAP scores indicate that Moûsai (0.13) provides more than double the text-to-audio relevance of Riffusion (0.06).

Conclusion

Moûsai represents a significant step forward in accessible, high-quality text-to-music generation. By combining magnitude-based latent diffusion with an efficient 1D U-Net architecture, the model enables real-time generation of diverse musical content, providing a powerful tool for researchers and creators alike.

Summary updated

BibTeX
@inproceedings{schneider2024mousai,
  author = {Flavio Schneider and Ojasv Kamal and Zhijing Jin and Bernhard Schölkopf},
  title = {{Moûsai: Efficient Text-to-Music Diffusion Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.437},
}
Figure