arXiv:2611.01954cs.CLNov 2026

Manuscript Offprint

arXiv:2611.01954

Towards Self-Evolving Narrative Systems: Real-Time Adaptation and Long-Term Optimization with LLMs

Ruisheng Sun, Jiaqi Shao, Weijia Han, Linxi Ju, Yunzhen Zhang, Binyan Sun, Rong Chen, Benjamin Blas Maristany, Ye Lu, Rui Hu, Ernesto Escobar, Bing Luo

Abstract

Traditional interactive narrative systems offer strong authorial control and structural coherence but often restrict player agency. In contrast, LLM-driven narratives enable open-ended generation and greater flexibility, yet frequently suffer from inconsistency and diminished narrative control. To navigate this trade-off, we propose a hybrid narrative framework that dynamically balances pre-authored content with real-time LLM generation via semantic similarity alignment. Additionally, sustaining narrative quality over extended gameplay remains a core challenge in LLM-based storytelling. To address this, we introduce a self-evolving, feedback-driven optimization framework that leverages in-context learning to iteratively refine prompts, eliminating the need for manual prompt engineering. Through a case study and participant-based evaluation, we show that our framework enhances narrative coherence while preserving player agency, effectively aligning generated content with both authorial intent and evolving player behavior.

1 Introduction

For decades, designers of interactive narratives have pursued the dual goals of crafting compelling, coherent stories and of affording players agency (Domsch, 2013; Tanenbaum and Tanenbaum, 2010; Carstensdottir et al., 2021): the ability to take meaningful actions that influence the game or story. Traditional systems based on branching storylines and fixed dialogue trees provide reliable and well-crafted experiences. However, their reliance on predefined choices often results in predictable outcomes, limiting players' ability to shape the story and reducing the sense of personal agency.

Recent advances in Large Language Models (LLMs) offer new capabilities for interactive narrative systems by generating real-time text and responsive character behavior (Andres et al., 2024), enabling narratives that can dynamically adapt to player input. However, this flexibility introduces fundamental challenges: LLMs' inherent stochasticity and context sensitivity can lead to narrative incoherence, inconsistent character behavior, and loss of authorial control (Gu et al., 2025; Alavi et al., 2024).

Prior work has explored various generation strategies, including constraining LLM outputs within predefined narrative structures (Sun et al., 2023; Earle et al., 2025), while others focus on personalization (Villareale et al., 2023; Fu et al., 2025) and leveraging multi-agent coordination for long-form generation (Zhang et al., 2024) and PANGeA (Buongiorno et al., 2024). However, these systems reveal persistent trade-offs: those prioritizing flexible generation often suffer from degraded coherence over time (Peng et al., 2024; Jeong and Lee, 2025). More critically, they remain fundamentally static in their generation logic, i.e., their prompts and generation strategies are fixed once designed. The recent SCORE framework demonstrates that even well-engineered static prompts cannot maintain quality across extended interactions (Yi et al., 2025), highlighting the need for a narrative system that adapts and improves over time.

To address these limitations, we propose a two-system framework that progressively builds narrative capabilities:

System 1: Narrative Structure and Adaptive Strategy adaptively decides between reusing pre-authored content and generating new narrative in real-time, based on how well player actions align with the intended story direction. We model the game plot as a hierarchical narrative tree whose authored nodes form a reusable backbone, while runtime generation inserts context-constrained branches when player action deviate. This adaptation is guided by semantic alignment score (Wang et al., 2020) that quantifies the match between player actions and narrative context.

Figure

Figure 1: System Architecture Overview. Our framework addresses coherence, adaptability, and continual improvement via three interdependent phases: I. Pre-generated Mode transforms author-defined Game Scripts into modular Game Plots offline using an LLM Generator, ensuring narrative structure and quality; II. Gameplay Mode dynamically selects between pre-authored and generated content using an adaptive narrative strategy that responds to player choices; and III. Self-Evolving Optimization uses player feedback to iteratively refine prompts via an LLM Optimizer, enhancing future generation. These refined prompts guide the LLM Generator to produce contextually grounded narratives that reflect both authorial design and player behavior.

System 2: Self-Evolving Optimization enhances System 1 by refining the prompts used in its narrative generation, which strengthens long-term coherence and character consistency. It analyzes player feedback across narrative coherence, NPC consistency, and player agency via feedback-driven optimization with In-Context Learning (ICL (Madaan et al., 2023)), thereby diagnosing narrative issues and refining the prompts that guide System 1's generation, ultimately improving storytelling quality at scale without manual prompt engineering.

We evaluate our approach through a case study based on the “Escape from Fort Joy” narrative arc (Larian Studios, 2017b) from Divinity: Original Sin 2 (Larian Studios, 2017a), showing that our system maintains narrative coherence while giving players meaningful choices and automatically improves over time based on player feedback.

To summarize, our contributions are:

  1. Narrative Structure and Adaptive Strategy: We introduce a modular narrative construction framework that transforms pre-authored scripts into reusable narrative graphs, together with a semantic alignment mechanism that dynamically decides when to follow authored branches versus generating context-

constrained new content.

  1. LLM-Driven Self-Evolving Optimization: We develop an automated feedback-to-improvement system in which our LLM-based Optimizer analyzes player feedback, diagnoses narrative issues, and generates refined prompts—creating a closed-loop optimization cycle for continuous quality improvement (aligning with continual human-in-the-loop optimization principles (Liao et al., 2025)).

  2. Human-Centered Evaluation and Impact: Our user studies (N=12) demonstrate that the system evolves through long-term player interaction, balancing authorial control and generative freedom to improve coherence and immersion.

We will release our code and the Fort Joy scenario specification to facilitate reproducibility.