03 / RESEARCH scroll 000%

RESEARCH ·IEEE · RLG

RapGAN

用詞組級 roll-out 生成饒舌歌詞

Adversarial rap-lyric generation with phrase-level roll-out and attention rewards: roll out meaningful phrases, reward to the phrase boundary, and match weights rather than scores — plus a new dataset.

Scholar ↗ interactive — scroll to step through the method

Background

Some background on sequence GANs and the credit-assignment problem they face.

Generating text with a GAN means the generator writes a sequence one token at a time while a discriminator scores whole sentences. The catch is credit assignment: if a finished sentence scores badly, which word was to blame? The standard answer is roll-out — from each position, sample many possible completions to estimate that word's contribution — but rolling out entire sentences, word by word, is very expensive.

RapGAN targets rap-lyric generation and makes two moves. It rolls out at the phrase level rather than word by word — cheaper, and more meaningful since rap is organized by phrases — and it delivers an attention-based reward at every generation step, so feedback lands where it matters. Matching weights rather than raw scores stabilizes training, and the work also contributes a rap-lyric dataset.

▸ key terms

Sequence GAN — a GAN whose generator emits a sequence of tokens. Roll-out — sampling completions of a partial sequence to score it. Credit assignment — figuring out which token earned the reward. Policy gradient — the RL trick that passes a reward signal back through discrete text.

METHOD · PRO + AREGS
Generator Gθ · word-by-word Discriminator attention-LSTM generated ŷ reward → ∇J(θ) SeqGAN: roll out the whole sentence (MCTS) O(N) roll-outs every step — expensive using D(x,ŷ) directly → mode collapse, monotonous lyrics PRO · segment into meaningful phrases (TextRank) I am doing wonderful , thank you ρ′(y) = (p₁, p₂, …, p_T′) · meaningful phrases only drop meaningless cuts → preserve fluency reward only meaningful phrases roll out to phrase end t′_end — not sentence end streamlined training · faster, more fluent AREGS · attention-LSTM weights α α = softmax(wᵀ·tanh(H)) · r = αᵀH captures local phrases + global sentence semantics match attention weights, not D directly α* real α̂ gen S(α*, α̂) → reward cosine feature matching · prevents mode collapse STATE-OF-THE-ART RLG vs SeqGAN · MaliGAN · Ghost Writer DIV ORIG FLU + open 160k-song Chinese RLG dataset
SeqGAN rolls out entire sentences by MCTS at every step — expensive, and prone to mode collapse.
STEP 00 · the problem

Rolling out whole sentences is expensive

To reward a partial sequence, SeqGAN runs Monte-Carlo roll-outs to the end of the sentence at every generation step — computationally heavy.

And using the discriminator's score directly invites mode collapse: rap lyrics that all sound the same.

STEP 01 · PRO

Roll out meaningful phrases

Phrase Roll-Out segments each line into meaningful phrases with TextRank, ρ′(y) = (p₁…p_T′), instead of arbitrary or full-sentence cuts.

Meaningless fragments are filtered out, which keeps the generated lyric fluent.

STEP 02 · streamlined reward

Reward to the phrase boundary

Each phrase is rewarded only out to its own end step t′_end — not the end of the whole sentence. The roll-out is far cheaper while staying meaningful.

STEP 03 · AREGS

An attention-LSTM discriminator

The discriminator learns attention alignment weights α = softmax(wᵀ·tanh(H)), capturing both local phrase features and global sentence meaning across variable-length phrases.

STEP 04 · feature matching

Match the weights, not the score

Instead of the raw score D(x,ŷ), the generator is rewarded by the cosine similarity S(α*, α̂) between real and generated attention weights.

This feature-matching signal prevents mode collapse and lifts diversity and originality.

STEP 05 · the result

Better lyrics — and a dataset

RapGAN beats SeqGAN, MaliGAN and Ghost Writer on diversity, originality and fluency, validated against human evaluation.

It also releases an open 160,000-song Chinese rap dataset for future research.