Table of Contents
Fetching ...

Guiding and Diversifying LLM-Based Story Generation via Answer Set Programming

Phoebe J. Wang, Max Kreminski

TL;DR

The paper tackles limited diversity in instruction-tuned LLM storytelling by integrating answer set programming (ASP) to pre-generate diverse story outlines. It introduces a two-step neurosymbolic pipeline: a compact ASP outline generator encodes scenes, narrative functions, parameters, and constraints to produce a large pool of outlines, followed by an LLM-driven expansion of a chosen outline into a full story conditioned on a brief premise. Diversity is evaluated using semantic similarity embeddings across six premises, showing ASP-guided outputs are more diverse than unguided baselines, and highlighting that the ASP outlines offer a more compact alternative to full narrative planning. Limitations include absence of human subject evaluation and controllability concerns, with future work proposing interactive constraint tools and automatic ASP constraint generation from natural language to better align with author intent.

Abstract

Instruction-tuned large language models (LLMs) are capable of generating stories in response to open-ended user requests, but the resulting stories tend to be limited in their diversity. Older, symbolic approaches to story generation (such as planning) can generate substantially more diverse plot outlines, but are limited to producing stories that recombine a fixed set of hand-engineered character action templates. Can we combine the strengths of these approaches while mitigating their weaknesses? We propose to do so by using a higher-level and more abstract symbolic specification of high-level story structure -- implemented via answer set programming (ASP) -- to guide and diversify LLM-based story generation. Via semantic similarity analysis, we demonstrate that our approach produces more diverse stories than an unguided LLM, and via code excerpts, we demonstrate the improved compactness and flexibility of ASP-based outline generation over full-fledged narrative planning.

Guiding and Diversifying LLM-Based Story Generation via Answer Set Programming

TL;DR

The paper tackles limited diversity in instruction-tuned LLM storytelling by integrating answer set programming (ASP) to pre-generate diverse story outlines. It introduces a two-step neurosymbolic pipeline: a compact ASP outline generator encodes scenes, narrative functions, parameters, and constraints to produce a large pool of outlines, followed by an LLM-driven expansion of a chosen outline into a full story conditioned on a brief premise. Diversity is evaluated using semantic similarity embeddings across six premises, showing ASP-guided outputs are more diverse than unguided baselines, and highlighting that the ASP outlines offer a more compact alternative to full narrative planning. Limitations include absence of human subject evaluation and controllability concerns, with future work proposing interactive constraint tools and automatic ASP constraint generation from natural language to better align with author intent.

Abstract

Instruction-tuned large language models (LLMs) are capable of generating stories in response to open-ended user requests, but the resulting stories tend to be limited in their diversity. Older, symbolic approaches to story generation (such as planning) can generate substantially more diverse plot outlines, but are limited to producing stories that recombine a fixed set of hand-engineered character action templates. Can we combine the strengths of these approaches while mitigating their weaknesses? We propose to do so by using a higher-level and more abstract symbolic specification of high-level story structure -- implemented via answer set programming (ASP) -- to guide and diversify LLM-based story generation. Via semantic similarity analysis, we demonstrate that our approach produces more diverse stories than an unguided LLM, and via code excerpts, we demonstrate the improved compactness and flexibility of ASP-based outline generation over full-fledged narrative planning.
Paper Structure (21 sections, 3 figures)

This paper contains 21 sections, 3 figures.

Figures (3)

  • Figure 1: To generate diverse story outlines via ASP, we first specify a set of high-level narrative functions or storytelling goals that each scene in a story might fulfill. We then define a set of constraints that restrict how these narrative functions are allowed to be sequenced and combined. Finally, using an answer set solver, we solve for the set of all valid story outlines that can be produced given the specified narrative functions and constraints.
  • Figure 2: Our overall approach to ASP-guided story generation first takes in a premise prompt---a brief textual description of the high-level premise of the story to be generated---and a randomly selected outline from a set of valid outlines generated via ASP. We then translate the sequence of narrative functions defined by the outline to a sequence of story continuation prompts. These prompts are fed sequentially into the LLM to generate a sequence of paragraphs, each one taking into account the high-level story premise; the text of the story so far; and the narrative function that this scene (i.e., paragraph) must fulfill. The baseline (unguided) approach is identical, but uses a neutral story continuation prompt for each paragraph instead of taking a pre-generated story outline into account.
  • Figure 3: Comparative paragraph-by-paragraph homogeneity scores for stories generated around six different premises, using both an ASP-guided (blue) and an unguided (red) approach. For each premise, we generated a set of ten seven-paragraph stories using each approach, then visualized how semantically homogenous these story sets were at each paragraph. Lower homogeneity scores are better; the maximum possible score is 1 (all stories in the set are identical) and the minimum possible score is 0 (stories share nothing in common whatsoever).