Towards Coherent and Consistent Use of Entities in Narrative Generation

Pinelopi Papalampidi, Kris Cao, Tomás Kociský · OpenReview

Abstract

Large pre-trained language models (LMs) have demonstrated impressive capabilities in generating long, fluent text; however, there is little to no analysis on their ability to maintain entity coherence and consistency. In this work, we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories. First, we propose a set of automatic metrics for measuring model performance in terms of entity usage. Given these metrics, we quantify the limitations of current LMs. Next, we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory. We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window. Finally, we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories.

Introduction

While large language models (LLMs) excel at generating surface-level fluent text, they frequently suffer from "narrative amnesia" in long-form generation. Characters introduced early in a story may vanish or exhibit contradictory traits as the narrative progresses. This paper addresses two primary gaps: the lack of structural evaluation metrics for entity usage and the architectural limitations of standard Transformers, which often lose track of entity-specific information over long sequences.

Methodology: The D-MNEMELM Architecture

To address these issues, we introduce the Dynamic Memory-augmented Language Model (D-MNEMELM). This architecture builds upon Transformer-XL by integrating a dedicated "Entity Memory" bank.

Architecture of D-MNEMELM featuring a dynamic entity memory and dual attention mechanism.

The model operates through several key components:

  • Entity Memory: A structured bank where each slot represents a specific entity, initialized via an "entity prompt" containing character descriptions.
  • Dual Attention: The model utilizes cross-attention blocks at every layer to "read" from the entity memory and "write" updates back to it, allowing the character's state to evolve dynamically.
  • Auxiliary Supervision: An entity-related loss function guides the model to attend to the correct memory slot during entity mentions, ensuring effective memory utilization.

Datasets and Evaluation Metrics

We evaluated D-MNEMELM on two narrative datasets: WikiPlots (complex synopses with many entities) and WritingPrompts (first-person stories with heavy pronoun usage).

Beyond standard perplexity, we introduced new metrics:

  1. Coherence ($C$): Measures the maximum span of sections where a protagonist appears, identifying the "Protagonist Drop" phenomenon in vanilla LMs.
  2. Consistency ($U$): Evaluates the stability of an entity's "attribute profile" by extracting associated verbs and adjectives.

Results and Analysis

Our experiments show that D-MNEMELM significantly improves long-range coherence. On WikiPlots, the coherence score ($C$) rose from 3.29 (vanilla) to 5.16, nearing the human gold standard of 5.65.

Entity NLL and memory reduction effect across story sections for WritingPrompts and WikiPlots.

As shown in the figure above, the entity memory is particularly effective as stories progress, reducing uncertainty (negative log-likelihood) in later sections. Notably, the entity memory acts as a persistent anchor, proving most valuable when the standard context window is limited. Human evaluations corroborated these findings, with judges preferring D-MNEMELM for its superior control and coherence.

Conclusion

D-MNEMELM demonstrates that augmenting LMs with dynamic entity memory significantly enhances narrative consistency. While the model adds approximately 16% more parameters and introduces computational overhead via cross-attention, the gains in coherence are substantial. Future work will focus on autonomous entity discovery and more sophisticated attribute extraction using dependency parsing.

Summary updated

Abstract

Large pre-trained language models (LMs) have demonstrated impressive capabilities in generating long, fluent text; however, there is little to no analysis on their ability to maintain entity coherence and consistency. In this work, we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories. First, we propose a set of automatic metrics for measuring model performance in terms of entity usage. Given these metrics, we quantify the limitations of current LMs. Next, we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory. We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window. Finally, we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories.
BibTeX
@inproceedings{papalampidi2022towards,
  author = {Pinelopi Papalampidi and Kris Cao and Tomás Kociský},
  title = {{Towards Coherent and Consistent Use of Entities in Narrative Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=_LNdXw0BSx},
}
Figure