Sunday, November 15, 2026

Playing with the MInd

 

Playing with the Mind: Why Gamifying Artificial Sentience is the Key to Understanding Consciousness


When we think of cutting-edge artificial intelligence, images of silent server farms, endless matrices of numbers, and dense academic papers usually come to mind. But what happens when we pull complex cognitive architectures out of the laboratory and place them into a sandbox video game?

Gamifying Artificial Sentience—specifically frameworks grounded in Active Inference and affective computing—is a powerful paradigm shift that transforms abstract mathematical theories into living, breathing, and observable cognitive systems.

Here is why turning artificial sentience into a game matters for education, public understanding, the study of cognitive pathologies, and the ultimate quest to decode consciousness.

1. Democratizing Complex Theory: Making Active Inference Tangible

Active Inference, rooted in the Free Energy Principle, suggests that biological and artificial agents survive by minimizing surprise and updating their internal beliefs about the world. To a student or researcher, equations detailing variational free energy, precision weightings, and temporal gradients can feel utterly impenetrable.

When you gamify these models:

  • Theory Becomes Visible: You can literally watch an agent form a belief position, experience a prediction error gap, and adjust its internal worldview in real time.

  • Abstract Math Gets Interactive: Players can alter environmental variables—like introducing threats, shifting targets, or depleting energy reserves—and immediately see how the agent’s "moods" and affective states shift in response.

  • Intuition Over Equations: Gamification bridges the gap between raw mathematics and intuitive comprehension, allowing anyone to grasp how adaptive minds navigate uncertainty.

2. Revolutionizing Education and AI Popularization

Traditional textbooks teach AI as a static set of rules or classification algorithms. Gamified artificial sentience teaches AI as a behavioral ecosystem.

By placing an autonomous, emotionally reactive agent into a dynamic environment, education becomes exploratory. Students aren't just writing code; they are observing how an architecture learns to survive, how it balances exploration with pragmatic action, and how it handles stress. This playful approach sparks curiosity, turning the popularization of cognitive science into an engaging, hands-on experience rather than a distant lecture.

3. Modeling Cognitive Pathologies and Stress Responses

One of the most fascinating outcomes of affective AI simulations is how closely simulated emotional states mirror human psychological responses. When an agent is trapped, starved of energy, or overwhelmed by continuous threats, its telemetry shifts through states like frustration, anxiety, stress, or depression-like withdrawal.

This opens up profound avenues for computational psychiatry:

  • Studying Rigidity: Researchers can examine what happens when an agent's internal learning rates or precision weights become fixed, mimicking cognitive rigidity or trauma responses.

  • Visualizing Breakdown: Observing how an artificial mind degrades under extreme environmental pressure provides a safe, ethical sandbox to study how systemic stress affects decision-making and survival loops.

4. A New Lens on Consciousness and Subjective Experience

We often debate whether machines can truly be "conscious." Gamification doesn't solve the hard problem of consciousness overnight, but it provides a functional proxy for subjective experience.

By tracking dual-channel telemetry—separating ground-truth reality from the agent's internal belief space—we create a visual metaphor for self-awareness. The discrepancy between where an agent is and where it thinks it is mirrors our own cognitive biases and perceptual illusions. When an agent reacts to its environment with simulated surprise, motivation, or fear based on internal free energy fluctuations, it challenges us to rethink what constitutes an inner life.

The Ultimate Sandbox

Gamifying artificial sentience strips away the intimidation factor of advanced technology. It turns cognitive architecture into a playground where we can test theories, teach the next generation of engineers, model psychological behaviors, and peer into the mechanics of mind-making.

After all, the best way to understand how a mind works is to watch it play, learn, and struggle to survive within a world we can control.

Monday, September 14, 2026

Modeling Cognitive Dissonance via Clamped Perceptual Plasticity in Active Inference Frameworks

For a list of all posts go here.

Abstract

Cognitive dissonance—the psychological distress arising from a persistent conflict between internal mental models and external reality—remains a foundational concept in social psychology and computational psychiatry. This paper presents a neurocomputational formulation of cognitive dissonance grounded in Active Inference and Variational Free Energy (VFE) minimization. 

