Chinese Poetry Generation with a Working Memory Model

AuthorsXiaoyuan Yi, Maosong Sun, Ruoyu Li, Zonghan Yang

arXiv 20182018

TL;DR

Working Memory model uses topic, local, and history memories with a topic trace mechanism to reach BLEU 1.315 on quatrains vs 0.425 for iPoet.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Neural poetry loses coherence when history is packed into a single vector

Existing poetry generators often pack all user inputs and history into a single small vector or attend over unlimited history, which is implausible for coherence.

On Chinese poetry generation, this causes weak topic expression and poor line-to-line coherence, leaving a large gap between computer-generated and human-authored poems.

HOW IT WORKS

Working Memory model — dynamic topic and history memories for poetry

Working Memory model introduces a topic memory, history memory, local memory, a genre embedding, and a Topic Trace mechanism around a GRU encoder–decoder.

You can think of Working Memory model as a writer’s working memory, where a few mental slots hold current topics and key past phrases, instead of one overloaded summary.

This design lets Working Memory model focus on relevant slots, flexibly reuse or skip topics, and maintain long-poem coherence beyond what a fixed context window can handle.

DIAGRAM

Line-by-line generation and memory update flow

This diagram shows how Working Memory model generates each poem line, reads from memories, and writes salient history back into the history memory.

DIAGRAM

Training and evaluation pipeline for Chinese poetry

This diagram shows how Working Memory model is trained and evaluated on quatrains, iambics, and chinoiserie lyrics with BLEU and perplexity.

PROCESS

How Working Memory model Handles Chinese poetry generation

  1. 01

    Working Memory Model Overview

    Working Memory model first encodes user topic words into the topic memory and initializes the global trace vector and Topic Trace mechanism.

  2. 02

    Working Memory Model

    During each line generation, Working Memory model uses the Addressing Function to read from topic, local, and history memories into the decoder.

  3. 03

    Memory Writing

    After a line is generated, Working Memory model writes encoder hidden states of the previous line into local memory and salient states into history memory slots.

  4. 04

    Topic Trace Mechanism

    Across lines, Working Memory model updates the Topic Trace mechanism to track which topic slots were read and how often, guiding future memory addressing.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    Working Memory model for poetry generation

    Working Memory model introduces explicit topic, history, and local memory modules with limited slots, dynamically read and written via an Addressing Function to improve coherence.

  • 02

    Genre embedding for structural control

    Working Memory model uses a genre embedding that concatenates a 64 dimensional phonology embedding and a 32 dimensional length embedding to control tones and line lengths.

  • 03

    Topic Trace mechanism

    Working Memory model adds a Topic Trace mechanism with a 24 dimensional topic trace vector to record topic usage, improving BLEU from 1.267 to 1.315 on quatrains.

RESULTS

By the Numbers

BLEU

1.315

+0.890 over iPoet

PP

86

-52 perplexity vs iPoet

BLEU iambics

0.699

+0.379 over iambicGen

BLEU lyrics

0.568

+0.256 over lyricGen

On quatrains, iambics, and chinoiserie lyrics, Working Memory model is evaluated with BLEU and perplexity against iPoet, iambicGen, and lyricGen. These results show that Working Memory model substantially improves topic expression and coherence across three Chinese poetry genres.

BENCHMARK

By the Numbers

On quatrains, iambics, and chinoiserie lyrics, Working Memory model is evaluated with BLEU and perplexity against iPoet, iambicGen, and lyricGen. These results show that Working Memory model substantially improves topic expression and coherence across three Chinese poetry genres.

BENCHMARK

Automatic evaluation results on Chinese quatrains

BLEU scores on quatrains comparing Working Memory model to strong neural baselines.

KEY INSIGHT

The Counterintuitive Finding

Working Memory model without genre embedding already surpasses baselines, with BLEU 1.019 on quatrains versus iPoet’s 0.425 despite weaker structural control.

This is surprising because one might expect structural and phonological supervision to dominate, yet limited-slot working memory alone yields a +0.594 BLEU gain over iPoet.

WHY IT MATTERS

What this unlocks for the field

Working Memory model shows that small, dynamically written memories can maintain long-range coherence in generative language tasks like multi-line poetry.

Builders can now design generators that explicitly track topics and salient history across many segments, instead of relying on a single history vector or unbounded attention.

~12 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Questions about this paper?

Paper: Chinese Poetry Generation with a Working Memory Model

Answers use this explainer on Memory Papers.

Checking…