Published May 26, 2026 | Version 8.0

MATE: A Deterministic Affective Middleware for LLM-Based Companions with Emergent Character and Persistent Internal State

Authors/Creators

Description

We present MATE, a deterministic affective middleware that gives any LLM persistent emotions, evolving character, and emergent behavioral properties. The kernel is a pure function — transition(state, event) → new_state — with zero LLM calls and full reproducibility.

Where Anthropic (2026) identified 171 transient emotion concept vectors within Claude, MATE provides the architectural substrate for these functional emotions to persist, accumulate, and produce emergent character over weeks of interaction. The LLM supplies the moment; MATE supplies the lifetime.

MATE integrates 20+ theories from neuroscience, psychology, and quantum cognition into eight modules: (1) quantum probability formalism (8×8 density matrices with Lindblad decoherence); (2) dual-process habituation; (3) a 30-trait character system from clinical psychology; (4) inner state with tastes, aspirations, and opponent-process dynamics; (5) a 7-dimensional memory graph with somatic markers, pheromone narrative threads (Mycelium), ecphoric enrichment, and bridge inference during sleep; (6) a 5-axis awareness field; (7) allostatic mood regulation; and (8) a cognitive autopoietic loop (SPARK) where beliefs modulate perception and perception updates beliefs — measured in production with 910 telemetry events, zero runaways.

Deployed with 11 users over 63 days (3,459 messages, 66,245 graph nodes, 184,763 edges, 659,252 telemetry events), the same deterministic code produces measurably different characters depending on interaction history. A three-condition controlled comparison (N=48, MATE vs Context-only vs Bare LLM) confirms the kernel's independent contribution: emoji suppression 0% vs 54% (χ²=33.0, p<10⁻⁸), state-driven content depth (median 148 vs 70 chars, p<10⁻⁴).

We document five levels of emergent self-referential behavior — from imposter syndrome arising from two floating-point numbers to real-time self-deception awareness — and introduce the MIRROR benchmark for evaluating internal state complexity. The system comprises ~67,000 lines of code with 3,004 tests.

Version 8: Anthropic functional emotions bridge (3 new references), A/B/C controlled comparison, updated production data (63 days, 11 users), Living Memory section (Mycelium + Ecphoric + Bridge Inference + Salience), refreshed MIRROR scores, new figures.

Files

paper_v8.pdf

Files (1.2 MB)

Name Size Download all
md5:13f1bfd7ee67fdec9e8e188ee6519d0b
1.2 MB Preview Download

Additional details

Related works

Is new version of
Preprint: 10.5281/zenodo.19209777 (DOI)
References
Preprint: 10.48550/arXiv.2604.07729 (DOI)
Preprint: 10.48550/arXiv.2507.21509 (DOI)
Preprint: 10.48550/arXiv.2510.11328 (DOI)

Dates

