Rhyming-Couplet Completion Methods
- Rhyming-couplet completion is the task of generating a coherent second line from a given first line under explicit rhyme, symmetry, and syntax constraints.
- Techniques range from seq2seq models with enriched embeddings to reverse generation and constrained decoding, ensuring phonological and structural alignment.
- The approach is applied across languages using implicit, explicit, and revision-based methods to balance creativity, fluency, and formal correctness.
Rhyming-couplet completion is the task of generating a second poetic line from a given first line such that the completion satisfies a rhyme relation and remains coherent under line-level structural constraints. In the most direct formulation, the input is an upper or first line and the output is a lower or second line; in Chinese couplet generation the two lines “must have the same amount of words (Chinese characters),” positions should align syntactically, and the pair should remain cohesive in topic while matching rhythm, whereas English work often operationalizes the task as generating a second line whose last word rhymes with the last word of the first line (Chiang et al., 2021). Across recent work, the problem has been studied as sequence-to-sequence generation, decoder-only next-line prediction, instruction-conditioned generation, constrained decoding, template-based generation, and as a mechanistic testbed for forward-looking constraint representation in LLMs (Lo et al., 2022, Chakrabarty et al., 2022, Ma et al., 8 May 2026).
1. Task definition and formal structure
In Chinese couplet generation, the task is explicitly treated as a seq2seq problem “where we have two sequences with exactly the same number of words.” The implied formulation is: given an input character sequence , generate with (Chiang et al., 2021). This formulation makes length symmetry a hard property of the task rather than a downstream preference.
In English rhyme-oriented work, the same underlying problem is often reframed through line-ending control. One operationalization prompts a model with a first line ending in a rhyme anchor and requires completion of a second line whose final word satisfies , with rhyme defined via the CMU Pronouncing Dictionary as sharing the same stressed vowel and following consonant sequence (Ma et al., 8 May 2026). Another line of work treats the problem as next-line auto-completion: the query line is marked as user input and the generated line should share “syntactic, semantic and rap-specific characteristics” with that input, including rhyming (Bendali et al., 2024).
The task can also be embedded in more general conditional-generation interfaces. CoPoet trains encoder–decoder models on instruction–line pairs such as “Write a poetic sentence that ends in a word which rhymes with replace,” with cross-entropy on the target poetic line (Chakrabarty et al., 2022). This suggests that rhyming-couplet completion can be cast either as direct conditional generation from line 1, or as instruction following where line 1, its topic, and its rhyme target are verbalized as constraints.
2. Constraint structure: rhyme, symmetry, syntax, and semantics
Rhyming-couplet completion is rarely defined by rhyme alone. In Chinese couplets, the lower line is expected to match the upper line in length, grammatical structure, and rhythm; positions in the two lines “should be classified into the same category,” motivating explicit use of part-of-speech features (Chiang et al., 2021). The same paper emphasizes that the two lines may be semantically similar or contradicted, but must remain cohesive to the topic of the given top couplet.
Other work isolates rhyme as the principal formal signal. GPoeT-2, although developed for limericks, shows how rhyme can be learned implicitly from corpus structure when all training poems share a rhyme scheme and when line-final words are made prediction-salient through reverse modeling (Lo et al., 2022). Raply likewise relies on verse-only training data and line separators so that a decoder-only model can internalize per-line dependencies and generate rhyme-dense continuations without an explicit rhyme loss (Bendali et al., 2024).
Several systems replace implicit learning with explicit phonological or structural resources. The Spanish “literary rhyme generation” pipeline uses a rhyming dictionary distinguishing consonant rhyme and assonant rhyme, with groups derived from phonological transcription and stress position, and generates sentence pairs whose final words rhyme while remaining semantically influenced by a query word (Moreno-Jiménez et al., 2021). Sonnet-generation work based on CMUdict defines rhyme classes from the phonetic suffix beginning at the last stressed vowel and enforces rhyme as a hard constraint during beam search, which guarantees rhyme correctness under the dictionary mapping (Benhardt et al., 2018). Zero-shot sonnet generation similarly uses CMUdict to retrieve strict and slant rhyme candidates, then renormalizes the decoder distribution over the rhyme candidate set for rhyme-word selection (Tian et al., 2022).
A plausible implication is that the field separates into two broad views of constraint representation. One view treats rhyme, syntax, and structure as latent regularities recoverable from data and token order; the other encodes them as explicit symbolic objects such as phonetic rhyme classes, part-of-speech templates, or stress-pattern filters.
3. Modeling paradigms
The dominant modeling paradigms differ chiefly in where the rhyme decision is made and how much of the couplet structure is explicit in the architecture.
| Paradigm | Representative papers | Core mechanism |
|---|---|---|
| Seq2seq with enriched embeddings | (Chiang et al., 2021) | Generate lower line from upper line with glyph, Pinyin, POS, and AnchiBERT embeddings |
| Reverse or rhyme-fronted LM | (Lo et al., 2022, Pasini et al., 2024) | Move line-ending information to the start of generation |
| Explicit constrained or template-based generation | (Moreno-Jiménez et al., 2021, Benhardt et al., 2018, Tian et al., 2022) | Choose or constrain rhyme words, then fill structure under grammar or meter constraints |
TransCouplet is a Transformer-based seq2seq system for Chinese couplets with four variants—AnchiDecoder, AnchiTransformer, FusionDecoder, and FusionTransformer—and the best-performing model is FusionDecoder (Chiang et al., 2021). Its input embeddings combine glyph, Pinyin, POS, and contextual embeddings from AnchiBERT, and the authors use the last hidden layer outputs from AnchiBERT as contextual embeddings. Both encoder and decoder, when present, have 6 layers and 12 attention heads. The architectural deviation from a vanilla Transformer lies primarily in the custom embedding layer rather than in the attention stack itself.
GPoeT-2 fine-tunes GPT-2 on limericks using two LLMs: a forward LM for fluent opening lines and a reverse LM trained on per-line reversed token order so that original line endings become early tokens (Lo et al., 2022). For couplet completion, the transferable idea is immediate: if line 1 is given, reverse its tokens, feed the reversed line into the reverse LM, and generate line 2 backward from the rhyme word. Raply instead keeps ordinary left-to-right generation and depends on line separators plus verse-only training data to induce rhyme-rich next-line completions (Bendali et al., 2024).
A more recent encoder–decoder alternative is the “Last Word First” strategy. Instead of reversing the line, the model prepends the last word at the beginning of each verse, separated from the surface line by a special token <SEP>, while maintaining left-to-right word order for the line itself (Pasini et al., 2024). The decoder is therefore trained to generate sequences of the form A: lastword <SEP> line <EOS>, and at generation time the rhyme schema token can be forced. This preserves compatibility with pretrained encoder–decoder PLMs such as T5 and mT5 while still making the rhyme decision before the model commits to the rest of the line.
Instruction-tuned encoder–decoder models provide a different form of control. CoPoet uses T5/T0-family models and a dataset of 873,574 instruction–poem-line pairs, including “End,” “Rhyme,” “Subject,” and “Next Sentence” templates, enabling commands such as “Write a next sentence in a poem given the previous sentence ... and ending in a word which rhymes with ...” (Chakrabarty et al., 2022). This suggests that couplet completion can be represented as a compositional instruction problem rather than a fixed-format generation problem.
4. Explicit control, revision, and learned rhyme structure
A major distinction in the literature concerns whether rhyme is enforced symbolically, induced implicitly, or revised after drafting.
Template-based Spanish rhyme generation uses “Partially Empty Grammatical Structures” derived from real literary sentences, replaces lexical slots with semantically guided candidates from Word2Vec, re-ranks them with a bigram LLM, and enforces rhyme on the final word of the second sentence through the RIMAX module (Moreno-Jiménez et al., 2021). The final rhyme word is scored by averaging a semantic-plus-fluency score with a rhyme-semantic score , . This design keeps grammar largely inherited from templates and pushes rhyme control to the final lexical choice.
Sonnet-generation work by constrained backward decoding similarly fixes rhyme words first, then builds each line backwards from those words while pruning candidates that violate meter or part-of-speech restrictions (Benhardt et al., 2018). In that framework, the search objective is effectively language-model likelihood subject to hard filters on rhyme, meter, and local syntactic well-formedness.
Zero-shot sonnet generation introduces a multi-stage hierarchy: content planning, rhyme-word completion under a constrained T5 decoder, an aesthetics or polishing module that adds imagery and similes, and finally constrained right-to-left decoding with GPT-Neo-2.7B so that fixed rhyme words are generated first (Tian et al., 2022). Although designed for sonnets rather than couplets, its decomposition into planning, rhyme selection, and constrained realization is directly applicable to two-line generation.
Generate-and-revise approaches move formal correction into an iterative post-drafting stage. The “Generate and Revise” framework trains a conditional seq2seq generator, a detector that chooses which word to edit, and a prompter that suggests replacements; revision is optimized with PPO under a shortest-path reward where non-terminal steps receive and the first state satisfying the target rhyme scheme receives 0 (Zugarini et al., 2021). The paper evaluates this mainly on rhyme-scheme matching and shows that PPO improves reward substantially relative to vanilla policy gradient. A plausible implication is that rhyming-couplet completion can be decomposed into draft generation followed by targeted line-ending repair or more general lexical revision.
Adversarial learning offers a further alternative. “Learning Rhyming Constraints using Structured Adversaries” trains a hierarchical generator jointly with a discriminator that can only inspect a learned similarity matrix over line-ending words, where 1 is the cosine similarity between character-level encodings of ending words (Jhamtani et al., 2019). The discriminator applies a two-layer 2D CNN over this matrix, so rhyme is learned as structure over line endings rather than through any phonetic dictionary. On limericks and sonnets, the resulting model greatly improves sampling efficiency for rhyme-valid poems and learns a rhyme similarity space without explicit phonetic supervision. For a two-line couplet, the same construction collapses to the similarity between the two line-ending words.
5. Data resources and evaluation practice
Datasets vary sharply by language and form, but several corpora recur as practical foundations for rhyming-couplet completion.
TransCouplet uses the Chinese Couplets Dataset from v-zich/couplet-clean-dataset, with about 740,000 couplets and sensitive words removed; units are Chinese characters and punctuation rather than segmented words (Chiang et al., 2021). GPoeT-2 uses OEDILF with 113,722 approved limericks total, and reports lexical-diversity statistics on a subset of 72,432 limericks (Lo et al., 2022). The Spanish rhyme-generation system trains on MegaLite-Es, containing 5,075 Spanish literary books, about 15 million sentences and 212 million tokens, and evaluates on 44 generated rhyming sentence pairs (Moreno-Jiménez et al., 2021). Raply builds rap corpora from Genius, yielding a Slurs corpus of 15,282 songs and a Mitislurs corpus of 10,748 songs after profanity mitigation, with only verses retained because verses contain “the most rhyming pieces” (Bendali et al., 2024). CoPoet’s instruction corpus contains 873,574 instruction–line pairs, split into 808,180 train and 65,394 validation (Chakrabarty et al., 2022). The multilingual encoder–decoder rhyme-control framework contributes a dataset spanning English and 12 additional languages, with approximately 2.6 million train paragraphs in the multilingual setting (Pasini et al., 2024).
Evaluation remains heterogeneous. TransCouplet reports BLEU and “Bigram Perplexity,” with FusionDecoder obtaining BLEU 2 and Bigram Perplexity 3, the best among the four model variants (Chiang et al., 2021). GPoeT-2 emphasizes syntactical correctness, Type-Token Ratio, and subject continuity based on BERT noun-centroid distances or WordNet path similarity; it also defines a “rhyming distance” over limerick rhyme pairs rather than using rhyme to control decoding (Lo et al., 2022). Raply uses rhyme density computed from IPA transcriptions via eSpeak, where rhyme density is the average length of the longest matching vowel sequence near each token; generated rhyme density reaches 0.8 for GPT-2.Mitislurs, compared with 0.7 for GPT-2.Slurs and 0.17 for Ghostwriter (Bendali et al., 2024). The multilingual LWF framework defines Rhyming Precision over pairs of lines that are supposed to rhyme and reports English Rhyming Precision as high as 89.79 for the pretrained LWF model with sampling and reranking, versus 52.5 for the reverse-language-model baseline under the same decoding regime (Pasini et al., 2024). CoPoet evaluates instruction satisfaction directly; in human evaluation, T5-11B-poem reaches 77.6% success on compositional instructions, compared with 55.2% for few-shot InstructGPT (Chakrabarty et al., 2022).
Human evaluation is frequently limited or absent. TransCouplet provides qualitative examples but no formal human protocol (Chiang et al., 2021). The Spanish rhyme pipeline uses six literature experts and reports that rhyme was perceived in 61% of generated pairs, while the semantic relation between the two rhyming words was usually judged “low” (Moreno-Jiménez et al., 2021). CoPoet and the zero-shot sonnet framework conduct more systematic human studies, and both report that rhyme and stronger poetic form tend to increase preference (Chakrabarty et al., 2022, Tian et al., 2022).
6. Mechanistic interpretation, limitations, and open directions
Rhyming-couplet completion has recently become a controlled setting for mechanistic analysis of forward planning in LLMs. “Where’s the Plan?” uses the task to probe whether models represent the future rhyme at the boundary between lines before it is generated (Ma et al., 8 May 2026). Across Qwen3, Gemma-3, and Llama-3 at multiple scales, linear probes show that future-rhyme information is decodable at the newline and that the signal strengthens with scale. However, activation patching reveals a sharper distinction between decodability and causal use: only Gemma-3-27B shows a genuine handoff in which the causal driver of rhyme migrates from the rhyme word to the line boundary around layer 30. In every other tested model, the last rhyme word remains the primary causal anchor throughout generation despite strong probe signal at the newline.
That result bears directly on how current systems should be interpreted. A decodable rhyme plan at a structural token is not, by itself, evidence that the model uses that token as a planning site (Ma et al., 8 May 2026). This suggests caution when attributing explicit planning behavior to next-line poetic generation solely from probing results.
Several limitations recur across the literature. Many systems do not formalize rhyme, tone, or structural parallelism directly in the loss and instead rely on data and feature design (Chiang et al., 2021). Metrics such as BLEU, perplexity, or even rhyme density do not fully capture couplet-specific well-formedness, especially when many valid continuations exist for a single first line (Chiang et al., 2021, Bendali et al., 2024). Reverse modeling improves rhyme control but can weaken global coherence, whereas forward modeling preserves fluency but often under-enforces rhyme (Lo et al., 2022). Template and dictionary systems preserve grammar and guarantee rhyme more reliably, but their syntactic variety is bounded by the template inventory (Moreno-Jiménez et al., 2021). Reinforcement-learning revision systems optimize target formal properties but, in the reported setup, do not include explicit rewards for semantic continuity or fluency (Zugarini et al., 2021).
A plausible implication is that the field is converging on hybrid solutions rather than a single canonical architecture: pretrained conditional generators for semantic adequacy, explicit rhyme-fronting or rhyme-word control for end-word planning, phonological post-checks or structured reranking for precision, and constraint-aware revision or decoding when strict formal correctness is necessary. Within that synthesis, rhyming-couplet completion remains a compact but demanding benchmark because it concentrates long-range phonological dependence, line-level syntax, and topical cohesion into a single next-line prediction problem.