NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ERNIE-Music: Text-to-Waveform Music Generation with Diffusion Models

Pengfei Zhu, Chao Pang, Yekun Chai, Lei Li, Shuohuan Wang, Yu Sun, Hao Tian, Hua Wu

TL;DR

ERNIE-Music is a pioneering text-to-waveform generation framework that leverages conditional diffusion models to synthesize high-quality music directly from free-form natural language prompts. By training on a novel dataset of web-scraped music paired with user comments, the model achieves significantly better text-music relevance and audio quality than existing symbolic or tag-based methods.

What Problem Does This Paper Address?

Generating music from text typically falls into two camps: symbolic generation (like MIDI), which requires complex post-processing to sound like real instruments, and audio-based generation, which produces raw waveforms but often struggles with fine-grained control.

Furthermore, most existing conditional models rely on a narrow set of pre-defined "tags" (e.g., "Genre: Jazz, Tempo: Fast"). This limits creativity, as users cannot describe complex moods or scenarios. The authors identify a "lacuna" in the field: the direct synthesis of music waveforms from unrestricted, free-form textual prompts. The primary hurdles are the lack of large-scale parallel text-music datasets and the inherent difficulty of mapping high-level semantics to raw audio signals.

Methods

ERNIE-Music utilizes a conditional diffusion model operating in a continuous-time framework. Unlike standard GANs or VAEs, diffusion models learn to generate data by reversing a process that gradually adds noise to a signal.

The Architecture

The backbone of the model is a UNet consisting of 14 layers of stacked convolutional blocks and self-attention mechanisms.

  • Text Encoding: The model uses ERNIE-M, a pre-trained multilingual encoder, to transform free-form text (in languages like Chinese, English, or Japanese) into a sequence of vector representations.
  • Conditioning: The text information is integrated into the diffusion process in two ways:
  • Fusion: The text classification representation is fused with the timestep embedding to create a "text-aware" timestep.
  • Cross-Attention: The full text sequence representation is fed into the UNet’s self-attention blocks, allowing the model to capture global dependencies between the text description and the audio signal.
  • Training Objective: Instead of predicting the added noise directly, the model is trained to predict the velocity ($v_t$), a technique that has been shown to lead to more stable and higher-quality generation in continuous-time diffusion frameworks.
Figure 1: The overall architecture of text-to-music generation training. The text is input to the text encoder to obtain the sequence representation S, then S and the sampled music waveform (noise added) zt are input to the UNet to obtain the estimated volocity ˆvt, finally we calculate the L2 loss between ˆvt and the real volocity vt. For the input text, the original Chinese is “钢琴旋律的弦音,轻轻地、温柔地倾诉心中的遐想、心中的爱恋”.

Datasets

To solve the data scarcity problem, the authors curated a new dataset from the web. They observed that popular music platforms contain high-quality, top-voted user comments that often describe the instruments, genres, and moods of the tracks.

  • Web Music with Text Dataset: Contains 3,890 training samples and 204 test samples.
  • Format: 20-second clips sampled at 16kHz.
  • Weak Supervision: By using these "noisy" web comments as labels, the authors were able to build a functional parallel dataset without expensive manual annotation.

Key Insights and Ideas

  • Free-form Text > Tags: A major finding was that "End-to-End Text Conditioning" (using raw comments) outperformed "Music Tag Conditioning" (distilling comments into discrete tags). The authors argue that manual tag selection rules introduce noise and discard useful semantic information present in natural language.
  • Direct Waveform Synthesis: By generating waveforms directly, the model captures "performance attributes"—the subtle nuances of how an instrument is played—that symbolic models often miss.
  • Fusion Strategy: The authors compared concatenating vs. summing text and timestep embeddings. As shown in Figure 3, both performed similarly, leading them to choose element-wise summation for its simplicity.
Figure 3: The MSE results on the test set for two imple- mentations of the fusing operation.

Key Results

The authors conducted extensive human evaluations, hiring 10 listeners to score the generated audio for quality and relevance.

  • Text-Music Relevance: ERNIE-Music achieved a score of 2.43, significantly outperforming Mubert (1.85) and Text-to-Symbolic Music (2.05).
  • Audio Quality: Compared to Musika (a state-of-the-art waveform generator), ERNIE-Music scored 3.63 vs. 3.03.
  • Diversity: Qualitative analysis showed the model could generate everything from "light and comfortable" piano pieces to "passionate, fast-paced" guitar tracks based solely on the text prompt.
Figure 2: The spectrogram and waveform of generated music examples. The model can generate diverse music, including smoothing and cadenced (a, c) and fast-paced (b, d) rhythms. Text of (a, c): The piano piece is light and comfortable yet deeply affectionate. Text of (b, d): A passionate, fast-paced guitar piece.

Limitations and Future Work

Despite its success, the authors acknowledge several areas for improvement:

  • Fixed Length: The model is currently limited to generating 20-second clips due to computational constraints.
  • Generation Speed: Like most diffusion models, the iterative denoising process is relatively slow compared to GAN-based approaches.
  • Instrumental Only: The current training data consists primarily of instrumental music; the model cannot yet generate human vocals.
  • Inference Length: Altering the length of the music during the inference phase (without retraining) currently negatively impacts performance.

Summary updated

BibTeX
@misc{zhu2023ernie,
  author = {Pengfei Zhu and Chao Pang and Yekun Chai and Lei Li and Shuohuan Wang and Yu Sun and Hao Tian and Hua Wu},
  title = {{ERNIE-Music: Text-to-Waveform Music Generation with Diffusion Models}},
  year = {2023},
  eprint = {2302.04456},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.04456},
}
Figure