We model a dual-channel agent navigating a dynamic spatial environment under two experimental paradigms: 

  • (1) Flexible Adaptation, where sensory prediction errors drive both perceptual inference (synaptic weight updates) and active inference (motor action); and 

  • (2) Clamped Plasticity / Cognitive Dissonance, where perceptual learning is paralyzed, forcing the agent to resolve sensory prediction errors solely through motor behavior. 

Our empirical logs reveal that clamping generative weight plasticity prevents structural alignment, causing steady-state VFE to remain elevated —more than 56 times higher than the baseline convergence level. This chronic prediction error triggers an allostatic cascade, transitioning the agent from a baseline affective state, into states of sustained distress. 


These findings establish a formal mathematical bridge between clamped synaptic adaptation, unresolved VFE, and psychological rigidity.


1. Introduction

Festinger’s classical theory of cognitive dissonance asserts that human agents experience affective discomfort when confronted with sensory evidence or environmental feedback that contradicts held beliefs or generative assumptions. To resolve this tension, an agent must either adapt its internal beliefs to match reality or act upon the world to align environment feedback with expectations.

In computational neuroscience, Active Inference—derived from the Free Energy Principle (FEP)—formalizes brain function as a continuous minimization of Variational Free Energy. Minimization occurs through two distinct, complementary pathways:

  • Perceptual Inference (Mind Updating): Adjusting internal generative parameters/weights to better predict sensory observations.

  • Active Inference (World Updating): Executing motor actions to alter sensory inputs such that they conform to internal predictions.

When an agent encounters a structural mismatch between its internal model and physical environment, both pathways typically operate concurrently to restore sensory predictions. However, when psychological dogma, ideological rigidity, or neurological trauma clamps synaptic plasticity, the perceptual adaptation route is blocked.

This paper investigates the computational consequences of such clamped plasticity. We demonstrate that blocking perceptual inference under structural mismatch directly generates the mathematical and affective hallmarks of cognitive dissonance: persistent prediction error spikes, erratic motor compensation, and a systematic cascade through negative allostatic affective states.


2. Mathematical Framework & Generative Architecture

2.1 Dual-Channel Generative Model

The agent operates in a two-dimensional continuous spatial domain, tracking a preferred target position 


 
and avoiding an environmental threat.


The subjective internal belief state:


maps to predicted physical space via a generative synaptic weight vector:


by the following:



The total Variational Free Energy of the Neural Network is decomposed into target and threat sub-losses parameterized by target and threat precisions:


For a visible target within visibility range rvis, the sensory prediction error and corresponding sub-loss are given by:



2.2 Synaptic Plasticity & Perceptual Learning

Under standard operating conditions, generative weights adapt via gradient descent on the Variational Free Energy of the Neural Network:







2.3 Active Inference & Motor Action

Motor commands a modulate the physical agent state to directly reduce prediction error:




2.4 Allostatic Accumulation Engine

To capture physiological stress caused by unmitigated prediction error, we implement an Allostatic Accumulation Engine. The engine tracks the target and threat related VFEs, alongside their derivatives. 



3. Experimental Setup & Methodology

We evaluate two primary conditions across approximately 950 simulation frames:

1- Baseline Condition (Flexible Adaptation), shown in Figure 1:

  • Synaptic learning rate larger than zero.

  • Initial generative weights initialized with structural error.

  • Perceptual weights update freely to minimize VFE.


    Figure 1


2- Cognitive Dissonance Condition (Clamped Plasticity), shown in Figure 2:

  • Learning rate clamped to zero.

  • Generative weights fixed at distorted baseline.

  • Perceptual updating blocked entirely due to zero learning rate.


    Figure 2


4. Empirical Results

4.1 Synaptic Convergence & VFE Minimization

In the Flexible Adaptation baseline, sensory prediction errors drives synaptic weight convergence. Over 969 iterations, weights update from initial values toward optimal alignment. As a result of this dual perceptual-active minimization, steady-state Neural Network VFE drops to nearly zero.

