Unsupervised Melody-Guided Lyrics Generation

Yufei Tian, Anjali Narayan-Chen, Shereen Oraby, Alessandra Cervone, Gunnar A. Sigurdsson, Chenyang Tao, Wenbo Zhao, Tagyoung Chung, Jing Huang, Nanyun PengarXiv 2023 · DOI

Introduction

Automatic songwriting is often considered a "holy grail" in creative AI. However, it faces significant hurdles: the scarcity of high-quality, aligned melody-lyric datasets and the cross-modal complexity of aligning linguistic stress with musical rhythm. Existing "Melody-to-Lyric" (M2L) models frequently produce "cropped" sentences or nonsensical syllables that are difficult to sing. Furthermore, most models offer little control over the content of the lyrics, limiting their utility for actual songwriters.

To overcome these challenges, researchers developed LYRA, a hierarchical framework that generates high-quality, topic-relevant lyrics for a given melody without ever training on paired melody-lyric data. By disentangling text training from melody-guided inference, LYRA leverages the power of Pre-trained Language Models (PTLMs) while adhering to musical constraints.

The LYRA Framework

The core innovation of LYRA is its unsupervised approach, which separates the creative writing process from musical constraints. This prevents the "garbage in, garbage out" problem associated with small, noisy datasets.

The hierarchical architecture of LYRA, illustrating the flow from input keywords to a structured plan and finally to melody-aligned lyrics.

1. Training Phase (Text-Only)

LYRA learns from a large corpus of text lyrics (approximately 38,000 songs) using two primary modules:

  • Input-to-Plan: A BART-large model that transforms a title, genre, and keywords into a line-by-line plan.
  • Plan-to-Lyrics: A GPT-2 Large model that converts the plan into full sentences. This module is trained via multi-task learning to control syllable counts, ensuring the model can write to a specific "syllable budget."

2. Inference Phase (Melody-Guided)

During inference, a melody is converted into constraints:

  • Segment Alignment: Matching the number of notes in a phrase to the number of syllables in a line.
  • Rhythm Alignment: Following the "stress-duration rule," where longer notes align with stressed syllables.

During decoding, the model penalizes candidate words that violate these rhythmic constraints, allowing for precise control over the final output's singability.

Key Results

LYRA significantly outperforms supervised models in rhythmic alignment and human-perceived quality. A key technical insight was that training on "unnatural" tasks (e.g., generating sentences with specific per-word syllable counts) improved the success rate of hitting target syllable counts from approximately 23% to over 93%.

Quantitative evaluation of LYRA against baselines across topic relevance, diversity, fluency, and music alignment.

As shown in the evaluation table, LYRA with "hard rhythm" constraints achieved a 89.5% stress-duration alignment score, significantly higher than the state-of-the-art supervised model, SongMASS (58.8%), and even the human ground truth (73.3%). In human evaluations, LYRA was rated significantly higher than baselines in singability, intelligibility, and coherence, proving that paired data is not necessary to write lyrics that fit music perfectly.

Conclusion

LYRA demonstrates that unsupervised learning is a viable and effective path for melody-to-lyric generation. By focusing on note duration as the primary driver of "breathability" and using multi-task learning for syllable control, the model produces fluent, singable lyrics that respect musical structure. Future work will focus on refining rhyme schemes and capturing more nuanced artist styles to further bridge the gap between AI and human creativity.

Summary updated

BibTeX
@misc{tian2023unsupervised,
  author = {Yufei Tian and Anjali Narayan-Chen and Shereen Oraby and Alessandra Cervone and Gunnar A. Sigurdsson and Chenyang Tao and Wenbo Zhao and Tagyoung Chung and Jing Huang and Nanyun Peng},
  title = {{Unsupervised Melody-Guided Lyrics Generation}},
  year = {2023},
  eprint = {2305.07760},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.07760},
}
Figure