TL;DR
This paper introduces DeepRapper, a novel Transformer-based system for generating rap lyrics that explicitly models both rhyme and rhythm. By creating a new dataset of rap songs with aligned lyrics and beats, and employing a reverse-order generation strategy with rhyme constraints, DeepRapper achieves state-of-the-art results in generating creative and high-quality rap.
What Problem Does This Paper Address?
Generating compelling rap lyrics is a complex task that goes beyond simply creating coherent text. Rap music is characterized by intricate rhyme schemes, often involving multiple consecutive words (N-grams), and a crucial alignment with rhythmic beats. Previous research in automatic rap generation has largely focused on lyric coherence and rhyme, often neglecting the rhythmic aspect, which is fundamental to rap performance. This oversight means that existing systems produce lyrics that might rhyme but lack the essential rhythmic structure to be truly "rapped." The core challenge addressed here is the simultaneous modeling of both rhyme and rhythm in rap generation, a feat previously unachieved due to the lack of suitable datasets and appropriate modeling techniques.
Methods
DeepRapper employs a Transformer-based autoregressive language model, a standard architecture for sequence generation. However, it introduces several key innovations:
- Data Mining Pipeline: Recognizing the absence of rap datasets with aligned lyrics and rhythmic beats, the authors developed a pipeline to automatically extract this information. This involves crawling rap songs, separating vocals from accompaniment, aligning vocals with lyrics at the phoneme level to get word timestamps, detecting beat timestamps from the accompaniment, and finally aligning words and beats.
- Reverse-Order Language Model: To better capture rhyme patterns, which typically occur at the end of sentences, the model generates lyrics in reverse order (right-to-left). This allows the model to easily identify and control the rhyming words at the beginning of the reversed sequence.
- Rhyme Representation: To enhance rhyme modeling, the system incorporates vowel embeddings (based on Pinyin) and intra-sentence relative positional embeddings. Sentence embeddings are also used to differentiate between sentences.
- N-gram Rhyme Constraint: Unlike previous methods that might only consider single-word rhymes, DeepRapper explicitly models N-gram rhymes (rhymes involving multiple consecutive words). During inference, a rhyme constraint is applied to encourage the generation of sequences that maintain rhyme patterns across multiple tokens.
- Beat Modeling: Rhythmic beats are modeled by inserting a special
[BEAT]token into the lyric sequence, aligning it with the corresponding word. Additionally, the system incorporates tokens to represent different beat frequencies ([S], [M], [F]) to capture variations in rap tempo. - Pre-training: To leverage large amounts of data, the model is pre-trained on two additional datasets: non-rap songs with aligned beats (D-SONG) and pure lyrics without beats (D-LYRIC), before being fine-tuned on the rap dataset.
Datasets
The paper introduces a newly mined dataset called D-RAP, which contains rap songs with aligned lyrics and rhythmic beats. This dataset was created using the authors' data mining pipeline.
In addition to D-RAP, the authors also created and used two other datasets for pre-training:
- D-SONG: A dataset of non-rap songs with aligned beats.
- D-LYRIC: A dataset of pure lyrics without aligned beats.
The statistics for these datasets are provided, with D-RAP containing 16,246 songs and 832,646 sentences, D-SONG with 52,737 songs and 2,083,143 sentences, and D-LYRIC with 272,839 songs and 9,659,503 sentences.
Key Insights and Ideas
- Rhythm is Crucial for Rap: The paper strongly emphasizes that ignoring rhythmic beats renders rap generation incomplete. The creation of a beat-aligned dataset is a significant step towards addressing this.
- Reverse-Order Generation for Rhyme: Generating lyrics from right to left is a clever way to simplify the modeling of end-of-sentence rhymes, making them more predictable and controllable.
- N-gram Rhymes are Key: The authors highlight that rap's complexity lies in its multi-word rhyme schemes, and their proposed constraint mechanism effectively captures this.
- Pre-training Boosts Performance: The significant improvements seen with pre-training on larger, albeit less specific, datasets underscore the power of transfer learning in this domain.
Key Results
- Objective Evaluation: DeepRapper significantly outperforms baseline models in perplexity (PPL), rhyme accuracy (RA), and rhyme density (RD). For instance, its RA is 66.95%, compared to 39.59% for a pre-trained baseline.
- Subjective Evaluation: Human evaluators rated DeepRapper's generated raps higher across all metrics: theme, fluency, rhyme quality, and rhyme diversity. Scores for DeepRapper were consistently higher than baselines, indicating more creative and human-like output.
- N-gram Rhyme Performance: Ablation studies show that removing rhyme modeling drastically reduces rhyme accuracy and density. The N-gram rhyme metric (Combo-N) demonstrates DeepRapper's superior ability to generate consecutive rhymes.
- Beat Modeling Effectiveness: While not explicitly quantified with a single "beat accuracy" metric in the main comparison, the paper shows that DeepRapper with beat frequency control achieves better beat generation performance as measured by Wasserstein distance for beat interval distributions.
Limitations and Future Work
- Dataset Size: While the authors created a large dataset, they acknowledge that it might not fully utilize the potential of pre-training, suggesting the need for even larger datasets in the future.
- Model Bias: The authors recognize that training datasets can contain biases, which may lead to model bias. They encourage future research into mitigating such issues.
- Future Work: The authors suggest extending their work to build a rap singing system that can perform the generated raps according to the modeled rhymes and rhythms. They also propose exploring multilingual DeepRapper.
Summary updated