GENEVA: GENErating and Visualizing branching narratives using LLMs

Jorge Leandro, Sudha Rao, Michael Xu, Weijia Xu, Nebosja Jojic, Chris Brockett, Bill Dolan

Abstract

Dialogue-based Role Playing Games (RPGs) require powerful storytelling. The narratives of these may take years to write and typically involve a large creative team. In this work, we demonstrate the potential of large generative text models to assist this process. GENEVA, a prototype tool, generates a rich narrative graph with branching and reconverging storylines that match a high-level narrative description and constraints provided by the designer. A large language model (LLM), GPT-4, is used to generate the branching narrative and to render it in a graph format in a two-step process. We illustrate the use of GENEVA in generating new branching narratives for four well-known stories under different contextual constraints. This tool has the potential to assist in game development, simulations, and other applications with game-like properties.

Introduction

Creating narratives for Role-Playing Games (RPGs) is a monumental task. Unlike a linear novel or movie, an RPG requires a "narrative graph"—a web of branching and reconverging storylines that respond to player choices. Historically, this process takes years of manual labor by large creative teams to ensure the plot remains coherent across dozens of permutations.

While Large Language Models (LLMs) are excellent at generating text, they often struggle with the structural logic required for branching paths. If asked to "write a branching story," an LLM might produce disconnected threads or lose track of the plot's internal consistency. GENEVA aims to bridge this gap, providing a tool that leverages the creative power of LLMs while enforcing the rigid structural constraints needed by game designers.

Methodology

The GENEVA pipeline utilizes a two-step process powered by GPT-4 to transform high-level concepts into structured data.

Iterative Storyline Generation

Instead of a top-down approach, GENEVA uses a bottom-up iterative strategy. It prompts the model to create one primary storyline first. Subsequently, it requests additional storylines that share specific "narrative beats"—significant plot moments where an action triggers a reaction—with the previous paths while diverging at key points. This ensures that the generated paths interweave and reconverge naturally rather than remaining isolated threads.

Textual representation of generated narrative beats for the Frankenstein storyline.

Graph Encoding and Visualization

Once the textual storylines are finalized, a second prompt instructs GPT-4 to translate the narrative into a structured data format (Nodes and Edges). To ensure usability, the authors explicitly defined graph theory properties in the prompt, such as requiring all nodes to be connected. This data is then rendered into an interactive visual graph using a D3JS application.

Case Studies and Evaluation

The system was evaluated using four seed stories (Dracula, Frankenstein, Jack and the Beanstalk, and Little Red Riding Hood) across four grounding contexts: Minecraft, 21st Century, Ancient Rome, and the Quantum Realm. Designers could set structural constraints, such as the number of starts (1–2), endings (2–4), and total storylines (4–8).

Key insights from these case studies include:

  • The Power of Iteration: LLMs are significantly better at interweaving stories when forced to build them sequentially while maintaining previous paths in memory.
  • Grounding Depth: The quality of a "remix" depends on the LLM's training data for the setting. For instance, grounding Little Red Riding Hood in Minecraft produced clever mechanical details, whereas the "Quantum Realm" setting often resulted in more superficial noun replacements.
  • Narrative Bias: The model exhibited a "moral bias," frequently steering away from dark original endings (like the wolf eating Red Riding Hood) in favor of positive, lesson-oriented resolutions.

Results and Discussion

GENEVA successfully generated Directed Acyclic Graphs (DAGs) that strictly adhered to designer constraints. The system demonstrated impressive creative translation, such as reimagining Frankenstein in a 21st-century context focused on genetic engineering and DNA fragments rather than 19th-century alchemy.

The GENEVA interface showing a generated narrative graph for Frankenstein set in the 21st Century.

By handling the lower-level task of generating detailed beats and structural encoding, the tool allows human designers to focus on high-level narrative architecture and creative direction.

Conclusion and Future Work

While GENEVA proves the viability of LLM-assisted narrative design, limitations remain. Generated storylines can sometimes lack radical variety, and grounding in less-documented settings can feel generic. Future work will focus on a "human-in-the-loop" approach, allowing designers to manually edit or "lock" specific nodes while the LLM regenerates surrounding branches to improve creative control.

Summary updated

BibTeX
@inproceedings{leandro2023geneva,
  author = {Jorge Leandro and Sudha Rao and Michael Xu and Weijia Xu and Nebosja Jojic and Chris Brockett and Bill Dolan},
  title = {{GENEVA: GENErating and Visualizing branching narratives using LLMs}},
  booktitle = {CoG},
  year = {2023},
}
Figure