SongRewriter: A Chinese Song Rewriting System with Controllable Content and Rhyme Scheme

Yusen Sun, Liangyou Li, Qun Liu, Dit-Yan Yeung

TL;DR

SongRewriter is a novel AI system designed to rewrite Chinese song lyrics while ensuring they remain perfectly "singable" by maintaining the original rhythm. By using a multi-level masking strategy and a unique vowel-modeling approach, it allows users to control both specific keywords and complex rhyme schemes—including internal rhymes—outperforming existing models in both content quality and rhyming precision.

What Problem Does This Paper Address?

Generating lyrics is one thing; generating singable lyrics is another. For a song to be singable, the lyrics must align with the melody's rhythm. Traditionally, this requires complex melody-to-lyric alignment models, which are difficult to train because parallel datasets (melody + lyrics) are scarce.

Furthermore, most existing systems are "all or nothing"—they generate a whole song from scratch. They lack the flexibility to edit just a specific line or phrase (partial rewriting) while maintaining the context of the rest of the song. Finally, while most models focus on "end rhymes" (the last word of a line), they ignore "internal rhymes" (rhyming words within a line), which are crucial for high-quality songwriting.

Methods

SongRewriter uses a Transformer-based encoder-decoder architecture. To solve the singability problem without needing melody data, the authors rely on a clever observation: in Chinese, each character is exactly one syllable. By forcing the model to generate the same number of characters as the original lyrics, the new lyrics naturally fit the original melody's rhythm.

Key technical innovations include:

  • Multi-Level Randomized Masking: During training, the model learns to fill in blanks at three levels: token-level (words), sentence-level, and song-level. This allows it to handle any rewriting task, from fixing a single word to generating a full song.
  • Keyword Prompting: Users can provide specific keywords that the model must incorporate into the generated text.
  • Rhyme Control via Vowel Modeling: The system treats vowels as a separate input stream. By providing a "vowel template," users can dictate exactly where rhyming sounds should occur.
  • Reverse Language Modeling: To improve end-rhymes, the model generates sentences from right-to-left. This ensures the rhyming word is generated first, allowing the rest of the sentence to be built around it.
Figure 1: An overview of the proposed Chinese song rewriting system. Given an existing song, the users first mask the part(s) of the lyrics that they want to rewrite. Then, SongRewriter generates new lyrics corresponding to the masked fragments. Last, the rewritten lyrics are combined with the original melody to form a new song. During the generation, user can require the content to include specific keywords or control the rhyme scheme by setting the vowels of the output characters at specific positions.

Datasets

The model was trained using a three-stage pipeline:

  1. Pre-training: Used 15 million documents from Baidu Encyclopedia to learn general Chinese language patterns.
  2. Intermediate Fine-tuning: Used 330,000 Chinese proses to bridge the gap between formal encyclopedia text and creative writing.
  3. Domain Fine-tuning: Used a custom dataset of 154,000 Chinese lyrics crawled from the web.

Key Insights and Ideas

  • The Syllable Shortcut: Bypassing melody-text alignment by simply matching character counts is a highly effective "hack" for monosyllabic languages like Chinese.
  • Rhyming is Easier Backwards: In standard left-to-right generation, the model often "forgets" to rhyme by the time it reaches the end of a line. By reversing the order (as seen in Figure 2), the rhyme becomes the starting constraint rather than an afterthought.
  • Vowels as Constraints: By introducing a specific vowel-prediction loss ($L_v^t$), the authors turned rhyming from a hit-or-miss statistical probability into a controllable parameter.
Figure 2: The architecture of the proposed SongRewriter model. The inputs of the encoder consist of a keyword prompt and partially masked lyrics. The keywords in the prompt are extracted from the masked fragments during training. The decoder uses [G] as a start token and generates the masked tokens autoregressively. The text order is reversed for end rhyme modeling. The original lyrics is from Later by Rene Liu.

Key Results

SongRewriter was compared against strong baselines like GPT2 and SongNet.

  • Controllability: In keyword-conditioned tasks, SongRewriter achieved a Keyword Recall of 0.952, significantly higher than the ILM-Keyword baseline (0.851).
  • Rhyme Quality: The model achieved a Global Rhyme score of 0.812, outperforming SongNet (0.766) and GPT2 (0.723).
  • Human Evaluation: In blind tests by experts with musical backgrounds, SongRewriter scored 3.93/5.0 for rhyme quality, compared to 3.11 for SongNet.
Human evaluation results showing SongRewriter's superiority in fluency, coherence, and rhyme

Limitations and Future Work

The primary limitation is language-specific: the "one character = one syllable" rule is unique to languages like Chinese. For multisyllabic languages like English, the system would require a more complex syllable-level subword tokenizer.

Additionally, the authors note the ethical and legal complexities of song rewriting, emphasizing that their system is intended as a user-assist tool and that the copyrights of original lyrics must be respected. Future work may involve extending these techniques to other languages and exploring more complex musical structures beyond simple rhythm matching.

Summary updated

BibTeX
@inproceedings{sun2023songrewriter,
  author = {Yusen Sun and Liangyou Li and Qun Liu and Dit-Yan Yeung},
  title = {{SongRewriter: A Chinese Song Rewriting System with Controllable Content and Rhyme Scheme}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.814},
}
Figure