Updated
2026-03-29
Version 5 (neurophysics, quantum expansion, DEE, token optimization)
Updated
2026-03-31
Version 6 (anticipated criticisms, honest emergence decomposition, corrected claims, updated production data)
Updated
2026-04-07
Version 7 (SPARK autopoietic loop — 212 production measurements, Di Paolo enactivist framing, 3 new figures, updated statistics to 73K LOC / 1,594 tests / 23,808 nodes)
Updated
2026-05-26
Version 8 (Anthropic functional emotions bridge — 3 new references linking to emotion vectors paper 2604.07729. A/B/C controlled comparison N=48 with statistical significance. Production data updated: 63 days, 11 users, 3,459 messages, 659K telemetry events, 14,037 constructs. Living Memory section: Mycelium pheromone threads, ecphoric enrichment, bridge inference, salience-driven attention. Refreshed MIRROR scores.

Software

Programming language
Python
Development Status
Active

References

  • Plutchik, R. The nature of emotions. American Scientist, 89(4):344-350, 2001.
  • Mehrabian, A. Pleasure-Arousal-Dominance: A general framework. Current Psychology, 14(4):261-292, 1996.
  • Damasio, A.R. Descartes' Error: Emotion, Reason, and the Human Brain. Putnam, 1994
  • Kahneman, D. Thinking, Fast and Slow. Farrar, Straus and Giroux, 2011.
  • Bowlby, J. Attachment and Loss. Basic Books, 1969.
  • Panksepp, J. Affective Neuroscience. Oxford University Press, 1998
  • Chen, Z. et al. MAGMA: Multi-Graph Memory for LLM Agents. arXiv:2601.03236, 2026
  • Premack, D. and Woodruff, G. Does the chimpanzee have a theory of mind? BBS, 1(4):515-526, 1978.
  • Nagel, T. What is it like to be a bat? Philosophical Review, 83(4):435-450, 1974
  • Goffman, E. The Presentation of Self in Everyday Life. Doubleday, 1959.
  • Putnam, H. Psychological predicates. In Art, Mind, and Religion, pp. 37-48. University of Pittsburgh Press, 1967
  • Lakoff, G. and Johnson, M. Metaphors We Live By. University of Chicago Press, 1980.
  • Bedau, M.A. Weak Emergence. Nous, 31(s11):375-399, 1997.
  • Huang, O.Y. et al. Emotional Support with Conversational AI. arXiv:2603.22618, 2026.
  • Thompson, R.F. and Spencer, W.A. Habituation: A model phenomenon for the study of neuronal substrates of behavior. Psychological Review, 73(1):16-43, 1966.
  • Rankin, C.H. et al. Habituation revisited: An updated and revised description. Neurobiology of Learning and Memory, 92(2):135-138, 2009.
  • Anderson, M.C. and Green, C. Suppressing unwanted memories by executive control. Nature, 410(6826):366-369, 2001.
  • Solomon, R.L. and Corbit, J.D. An opponent-process theory of motivation. Psychological Review, 81(2):119-145, 1974.
  • Atmanspacher, H. and Filk, T. The Necker-Zeno model for bistable perception. Topics in Cognitive Science, 5(4):800-817, 2013.
  • Sterling, P. Allostasis: A model of predictive regulation. Physiology & Behavior, 106(1):5-15, 2012.
  • Kleitman, N. Sleep and Wakefulness. University of Chicago Press, 1963.
  • Busemeyer, J.R. and Bruza, P.D. Quantum Models of Cognition and Decision. Cambridge University Press, 2012.
  • Wang, Z. and Busemeyer, J.R. A quantum question order model. Topics in Cognitive Science, 5(4):689-710, 2013.
  • Khrennikov, A. Quantum-like model of brain's functioning: Decision making from decoherence. Journal of Theoretical Biology, 281(1):1-9, 2011.
  • Friston, K. The free-energy principle: A unified brain theory? Nature Reviews Neuroscience, 11(2):127-138, 2010.
  • Kidd, C. and Hayden, B.Y. The psychology and neuroscience of curiosity. Neuron, 88(3):449-460, 2015.
  • Pothos, E.M. and Busemeyer, J.R. Can quantum probability provide a new direction for cognitive modeling? BBS, 36(3):255-274, 2013.
  • Collins, A.M. and Loftus, E.F. A spreading-activation theory of semantic processing. Psychological Review, 82(6):407-428, 1975.
  • Brooks, R.A. Intelligence without representation. Artificial Intelligence, 47(1-3):139-159, 1991.
  • Young, J.E. et al. Schema Therapy: A Practitioner's Guide. Guilford Press, 2003.
  • Schwartz, S.H. Universals in the content and structure of values. Advances in Experimental Social Psychology, 25:1-65, 1992.
  • Di Paolo, E.A. Autopoiesis, adaptivity, teleology, agency. Phenomenology and the Cognitive Sciences, 4(4):429-452, 2005.
  • Di Paolo, E. and Thompson, E. The enactive approach. In The Routledge Handbook of Embodied Cognition, pp. 68-78. Routledge, 2014.
  • Barandiaran, X.E., Di Paolo, E.A., and Rohde, M. Defining agency: individuality, normativity, asymmetry, and spatio-temporality in action. Adaptive Behavior, 17(5):367-386, 2009.
  • Froese, T. and Di Paolo, E. The enactive approach: theoretical sketches from cell to society. Pragmatics & Cognition, 19(1):1-36, 2011.
  • Villalobos, M. and Dewhurst, J. Enactive autonomy in computational systems. Synthese, 195(5):1891-1908, 2017.
  • Lefebvre, G. et al. A normative account of confirmation bias during reinforced self-learning. Neural Computation, 34(2):307-337, 2022.
  • Waddington, C.H. The Strategy of the Genes. Allen & Unwin, 1957.
  • Sofroniew, N. et al. Emotion concepts and their function in a large language model. arXiv:2604.07729, 2026.
  • Chen, R. et al. Persona vectors: Monitoring and controlling character traits in language models. arXiv:2507.21509, 2025.
  • Wang, C. et al. Do LLMs "feel"? Emotion circuits discovery and control. arXiv:2510.11328, 2025.