Deterministic Narrative Gravity: Bridging Theory of Mind and Historical Simulation through ABM-LLM Architectures
Organizations: University of Jaén · IA-ismo LAB · Departamento de Informática
Abstract
Historical social simulation faces a fundamental reproducibility challenge: the stochastic nature of large language models (LLMs) introduces a digital butterfly effect that prevents exact replication across multi-turn runs. Furthermore, the inability to control low-level server parameters in commercial LLM hosting environments severely limits reproducibility. To overcome this opacity, we present a deterministic multi-agent framework coupling LLMs to an Agent-Based Modelling (ABM) pipeline grounded in Theory of Mind (ToM) and Cognitive Archaeology, and validate exact artifact identity within local, pinned execution environments using SHA-256 hashing. Run locally at temperature zero with clean per-call model reloads, the system injects differentiated cognitive states per turn through dissonance-driven behavioural modes and gated internal voices. Evaluating seven model configurations spanning 4B to 31B parameters against an ablated baseline reveals clear operational boundaries. Small models (8B) suffer from context capacity overload, producing repetitive, specular dialogue loops. However, at 12B parameters, the ABM scaffolding breaks the monotonous response patterns seen in ablation. Crucially, these scaffolded models exhibit spontaneous diegetic expansion: they coherently expand scenario lore through tactically motivated, anachronism-free details rather than escalating into aggression. By resisting the structural pull toward premature scene closure, scaffolded sessions sustain an open terminal Narrative Vector ( in 12/21 overall; 9/9 in official 12B configurations) whereas unscaffolded ablation never does (0/21). This framework provides a transparent, auditable benchmark architecture for virtual archaeology, with the full pipeline released as open-source software to enable independent replication.
Figures & tables
| Dense Models ( Dense ) | Mixture-of-Experts ( MoE ) |
|---|---|
| gemma4:e4b (4B effective) | gemma4:26b (official, 3.8B active) |
| gemma3:12b (12B, baseline , Q4_K_M) | batiai/gemma4-26b:q3 (community, Q3) |
| gemma4:31b (31B, official, Q4_K_M) | |
| batiai/gemma4-31b:iq4 (31B, community) | |
| ssfdre38/gemma4-turbo ( e4b ) |
| Parameter | Configured Value | Technical Purpose |
| temperature | 0.0 | Greedy decoding inference, selects the maximum-probability token. |
| top_p | 0.0 | Disables nucleus sampling. |
| top_k | 1 | Restricts selection to the single top candidate. |
| seed | 42 | Request-level deterministic seed. |
| num_ctx | 8192 | Static context window to avoid variations in token positioning. |
| num_batch | 512 | Standardized context-processing batch size. |
| Inner Voice | Python Threshold | Cognitive Function and Semantic Register |
|---|---|---|
| SHADOW | Generates a dark command or temptation in the person ( "Artai, you should…" ). Represents selfish impulses, suspicions, or domination scenarios. | |
| EMOTION (Amygdala) | A visceral somatic reaction in the person ( "His blood is boiling" , "Rage climbing up the neck" ). A pure instinctive response to the last message. | |
| MEMORY (Cortex/Recollection) | Retrieval of a private sensory episodic memory of the character that acts as a tactical catalyst in the present. |
Large Language Model-Based Social Simulation
Large language model-based social simulation studies how language-model agents represent people and interact to produce social behavior.
See all 292 papers