Zero-shot Sonnet Generation with Discourse-level Planning and Aesthetics Features

Yufei Tian, Nanyun Peng · DOI

Abstract

Generating high-quality poetry remains a significant challenge for large language models, requiring a delicate balance between discourse-level coherence and rigid formal constraints. We present Zest, a framework designed to generate full-length Shakespearean and Petrarchan sonnets without being trained on poetic corpora. By disentangling logical planning from poetic constraints, Zest leverages prose-based learning and specialized decoding to produce sonnets that outperform state-of-the-art baselines in coherence and poetic quality.

Introduction

Poetry generation is often considered a "boss level" task for artificial intelligence. Unlike standard prose, a sonnet requires a complex combination of global narrative coherence—telling a logical story over 14 lines—and strict adherence to formal structures, including iambic pentameter and specific rhyme schemes.

Existing approaches typically rely on fine-tuning models on large poetry datasets. However, high-quality English sonnets are scarce, with only a few thousand examples available. This data scarcity often leads models to mimic existing works rather than create original content, frequently losing the logical thread across the poem's duration. Zest addresses this by asking: Can a model learn to write poetry using only "boring" prose data?

The Zest Framework

The Zest (Zero-shot Sonnet Generation) framework utilizes a four-stage pipeline to bridge the gap between prose logic and poetic form.

1. Content Planning

To ensure discourse-level coherence, the system first generates a "sketch"—a sequence of keywords for each of the 14 lines. This is handled by a T5 model trained on news summaries and Reddit stories. By learning "how to tell a story" from prose, the model establishes a logical plot before any verses are composed.

2. Rhyme Pairing

Once the content plan is established, the system identifies rhyme words for the end of each line. Using the CMU Pronouncing Dictionary, Zest ensures these anchors fit the target sonnet structure (e.g., ABAB CDCD EFEF GG for Shakespearean sonnets).

3. Aesthetic Polishing

To elevate the language from mundane to poetic, Zest incorporates an aesthetic module. It utilizes external knowledge bases like ConceptNet and specialized simile generation tools to replace standard keywords with vivid imagery (e.g., transforming "love" into "rose") or evocative comparisons (e.g., "bright like a diamond").

4. Meter-Constrained Decoding

The final stage uses a GPT-Neo (2.7B) model to translate the polished sketch into full lines. Crucially, Zest employs reverse generation, producing text from the rhyme word back to the start of the line. This treats the rhyme as a fixed anchor, simplifying the satisfaction of formal constraints. A custom decoding algorithm filters the output in real-time to ensure every line adheres to iambic pentameter.

Experimental Setup

Zest was trained on a combination of 4,500 CNN news summaries and 16,000 short stories from Reddit (r/shortscarystories). Notably, no poetic data was used during training.

The framework was evaluated against several baselines:

  • Hafez: A state-of-the-art poetry-specific model.
  • Few-shot GPT-3: A powerful general-purpose LLM.
  • Human-written sonnets: Sourced from Project Gutenberg.

Results and Discussion

Zest demonstrated remarkable technical and creative proficiency in blind tests conducted by English literature experts.

  • Formal Accuracy: Zest achieved a 100% success rate in rhyming and approximately 75% success in maintaining meter. Interestingly, human poets in the control group only hit the meter constraint 70% of the time, as they often employ rhythmic variations for stylistic effect.
  • Human Evaluation: Experts rated Zest higher than both Hafez and GPT-3 in categories of coherence, originality, and poetic language.
  • The Turing Test: In a significant milestone, experts judged Zest’s sonnets as human-written 62% of the time, a substantial improvement over the 41% achieved by the previous state-of-the-art (Hafez).

Key Insights

The success of Zest suggests that logical coherence and poetic structure do not need to be learned simultaneously. By disentangling these elements, the model avoids the limitations of small poetry datasets. Furthermore, explicitly injecting figurative devices (imagery and similes) into the planning phase significantly boosts the perceived "poeticness" of the output.

Limitations and Future Work

Despite its success, Zest faces challenges with the volta (the structural "turn" in a sonnet), where the model occasionally fails to shift the narrative tone between stanzas. Additionally, the rigid meter constraints can sometimes lead to awkward phrasing or the omission of auxiliary verbs. Future research could adapt this zero-shot approach to other languages where poetry datasets are even scarcer, provided a rhyme dictionary is available.

Conclusion

Zest demonstrates that high-quality, constrained creative writing is possible without direct training on poetic examples. By combining prose-based discourse planning with specialized constrained decoding, the framework provides a robust path forward for zero-shot creative generation.

Summary updated

BibTeX
@inproceedings{tian2022zero,
  author = {Yufei Tian and Nanyun Peng},
  title = {{Zero-shot Sonnet Generation with Discourse-level Planning and Aesthetics Features}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.262},
}
Figure