TL;DR
Give an LLM-powered game character 40 turns of friendly banter, then suddenly steal its wallet—most current systems will either snap into robotic, instant amnesia or cheerfully forgive you because their prompt is flooded with polite chat history. This paper introduces C3, an architecture that gives virtual characters realistic emotional momentum and—crucially—rewrites how they remember the past based on how they feel about you right now. It makes long-term AI characters far more believable while slashing token costs by roughly 60%.
What Problem Does This Paper Address?
In open-world games, Non-Player Characters (NPCs) need to maintain coherent personalities over tens of hours of gameplay. Bridging rigid game logic with free-form Large Language Models (LLMs) usually relies on Affective State Machines (ASMs), which track scalar numbers like Affinity: 80/100 and swap system prompts when values cross certain thresholds. Over long interactions, this setup breaks down in two ways:
- The Cliff-Edge Effect: Compressing human relationships into single numbers is lossy, and hard thresholds mean a tiny numerical nudge can trigger a jarring, instant personality reversal.
- Auto-regressive Inertia: LLMs are pattern-completion engines. If you spend 39 turns being best friends with an NPC and betray them on turn 40, retrieving those 39 friendly memories verbatim into the context window overwhelms the new "act hostile" system prompt. The weight of past warmth dilutes current anger.
Methods
The author proposes C3 (Causal-Continuous Characterization), a neuro-symbolic pipeline that separates numerical relationship math from the text fed into the LLM.
- Continuous State Engine: Instead of one "affinity" score, C3 tracks five psychological dimensions (Trust, Intimacy, Respect, Power Dynamics, and Familiarity) on a $[-1, 1]$ scale. States update using a momentum-based equation incorporating hysteresis (emotional persistence)—meaning minor noise gets dampened, while severe betrayals cause rapid, sustained drops. These numbers are translated into natural-language behavioral instructions (e.g., "Betrayed and cold").
- State-Conditioned Memory Rewriting (The Novel Core): Standard Retrieval-Augmented Generation (RAG) fetches raw past events and drops them straight into the prompt. C3 logs raw events immutably, retrieves relevant ones (softly penalizing memories that clash with the current mood), and passes them through a Rewriter ("State Lens"). Objective facts stay untouched, but the emotional framing shifts to match the present state.
- Consistency Discriminator: A lightweight check scores whether the drafted reply actually matches the target emotional state, triggering a single self-refinement pass if it falls short (which happens on ~8% of turns).
Datasets
Because existing benchmarks focus on short episodes or static personas, the author built CHRONOS-SIM, an event-driven text simulation benchmark designed to stress-test 100-turn dialogues. It features nine NPCs across three classic RPG settings (a medieval tavern, a sci-fi spaceship, and a modern office). A separate LLM (gpt-4o-mini), completely isolated from the NPC's weights and memory, simulates players across three behavioral scripts: Cooperative, Aggressive, and Erratic (e.g., building deep trust for 40 turns before abruptly stealing an item). No model training datasets were used; C3 operates entirely at inference time on off-the-shelf open-weights models (Qwen3-8B, Llama-3-8B-Instruct, and Mistral-v0.2-7B).
Key Insights and Ideas
- Humans don't recall memories verbatim; we reinterpret them: When a close friend betrays us, past favors suddenly feel like calculated manipulation. Teaching RAG systems to reframe interpretation while preserving facts neatly solves context-window inertia without erasing narrative history.
- Don't delete conflicting memories: You might think filtering out happy memories when an NPC gets mad would fix tonal bleed. It actually ruins the story—past kindness is precisely why a betrayal stings! C3 softly demotes conflicting memories during retrieval rather than hard-filtering them, keeping the dramatic arc intact for the Rewriter.
- Bigger models still have inertia: Scaling from an 8B to a 32B model narrows the consistency gap slightly, but passive context accumulation still derails vanilla LLMs after abrupt plot twists.
Key Results
Across 50 Monte Carlo runs of 100 turns each (5,000 turns per condition) using Qwen3-8B:
- Higher Consistency: C3 hits a 91.3% State Adherence Rate (SAR), beating a smoothed ASM baseline by 10.5 percentage points and the strongest memory architecture (Self-RAG, 83.5%) by 7.8 points. Immediately after a major relational shift, Vanilla LLM adherence crashes from 71.5% to 41.2%, whereas C3 holds steady at 88.3%.
- Preserved Facts: A human audit of 200 rewritten memories found 98.5% shifted emotional framing as intended, with only a 1.5% factual hallucination rate—which dropped below 0.5% when adding a deterministic Knowledge-Graph entity check.
- Cheaper & Viable Latency: Replacing an ever-growing chat log with a bounded ~300-token rewritten summary cuts total token usage across 100 turns by ~60% (61K vs. 145K tokens, including auxiliary calls). Running the Rewriter asynchronously between turns and using a distilled 1.5B discriminator brings latency down to ~1.15 seconds per turn.
- Human Approval: In double-blind 30-turn tests, 20 professional game designers preferred C3 over baselines on both character consistency (4.1 vs. 3.5) and memory use.
Limitations and Future Work
- Prompt-Tuning Bias: Prompts and hyperparameters were tuned on
Qwen3-8B. While C3 still beats baselines onLlama-3-8BandMistral-7B, absolute adherence drops (to 77.0% and 72.9%), as those models more frequently ignore rewritten summaries in favor of pre-trained politeness priors. - Simulated Players & Shorter Human Tests: Automated stress-testing relied on scripted
gpt-4o-minipersonas rather than unpredictable live gamers, and the human designer study spanned 30 turns rather than the full 100-turn horizon. - Subtle Pragmatics & Residual Drift: Heavy sarcasm can fool the Rewriter into overly literal interpretations. Furthermore, even a 0.5% factual error rate can linger in the summary cache for up to 10 turns, meaning production games will need automated post-hoc checks against the raw event log—alongside ethical guardrails against parasocial attachment.
Summary updated