Introduction
Large Language Models (LLMs) have revolutionized text generation, yet they frequently struggle with narrative coherence. While they produce grammatically correct sentences, they often fail to maintain a consistent "mental model" of the story world. This leads to logical fallacies—such as characters acting against their established motivations or events defying basic causality. The CAST (Commonsense-inference Augmented neural StoryTelling) framework addresses these issues by introducing a "generate-and-filter" pipeline guided by commonsense reasoning.
The Challenge of Narrative Logic
The primary flaw in standard LLM story generation is the reliance on statistical word prediction rather than causal reasoning. In multi-character narratives, this problem is compounded; models often fail to track the distinct goals and "turn-taking" required for believable character interactions. CAST aims to bridge this gap by simulating how a human reader infers latent states—like intentions and emotions—to determine if a story progression makes sense.
Methodology: The CAST Pipeline
CAST employs a sophisticated architecture that combines character-conditioned generation with a commonsense reasoning engine.
The framework operates in four key stages:
- Character-Conditioned Generation: A GPT-2 model is fine-tuned with specific character tags (e.g.,
[Char_1]) and a prefix system to control which character drives the next sentence, enabling structured turn-taking. - Commonsense Inference: Using COMET-2020, the system generates inferences about the story's state. It compares the postconditions of the current sentence (what a character might feel or want next) with the preconditions of a candidate next sentence (what must be true for that action to occur).
- Semantic Matching: The system calculates the similarity between these inferences using Sentence-BERT. A high match score indicates that the candidate sentence is a logical continuation of the character's inferred state.
- Constrained Decoding: To improve efficiency, CAST modifies the LLM's decoding process in real-time, boosting the probability of words that align with expected commonsense attributes while penalizing contradictory terms.
Evaluation and Results
The researchers tested CAST across three distinct datasets: ROCStories (everyday life), Writing Prompts (complex Reddit-sourced stories), and Fairy Tales (genre-specific logic).
Human evaluations revealed that CAST significantly outperforms state-of-the-art baselines. On the ROC dataset, CAST achieved a 92% win rate in logical sense for single-character stories and an 85.8% win rate for multi-character narratives. Beyond logic, participants rated CAST stories as more coherent and enjoyable across all domains. Notably, the framework's success in the Fairy Tale genre suggests that its reliance on fundamental human motivations (wants, needs, feelings) allows it to generalize well beyond its training data.
Limitations and Future Directions
Despite its success, CAST currently operates under a Markovian assumption, evaluating coherence only between adjacent sentences. This prevents the model from tracking long-term narrative arcs or persistent character goals. Additionally, the system's performance is tied to the accuracy of the COMET engine and involves higher computational costs than simple sampling. Future work aims to implement "non-Markovian" tracking, maintaining a persistent "memory bank" of character states to ensure long-term narrative consistency.
Summary updated