Preprint Jan 2021 & JUl 2025

A Neurosymbolic Architecture for Coherent Narrative Generation

Author / Contributor
Maryam Rezaee (Undergraduate Researcher)
Affiliation / Advisor Dr. Jaafar Almasizadeh, Department of Mathematics, University of Isfahan, Iran
Venue / Context Bachelor's Research Project Graded 20/20 (Perfect), Department of Mathematics, University of Isfahan, Iran
Keywords: Neurosymbolic AI Narrative Generation Signal Processing Finite State Machines Active Inference

Overview

Large Language Models generate highly fluent, contextually nuanced text at the local sentence level. However, when deployed for long-form creative generation, they frequently encounter the “horizon problem.” Because autoregressive sampling relies primarily on local token probabilities without explicit goal-directed planning, extended generations tend to wander, losing thematic focus and structural direction.

This research paper reframes literary theory through computational formalism, proposing a Neurosymbolic “Director-Actor” architecture. Conducted under the supervision of Dr. Jaafar Almasizadeh at the University of Isfahan, the project translates canonical narrative structures into algorithmic constraints that steer neural text generation toward global causal coherence.

Algorithmic Formalization of Story Structures

Rather than viewing story structures as subjective artistic conventions, we model them as explicit mathematical cost functions across three distinct computational paradigms:

  1. Continuous Tension Modulation (Signal Processing): Structures defined by the dynamic modulation of rising and falling conflict, such as Freytag’s Pyramid, are modeled as feedback control loops. We track narrative tension via valence inversion and steer generation toward a target Gaussian envelope using logit bias injection.
  2. Discrete State Transitions (Gated Finite State Machines): Monomythic structures, such as Campbell’s Hero’s Journey, depend on sequential prerequisite events and inventory states. These are formalized as gated state machines where progression requires fulfilling verifiable symbolic criteria.
  3. Pacing and Temporal Search (A* Pathfinding): Heavily paced frameworks, such as Snyder’s beat sheet, are framed as constrained shortest-path problems across a semantic state space, balancing beat fulfillment against target token budgets.

Character Archetypes and Cognitive Compression

Character consistency is enforced by projecting literary archetypes into dense semantic embedding spaces. We represent archetypal roles as fixed vector centroids calculated from canonical character descriptions. During generation, character actions and dialogues are evaluated against these centroids via cosine proximity, penalizing behavioral deviations and preventing personality drift.

From a theoretical perspective, the paper grounds these structural constraints in the Free Energy Principle and cognitive predictive processing. We argue that classical storytelling structures are not arbitrary cultural artifacts, but evolved cognitive data compression schemas. By packaging complex social interactions into predictable, low-entropy causal sequences, these schemas minimize predictive surprisal in human working memory, offering an effective inductive prior for artificial narrative reasoning.

Uplink Ready

Lab Dispatch Uplink Reserved

Technical writeups, experiment traces, and theoretical musings for this work will synchronize here as the lab.maryamrezaee.me ecosystem comes online.

Citation

@misc{rezaee2025archetypes,
  title={From Archetypes to Algorithms: A Neuro-Symbolic Architecture for Translating Literary Formulas into Coherent Narrative Generation},
  author={Rezaee, Maryam},
  year={2025}
}