In contrast, under Cognitive Dissonance, weights remain frozen at initial values. Because the generative model cannot correct its spatial projection bias, active motor commands continuously overshoot or undershoot real-world spatial coordinates. Consequently, steady-state Neural Network VFE remains chronically trapped at an average of 56.5 times higher than baseline:





4.2 Affective State Distribution & Allostatic Cascades

The chronic presence of unresolvable VFE under clamped plasticity alters the agent's emotional trajectory.

  • Baseline Scenario: The agent maintains baseline affective equilibrium.

  • Cognitive Dissonance Scenario: As chronic prediction errors persist without resolution, VFE metrics continually accumulate, producing a clear affective cascade from baseline equilibrium towards affective states denoting distress.

Cumulatively, the clamped agent spends 37.82% of its operational lifespan in negative allostatic affective states, whereas the baseline agent spends 0.00% in these states.


5. Discussion & Neurocomputational Implications

5.1 Psychological Mechanism of Cognitive Dissonance

Our simulation demonstrates that cognitive dissonance can be formalized as an intractable Active Inference trap. When an agent's internal model makes incorrect predictions about the world, it experiences Variational Free Energy. Under normal conditions, the agent reduces this energy by either updating its beliefs or acting upon the environment.

When learning rates are clamped, perceptual inference is disabled. The agent cannot update its beliefs. It is forced to rely entirely on active inference (motor behavior) to resolve the error. However, because its motor actions are driven by a initially flawed internal model, its movements consistently fail to eliminate the prediction error.

This creates a self-reinforcing loop:





5.2 Clinical & Psychiatric Extensions

This formulation provides a clear framework for modeling several psychological phenomena:

  • Dogmatism & Ideological Rigidity: Individuals who refuse to adjust core beliefs when presented with contradicting facts experience elevated chronic distress and often respond with heightened behavioral aggression (represented by the transition into anger states).

  • Trauma & Rigid Schema: In conditions like PTSD, cognitive schema remain locked, preventing sensory updates and leaving the individual in a state of hyper-arousal and chronic distress.

  • Anhedonia & Learned Helplessness: Extended exposure to unresolvable VFE eventually depletes active motor responses, causing the agent to cease exploratory behavior altogether.


6. Conclusion

By integrating Active Inference with an Allostatic Accumulation Engine, we have demonstrated that clamping perceptual learning rates under structural prediction errors reproduces the core dynamics of cognitive dissonance. Without synaptic weight adaptation, agents are unable to resolve Variational Free Energy, driving steady-state error levels up by 56.5 times and triggering a systematic emotional cascade into stress, frustration, and anger. This computational architecture offers a quantitative framework for studying psychological rigidity, affective disorders, and decision-making under unresolvable conflict.



References

Festinger, L. (1957). A Theory of Cognitive Dissonance. Stanford University Press.

Friston, K. (2010). The free-energy principle: a unified brain theory?. Nature Reviews Neuroscience, 11(2), 127-138.

Parr, T., Pezzulo, G., & Friston, K. J. (2022). Active Inference: The Free Energy Principle in Mind, Brain, and Behavior. MIT Press.

Badcock, P. B., Friston, K. J., & Ramstead, M. J. (2019). The hierarchically mechanics of the brain: An active inference hypothesis for evolutionary systems biology. Physics of Life Reviews, 31, 219-258.

Friday, August 7, 2026

Breaking the Coordinates: Why Biological AI Infers Velocity, Not Location

For a list of all posts go here.

Abstract / Introduction

In standard agentic AI development, artificial agents are treated like omniscient machines: they read their exact X, Y, Z Cartesian coordinates from a front-end engine, compute a path vector, and move. However, when building biologically inspired AI using Active Inference—the framework where agents act to minimize Variational Free Energy (VFE)—this absolute coordinate paradigm breaks down catastrophically.

In this post, we explore a crucial architectural pivot discovered during the development of an allostatic, emotion-driven agent chasing an evasive target. We demonstrate how shifting an agent’s neural network from inferring absolute coordinates to predicting relative updates (velocity-based integration) resolves critical training instabilities, uncouples learning from environmental scale, and unlocks realistic emotional dynamics.


