Deep-speare: A Joint Neural Model of Poetic Language, Meter and Rhyme

Jey Han Lau, Trevor Cohn, Timothy Baldwin, Julian Brooke, Adam Hammond

TL;DR

Deep-speare is a joint neural architecture that generates Shakespearean sonnet quatrains by simultaneously modeling language, rhyme, and meter in an unsupervised fashion. While the model generates verses with near-perfect form that easily fool crowd workers, expert evaluation reveals a stark truth: focusing strictly on rigid structural constraints can actually degrade the readability and emotional depth of the generated poetry.

What Problem Does This Paper Address?

Generating poetry automatically requires balancing semantic meaning (content) with strict structural constraints like rhyme and rhythm (form). Previous approaches relied heavily on hardcoded pronunciation dictionaries or rigid heuristics to enforce these forms, often treating them separately from language generation.

Furthermore, evaluating AI-generated poetry is notoriously difficult. Crowd-sourced evaluations often fail to capture the nuances of genuine literary quality, as laypersons are easily distracted by surface-level features like a good rhyme scheme. The authors address these challenges by building a joint neural model that learns both content and form completely from raw text, while highlighting the critical need for expert human evaluation in creative NLP tasks.

Methods

The authors propose a multi-task learning architecture composed of three jointly trained components:

  1. Language Model: An LSTM encoder-decoder with an attention mechanism and a "selective encoding" filter to manage preceding context lines. Crucially, it generates words from right to left (reversing the line order) to make enforcing rhyme schemes easier, and incorporates character-level encodings to capture orthographic features.
  2. Pentameter Model: Designed to capture the alternating unstressed/stressed syllables of iambic pentameter. It uses a specialized attention network that enforces a monotonic focus on stress-producing characters, regularized by custom "repeat" and "coverage" losses to prevent the model from getting stuck on the same characters or skipping vowels.
  3. Rhyme Model: An unsupervised component that learns to identify rhyming words using a margin-based loss function. It takes sentence-ending word pairs from a quatrain and trains a forward character-level LSTM to maximize the cosine similarity of rhyming pairs relative to non-rhyming pairs.
Deep-speare joint architecture overview showing the language, pentameter, and rhyme models.

Datasets

  • BACKGROUND Dataset: A large corpus of 34 million words harvested from Project Gutenberg using the GutenTag tool. This was used to pre-train high-quality word embeddings.
  • SONNET Dataset: A newly curated dataset specifically filtered from the background poetry collection based on word and character statistics matching Shakespeare's 154 sonnets. It consists of 3,355 sonnets total, partitioned into Train (2,685 sonnets / 367K words), Dev (335 sonnets / 46K words), and Test (335 sonnets / 46K words).

Key Insights and Ideas

  • Vanilla LSTMs Learn Meter Implicitly: Surprisingly, a standard language model trained on sonnets captures iambic pentameter remarkably well without any explicit stress constraints. The expert rated the vanilla model's meter nearly identical to the full model.
  • Crowd Workers are Easily Fooled by Rhyme: In Turing-style tests, crowd workers relied almost exclusively on the presence of a rhyme scheme to judge whether a poem was human-written, completely ignoring meter and deeper meaning.
  • Form Over Substance Hurts Readability: The full model actually scored higher on strict adherence to meter and rhyme than actual human poets. However, this rigid perfection came at a cost: it restricted the language model so severely that readability and emotional impact plummeted.

Key Results

  • Component Performance: The joint model (LM**+PM+RM) achieved a test perplexity of 80.22, a significant drop from the vanilla baseline's 90.13. The unsupervised rhyme model achieved an impressive F1 score of 0.91, outperforming traditional EM-based baselines (0.71).
  • Crowd Evaluation: When pitted against human poetry, the full model achieved a crowd worker discrimination accuracy of 0.532 (where 0.50 is perfectly indistinguishable), meaning lay evaluators could not reliably tell the machine-generated quatrains apart from human ones.
  • Expert Evaluation: An English literature professor rated the poems on a 1–5 scale. The full model beat humans on Meter (4.10 vs 3.87) and Rhyme (4.43 vs 4.10). However, humans vastly outperformed the model on Readability (4.80 vs 2.70) and Emotion (4.37 vs 2.90).
Character attention heatmaps showing the pentameter model accurately tracking the 10 iambic pentameter stresses across lines from Shakespeare's Sonnet 18.

Limitations and Future Work

While Deep-speare masters the local structural constraints of poetry, it struggles with global coherence, narrative arc, and emotional resonance. The authors note that future poetry generation research should move away from optimizing strict formal constraints like meter and rhyme—which neural networks have essentially solved—and instead focus on the much harder challenge of improving readability, metaphor, and emotional expression in poetic language.

Summary updated

BibTeX
@inproceedings{lau2018deep,
  author = {Jey Han Lau and Trevor Cohn and Timothy Baldwin and Julian Brooke and Adam Hammond},
  title = {{Deep-speare: A Joint Neural Model of Poetic Language, Meter and Rhyme}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=HJVUv2gO-B},
}
Figure