NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Inferring the Reader: Guiding Automated Story Generation with Commonsense Reasoning

Xiangyu Peng, Siyan Li, Sarah Wiegreffe, Mark Riedl

TL;DR

The CAST (Commonsense-inference Augmented neural StoryTelling) framework addresses the "plot-hole" problem in AI-generated stories by using a commonsense reasoning engine to filter and guide language model outputs. By ensuring that new sentences align with the inferred goals and reactions of characters, CAST produces narratives that are significantly more coherent, enjoyable, and capable of handling complex multi-character interactions.

What Problem Does This Paper Address?

While large language models (LLMs) like GPT-2 and GPT-3 can generate text that is statistically probable, they often fail at the "logic" of storytelling. They suffer from plot incoherence: characters are suddenly forgotten, new ones appear without reason, and actions often lack clear motivation.

The core issue is a mismatch between how LMs generate text (sampling tokens from a distribution) and how humans read it. Human readers build a mental model of the story world, tracking causal consequences, character intentions, and goal hierarchies. Most existing automated story generators either ignore these mental models or focus strictly on single-character narratives, failing to capture the rich interplay between multiple actors.

Methods

The authors introduce CAST, a framework that acts as an "informed reader" to scaffold the generation process. The system follows a five-step loop for each new sentence:

  1. Candidate Generation: A fine-tuned GPT-2 model generates several potential next sentences. To handle multiple characters, the authors use a special prefix tag (e.g., *[Char_2]*) to cue the model on which character should be the subject of the next action.
  2. Commonsense Inference: The system uses COMET, a transformer-based model trained on the ATOMIC knowledge base, to infer implicit attributes from both the previous sentence (the prompt) and the new candidates. These attributes include character intents (xIntent), needs (xNeed), and reactions (xReact).
  3. Matching Constraints: CAST checks if a candidate sentence is a logical follow-up by matching its inferred attributes against those of the prompt. For example, if the prompt implies a character wants something (xWant), a valid continuation should show that character intending to act on that want (xIntent).
  4. Semantic Filtering: Instead of exact string matching, CAST uses Sentence-BERT to calculate semantic similarity between inferences, allowing for natural variations in phrasing (e.g., matching "to sleep" with "sleeping").
  5. Lexical Guidance: To speed up the process, CAST uses the inferred commonsense terms as lexical constraints during the decoding stage, encouraging the LM to generate "qualified" candidates more quickly.
Overview of the CAST system showing how candidates are filtered based on commonsense matches.

The logic relies on specific "relation pairs" that define meaningful transitions, as shown in the table below:

Table showing the commonsense relation pairs used to identify meaningful sentence continuations.

Datasets

The researchers evaluated CAST across three diverse storytelling domains:

  • ROCStories (ROC): A collection of ~98k five-sentence stories about everyday commonsense scenarios.
  • Writing Prompts (WP): A much larger and more complex dataset of user-generated stories from Reddit, averaging nearly 60 sentences in length.
  • Fairy Tales (FT): A specialized dataset of story summaries from Wikipedia, used to test the model's ability to generalize to genres with different "commonsense" rules (like magic).

Key Insights and Ideas

  • Hard Constraints > Better Distributions: The authors found that imposing explicit logical constraints at inference time is more effective for coherence than simply fine-tuning a model on more data.
  • The Markovian Assumption Works: Surprisingly, comparing only the current sentence to the immediately preceding one (a Markovian approach) was sufficient to maintain global coherence throughout the story.
  • Turn-Taking Logic: By alternating the "main character" tag in the prompt, CAST successfully models interactions between two characters, a significant step up from previous single-character-focused models.
  • Inference as a Filter: Using COMET as a filter rather than a generator allows the system to maintain the creative fluency of a standard LM while pruning nonsensical branches.

Key Results

In human-participant evaluations, CAST dominated strong baselines across four metrics: Logical Sense, Single Topic, Enjoyability, and Fluency.

Human evaluation results showing CAST's win rates against various baselines.

Key highlights include:

  • Vs. Guan et al. (2020): On ROCStories, CAST won 92% of the time on "Logical Sense" for single-character stories and 85.8% for two-character stories.
  • Generalization: On the complex Writing Prompts dataset, CAST outperformed a strong BART-based plot-generation model (64.2% win rate on Logical Sense).
  • Fairy Tales: Even in the non-standard Fairy Tale domain, CAST beat the C2PO baseline significantly, winning 81.5% of the time on Logical Sense.

Limitations and Future Work

  • Markovian Limit: While the sentence-to-sentence check works well, it can't track long-term goals that span many sentences. Future work could involve a "memory" of character needs that expire over time.
  • COMET Dependency: The system is only as good as its inference engine. Errors in COMET directly lead to errors in CAST's filtering.
  • Event-Centric Bias: CAST works best for action-oriented stories. It struggles with "exposition"—sentences that describe the world without changing it—because COMET requires a clearly identifiable actor to make inferences.
  • Gender Bias: Although the authors used character tags (e.g., [Char_1]) to mitigate bias, they acknowledge that the underlying models and datasets may still harbor latent biases.

Summary updated

BibTeX
@inproceedings{peng2022inferring,
  author = {Xiangyu Peng and Siyan Li and Sarah Wiegreffe and Mark Riedl},
  title = {{Inferring the Reader: Guiding Automated Story Generation with Commonsense Reasoning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=DjHdFtNmbhh},
}
Figure