[Paper Review] Goal-Directed Story Generation: Augmenting Generative Language Models with Reinforcement Learning
This paper proposes a reinforcement learning framework that guides GPT-2-based story generation toward specific goal events using a knowledge graph state representation and a policy network. By decoupling generation from control, it achieves 90%+ goal achievement rates while preserving fluency, outperforming both fine-tuned language models and baselines in human evaluations.
The advent of large pre-trained generative language models has provided a common framework for AI story generation via sampling the model to create sequences that continue the story. However, sampling alone is insufficient for story generation. In particular, it is hard to direct a language model to create stories to reach a specific goal event. We present two automated techniques grounded in deep reinforcement learning and reward shaping to control the plot of computer-generated stories. The first utilizes proximal policy optimization to fine-tune an existing transformer-based language model to generate text continuations but also be goal-seeking. The second extracts a knowledge graph from the unfolding story, which is used by a policy network with graph attention to select a candidate continuation generated by a language model. We report on automated metrics pertaining to how often stories achieve a given goal event as well as human participant rankings of coherence and overall story quality compared to baselines and ablations.
Motivation & Objective
- To address the challenge of making large pre-trained language models like GPT-2 goal-directed in story generation, where they typically fail to reach specified end states.
- To overcome the limitations of reward shaping fine-tuning in large models, which yields only 50% goal achievement despite improved fluency.
- To develop a two-stage system where a policy network selects continuations based on an abstract knowledge graph state, enabling goal-seeking behavior without fine-tuning the language model.
- To evaluate the system's performance on goal achievement, coherence, and fluency using automated metrics and human participant studies.
- To demonstrate that knowledge graph state representation is essential for effective reinforcement learning in story generation.
Proposed method
- A knowledge graph is dynamically constructed from story content, representing entities and relations as <subject, relation, object> triples to model the story world state.
- A graph attention network (GAT)-based policy network evaluates candidate continuations from GPT-2 based on their potential to move the story toward the goal, using a reward signal proportional to the inverse of remaining steps to the goal.
- The system uses proximal policy optimization (PPO) to train the policy network, optimizing for goal achievement while preserving natural language quality.
- A DQN-based agent selects story continuations from a set of GPT-2-generated candidates, using the knowledge graph as input to estimate state utility.
- The method decouples language generation from control: GPT-2 generates diverse, fluent continuations, while the policy network selects the most goal-promoting ones.
- A reward shaping mechanism is applied to the policy network, where the reward is higher for continuations that reduce the estimated number of steps to the goal event.
Experimental results
Research questions
- RQ1Can reinforcement learning be effectively applied to guide large pre-trained language models like GPT-2 toward specific goal events in story generation?
- RQ2Does using a knowledge graph as a state representation improve the performance of goal-directed story generation compared to relying on language model hidden states?
- RQ3How does the performance of a policy network trained on a knowledge graph compare to fine-tuning the language model directly with reward shaping?
- RQ4To what extent does the knowledge graph representation contribute to story coherence and goal achievement in human evaluations?
- RQ5Can a two-stage system—where a language model generates candidates and a policy selects them—achieve higher goal success rates than end-to-end fine-tuning?
Key findings
- The KG-DQN model achieved a 90%+ success rate in reaching specified goal events, significantly outperforming the baseline GPT2-Sci-Fi and GPT2-RS models.
- Human participants significantly preferred the KG-DQN model over both the baseline and the GPT2-RS model across all dimensions: coherence, repetition avoidance, plausibility, and local causality (p < 0.01).
- The DQN ablation, which removes the knowledge graph, showed a significant drop in performance, indicating that the knowledge graph is the key component enabling effective policy learning.
- The GPT2-RS model, fine-tuned with reward shaping, achieved only 50% goal success rate despite improved fluency, showing that direct fine-tuning is ineffective for large models.
- Adding reward shaping to the KG-DQN model (KG-DQN-RS) only improved performance on repetition avoidance, not on goal achievement or coherence, suggesting that the policy network’s graph-based reasoning is more critical than language model fine-tuning.
- Stories generated by DQN-based models were more concise (4–5 events on average to reach the goal), while GPT2-RS generated longer, more hallucination-prone stories with random character introductions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.