Introduction
While Large Language Models (LLMs) have revolutionized creative text generation, they often struggle with "singability"—the intricate rhythmic and phonetic alignment between lyrics and melody. Most AI lyric generators produce plain text that, while semantically coherent, fails to respect musical prosody: the principle that stressed syllables should align with strong beats and long vowels with long notes. This misalignment forces composers and singers into tedious trial-and-error cycles to "fit" the words to a melody.
Presented at IJCAI-24, XAI-Lyricist addresses this gap by leveraging musical prosody to guide generation and providing visual, human-understandable explanations to assist singers in performance.
Methodology: Multi-Target Learning with Prosody Templates
The core of XAI-Lyricist is an encoder-decoder Transformer architecture designed for multi-target sequence generation. Rather than relying solely on a thematic prompt, the model uses a "prosody template" derived from the target melody.
The framework operates through four key components:
- Prosody Templates: These templates encode the melody's rhythm as a sequence of attributes: Strength (strong vs. weak beats) and Length (long vs. short notes).
- Multi-Target Learning: The model is trained to simultaneously predict four synchronized sequences: the lyric words, the number of syllables per word, syllable strength (stress patterns), and syllable length (vowel duration).
- Prosody Correction: To mitigate phonetic errors common in LMs, a post-processing step ensures the generated words' IPA stress patterns align perfectly with the intended melody.
- Visual Explanations: The system outputs a "piano roll" visualization. By color-coding notes based on strength and length and using phonetic markers, it shows singers exactly where each syllable should land.
Evaluation and Key Insights
The model was trained on a corpus of over 100,000 English pop song lyrics and evaluated using 210 sentences from low-popularity songs to ensure unbiased testing.
A significant finding was that prosody acts as a powerful regularizer. The "Vanilla" baseline (no prosody) often produced incoherent text because the mapping between melody and words was too ambiguous. In contrast, prosody templates provided a structural "skeleton" that improved both singability and linguistic fluency, resulting in a significantly lower Perplexity (4.76) compared to the baseline (37.50).
Furthermore, the authors introduced Prosody-BLEU, a new metric measuring the similarity between a melody's rhythm and a lyric's prosody. This metric showed a high correlation ($r = 0.77$) with human singability ratings, providing a robust computational tool for future research.
Human-Grounded Study Results
To validate the real-world utility of XAI-Lyricist, the researchers conducted a controlled study with 14 trained singers. The results demonstrated that musical prosody and visual explanations drastically improve performance efficiency.
- Singability Ratings: XAI-Lyricist achieved a 4.66/5 rating, while the Vanilla model scored only 1.68.
- Efficiency: Singers using the provided explanations completed 85.7% of trials in a single attempt, whereas they only succeeded on the first try 27% of the time with the Vanilla model.
- User Experience: Participants noted that the visual explanations allowed them to "detect rhythmic rises and falls" instantly, effectively acting as a "debugging" tool for lyrical flow.
Conclusion and Future Directions
XAI-Lyricist demonstrates that incorporating musical constraints into language models does more than just improve alignment—it enhances the overall quality of the generated content. While currently focused on English and 4/4 time signatures, future iterations could expand to diverse musical traditions and more complex syncopation. By providing explainable outputs, XAI-Lyricist moves AI from a "black box" generator to a collaborative tool that empowers songwriters and performers alike.
Summary updated