The Simulation: Chasing the Evasive Target

Our setup involves a dual-channel Active Inference Neural Network. The agent must balance two competing drives: maximizing target proximity (foraging/motivation) while remaining clear of a hazardous threat zone (survival).

To test the resilience of the agent's generative model, we introduce a "Rabbit Run" phase. At a specific tick, the target ceases to be stationary and actively flees, continuously shifting positions to remain just out of the agent’s reach.

In previous versions of the algorithm, this sudden environmental shift has caused a profound algorithmic crisis depending entirely on the physical size of the map boundary.


The Absolute Coordinate Pitfall

In early iterations of our network, the state prediction for the internal belief was represented multiplicatively against absolute coordinate space:




When the arena boundaries were tightly constrained, the agent successfully tracked the fleeing target. However, when the environment expanded to accommodate the fleeing target, the agent suffered catastrophic destabilization. The tracking dots vanished from the viewport, the trail became erratic, and Variational Free Energy exploded.


Why Does It Explode?

In an absolute coordinate framework, synaptic weights act as a massive amplifier for distance belief.

  • When an agent is near the origin, a micro-adjustment to a weight has a negligible effect.

  • When the agent chases a target out to larger distances, that same minor weight adjustment is multiplied. The error gradients fluctuate wildly, throwing the motor output into an unrecoverable feedback loop.


The Biological Solution: Relative Interative Movement

Biological nervous systems do not possess internal GPS trackers mapping absolute grid lines across the planet. The motor cortex does not issue coordinates; it issues commands for torque, velocity, and spatial shifts.


Inspired by this biological truth, we restructured the state estimation of our Active Inference engine. Instead of predicting absolute map location, the network was modified to predict the transition shift relative to its current baseline, scaling the incoming velocity command by the synaptic weights:






Accordingly, the synaptic weight updates were decoupled from absolute values and tied strictly to the velocity vectors driving the change:





The Mathematical Result

By switching to relative updates, the magnitude of the coordinate system ceases to matter. Whether the agent is calculating a trajectory step at (1.0, 1.0) or navigating deep into an open-world map at (1500.0, 1500.0), the matrix operations remain perfectly bounded. The learning dynamics become scale-invariant.


Cascading Benefits: Unlocking Emotional Intelligence

The most profound side-effect of moving to a relative-movement architecture was the stabilization of the agent's Allostatic Accumulation Engine—the subsystem responsible for tracking emotional states like Stress, Frustration, and Anger.

The engine tracks chronic free-energy distress by looking at the moving average of error velocity:





When the absolute coordinate bug was present, wild fluctuations in raw map values created false micro-jitters in the error velocity metric, tricking the system into thinking it was making meaningful learning progress.


Once the relative integration fix was deployed, the noise vanished. As seen in our latest empirical logs, the agent successfully registered the psychological weight of the unyielding chase. It escalated smoothly from Surprised (handling novelty) to Stressed (high VFE accumulation), to Frustrated (unresolved error over 150 frames), and finally full allostatic entrenchment: Angry (at 300+ frames).


Conclusion & Takeaways for Developers

When designing the next generation of agentic AI, moving past simple pathfinding toward cognitive architectures requires respecting biological constraints.


  1. Never let learned weights multiply absolute coordinates. It couples the brain of your agent directly to the dimensions of your 3D asset maps.

  2. Predict the delta, not the destination. Inferring relative velocity makes an agent's internal logic robust against sprawling open worlds.

  3. True emotion requires clean tracking. Complex cognitive traits like frustration cannot emerge if your emotional metrics are constantly drowned out by numerical coordinate noise.


By grounding your generative models in relative mechanics, you create agents that don't just navigate worlds smoothly—they react to them with genuine behavioral depth.


Playing with the MInd

  Playing with the Mind: Why Gamifying Artificial Sentience is the Key to Understanding Consciousness When we think of cutting-edge artifici...