psychology_alt

HEGELIAN SIMULATION ENGINE v2.1

science Documentation

Scientific & Philosophical Concepts

Reference documentation for the 10-variable metabolic ODE system with 80-neuron CTRNN, neuromodulated Hebbian learning, and 9-layer Hegelian progression. No gradients. No loss functions. No backpropagation. Organisms live or die by viability alone.

bolt

1. Metabolism & Homeostasis

N_METABOLIC = 10

The metabolic core is a 10-variable ODE system with 20 mass-action reactions organized in four layers of chemical structure. Five substrates (S1-S5) are consumed from the environment, three catalysts (C1-C3) enable and regulate reactions, and two intermediates (P1-P2) mediate delayed effects. In Hegel's terms, this is Life (Leben): the organism distinguishes itself from the environment through metabolic self-maintenance.

Substrates (S1-S5)

Environmental input, consumed by reactions. Death if any S < 0.01 or > 100.

input: 0.3 (S1-S3), 0.35 (S4), 0.30 (S5)
decay: 0.1 (S1-S3), 0.08 (S4-S5)

Catalysts (C1-C3)

Cross-repair network: C2 repairs C1, C1 repairs C2, P1 produces C3. Death if any C < 0.001.

decay: 0.05 (C1-C2), 0.06 (C3)
C3 autocatalytic (MM, Kd=2.0)

Intermediates (P1-P2)

Produced by Layer 2 reactions, mediate delayed effects. Death if P > 50 (toxic accumulation).

decay: 0.05 (natural) + 0.06 (degradation)
P1 feeds C3 production (saturating)
20-Reaction Network (4 Layers) function
Layer 1: Surface (r1-r5) — easily learnable
r1 = k1·C1·S1·S2    r2 = k2·C2·S2·S3    r3 = k3·S1·S3
r4 = k4·C1·S4·S5    r5 = k5·C2·S1·S4
Layer 2: Intermediate (r6-r10) — delayed effects
r6 = k6·C3·S2·S4 → P1    r7 = k7·C1·S3·S5 → P2
r8 = k8·P1·S1    r9 = k9·P2·S2    r10 = k10·P1·P2
Layer 3: Catalyst Repair (r11-r14) — cross-catalytic
r11 = k11·C2·S1·inhib    r12 = k12·C1·S3·inhib
r13 = k13·P1/(Kd+P1)·inhib    r14 = k14·C3·(C3/(2+C3))·S4·inhib
Layer 4: Hidden Regulators (r15-r20) — not sensed
r15 = k15·H1·S1·S5    r16 = k16·(1-H1)·S2·S4    r17 = k17·H2·C1
H1 = 0.5 + 0.5·sin(2πt/50000)    H2 = σ(20·(H1-0.5))
inhib = toxic zone enzyme inhibition (Michaelis-Menten). H1, H2 = hidden regulators the organism cannot sense — learned surface patterns break when these switch. Hegel's appearance (Schein) giving way to essence (Wesen).
science

Enzyme Inhibition (v2.1.4)

Toxic zones inhibit catalyst repair enzymes via Michaelis-Menten kinetics: inhib = 1/(1 + tox/Ki) where Ki = 0.15. At tox = 0.15 → 50% inhibition, tox = 1.0 → 87% inhibition. Toxins don't drain metabolites — they suppress the repair machinery. Biologically correct: competitive enzyme inhibition.

landscape

2. Environment & World Structure

300×300 torus

The world is a 300×300 toroidal grid with 5 independent resource fields (one per substrate S1-S5). Resources regenerate, diffuse, deplete locally, and cycle with distinct periods. The environment has lawful structure — cyclical dynamics, correlated perturbation cascades, and spatial gradients — giving Hebbian learning something meaningful to discover.

Cyclical Resource Dynamics

Field Period Phase
R1 (S1)8,0000
R2 (S2)12,0002π/5
R3 (S3)6,0004π/5
R4 (S4)15,0006π/5
R5 (S5)10,0008π/5
Amplitude: 0.5, Noise: 0.15. Cross-resource interaction: eating Sk depletes Sk+2 by 15%.

Toxic Zones (Layer 3+)

Type Count Radius Strength
Wasteland5-1035-600.3-1.0
Corridor25-400.5-1.0
Food = 0 inside toxic zones. Enzyme inhibition suppresses catalyst repair. Determinate negation: zones must be avoided, not survived through.

Perturbation Cascades

Perturbations target all 10 metabolic variables. Hitting one variable triggers correlated disturbances in 1-3 related variables with 300-500 time unit lags. These create causal laws for the organism to discover — environment has depth.

CATALYST_KNOCKOUT SUBSTRATE_DEPLETION NOISE_BURST INPUT_CUTOFF CATALYST_HALVING
schedule

Coupling Ramp

coupling_alpha = clamp(t / ramp_time, 0, 1). Layer 1-2: 20K ramp (gentle introduction). Layer 3+: 60K ramp (CTRNN needs ~15K to stabilize + ~30K to learn avoidance before toxic zones become lethal at full coupling).

hub

3. CTRNN Architecture

80 neurons, 90-dim ODE

Continuous-Time Recurrent Neural Network with 80 neurons, 41-dimensional sensory input, 3-dimensional motor output, and 4-dimensional voice output. Together with the 10 metabolic variables, each organism is a 90-dimensional ODE system. Multi-timescale dynamics (fast/mid/slow neuron groups) enable both reactive and deliberative behavior.

Neuron State Equation

τi · dyi/dt = -yi + Σj wji · σ(yj + θj) + Ii
  • τ Time constant (multi-scale: fast 1-20, mid 20-100, slow 100-500)
  • w Synaptic weight from j to i (Hebbian-modifiable)
  • σ Sigmoid activation: 1/(1 + exp(-gain·(y+θ)))
  • I Sensory input (41-dim, mapped via W_in)
41-Dimensional Sensory Input
Channels Dim Content
[1:10]10Metabolic state: S1-S5, C1-C3, P1-P2
[11:20]10Affective derivatives: tanh((current-prev)×10)
[21:27]7Environmental: R1-R5 + gradient (forward, lateral)
[28:41]14Other-agent: 2 nearest × (3 motor + 4 voice)

Motor Output (3-dim)

  • M1 Intake modulation (resource gathering rate)
  • M2 Balance / turning (navigation direction)
  • M3 Efficiency (metabolic allocation)
motor = baseline + scale · tanh(W_out · σ(y))
scale: 0.1-2.0 (gene 22), baseline: 0.1-3.0 (gene 23)

Voice Output (4-dim)

  • V1-V4 Bipolar expressive channels [-1, +1]
  • W_voice: 4×20 matrix (10 metabolic + 10 affective input)
  • Oja learning, gated by max(stress, self_model_signal)
  • Observable by other agents (social signal)
psychology

4. Per-Neuron Predictive Coding (PCN)

Rao & Ballard 1999

Each neuron maintains its own prediction error: the difference between its actual activation and what it would be from recurrent + sensory input alone. This per-neuron error modulates which neurons learn — accurate predictors are frozen (preventing drift), while surprised neurons update aggressively. This is NOT hierarchical free-energy minimization; it is local prediction-error gating on Hebbian learning.

Per-Neuron Prediction Error

εi = yi - (Σj wij · σ(yj) + si)
Low ε

Neuron predicts well → learning frozen. Prevents drift in accurate world-model components.

High ε

Neuron is surprised → Hebbian gate opens. Learning resources directed where needed.

Neuromodulation

gate = global_stress · neuron_PCN. Without this, unmodulated Hebbian was NET HARMFUL.

lightbulb

Hegelian Connection: Understanding (Verstand)

PCN corresponds to Hegel's "Force and Understanding" (§132-145). The organism detects lawful regularity in sensory experience — neurons that correctly predict are "understanding" the world. Prediction error is the negation of the subject's certainty by objective reality. structural_signal > 0.1 marks the transition.

self_improvement

5. Self-Model & Prediction

Layer 5-6

The self-model is NOT designed in — it emerges from the failure of the world model. When prediction error persists despite good environmental prediction, the residual must be self-caused. The organism discovers it is an agent in the world by detecting the correlation between its motor output and unexplained sensory change.

Self-Model Signal

self_model_signal = motor_error - ambient_error
structural_signal = max(corr(residual, motor_dev), maxi(|corr(residuali, motor_dev)|))
residual = error - ema_env_error   (error NOT explained by environment)
motor_dev = motor_mag - ema_motor_mag   (motor deviation from pattern)
Motor Error

Prediction error during 10-step motor effect window (post-action). Captures self-caused sensory change.

Ambient Error

Baseline environmental error (non-action-correlated). What the world does regardless of the organism's behavior.

Self-Model Feedback Loop

When self-model signal is positive, it amplifies competitive W_out learning (up to 1.5×). The self-model prediction is subtracted from sensory input before the world-model prediction step — self-knowledge becomes functional. This closes the loop: knowing yourself improves prediction, better prediction strengthens self-knowledge.

Random Projection (64×83) LMS Learning (W_read: 41×64) Prediction Subtraction
lightbulb

Hegelian Connection: Self-Certainty (§163-165)

Layer 5 is "Self-Certainty of Reason." The organism does not receive self-knowledge from outside — it discovers itself as the cause of residual prediction error. Layer 6 is "Desire" (§167-170): correction_benefit > 0.1 AND ambient_error persists — the organism acts to change the world to reduce its own uncertainty.

genetics

6. Natural Selection

41 genes

Evolution by natural selection ONLY. No CMA-ES, no tournament selection, no fitness ranking, no external fitness landscape. Organisms either survive 100K time steps or they die. Survivors are weighted by viability margin. The entire population is seeded from the best genome — genetic drift through mutation alone.

41 Evolvable Genes (Layer-Gated)
Group Genes Unlocked At
Metabolic (k-rates, decay, input)14Layer 1
CTRNN (τ, gain, motor, connectivity)11Layer 2
Hebbian (η, τ_bcm, w bounds)7Layer 3
Organism (dt_hebbian) + Voice2Layer 3
Self-model + Cognitive (memory, planning, concepts)7Layer 5
lightbulb

Why Not CMA-ES?

Philosophical constraint. An external fitness landscape optimization would mean consciousness is being designed rather than emerging. Natural selection preserves what works — the organism's survival IS the only fitness signal. No gradient, no objective function, no optimization target.

neurology

7. Cognitive Architecture

v1.6.0+

Three cognitive capacities emerge atop the sensorimotor-Hebbian base: episodic memory (Erinnerung), planning via self-model lookahead, and concept formation (Verstand). All three are gated by self-model confidence — when the organism doubts, cognitive habits withdraw and motor variance increases naturally.

Episodic Memory

128-slot ring buffer. Stores sensory (41-dim), motor (3-dim), outcome (10-dim), time. Cosine retrieval: similarity > 0.5 triggers recall.

blend = 0.15 · sm_confidence
influence when sim > 0.7 AND count ≥ 5

Planning

Single-step lookahead via self-model prediction. Generates candidate motor actions (±20% perturbation), evaluates by predicted viability.

horizon: 5 (gene 40, range 3-12)
score = -Σ(estimated - 1.0)²
satisficing, not optimizing

Concept Formation

K=8 prototypes via competitive Hebbian clustering over 80-dim neuron activations. Each tracks motor_avg (3) and outcome_avg (10).

familiarity = clamp(count/50, 0, 1)
K×K transition matrix (dialectical)
doubt withdraws conceptual habits
lightbulb

Confidence-Gated Exploration (v1.6.2)

Memory/concept influence scaled by sm_confidence = clamp(1 - pred_error/5, 0, 1). Doubt is not a failure state — it is the withdrawal of rigid habits, allowing motor variance to increase. This is not gradient-based exploration; it is neuromodulatory.

diversity_3

8. Multi-Agent & Recognition

Layers 7-8

Multi-agent interaction is NOT game-theoretic. Two (or three) organisms share the same ODE physics, competing for resources via motor output. Each observes the other's motor (3-dim) and voice (4-dim) through delayed channels. Recognition is measured by prediction correlation: can organism A predict organism B's behavior? No cooperation reward, no payoff matrix — just shared physics and Hebbian learning.

Multi-Agent ODE Dimensions
Mode ODE Dim Layer Details
Solo901-610 metabolic + 80 neural. Other-agent channels = 0.
Pair1807-82×90. 14 other-sensory channels active. Competitive resource sharing.
Triad27093×90. 2-nearest observation. Most complex dynamics.

Recognition Metric

Correlation between A's prediction of B's motor output and B's actual motor. Genuine perception, not engineered cooperation.

r_ab = corr(A_predicted_B_motor, B_actual_motor)
Layer 7: r > 0.3 AND irreducibility > 0.1
Layer 8: r_ab > 0.4 AND r_ba > 0.4 (mutual)

Key Discovery

Recognition requires perception: other_pred_error drives recognition, not viability-based dependence.

Ablation results:
perception OFF → r = 0.0
perception ON  → r = 0.87
Signal is genuine, not an artifact.

"Self-consciousness exists in and for itself when, and by the fact that, it so exists for another; that is, it exists only in being acknowledged." — G.W.F. Hegel, Phenomenology of Spirit §178

stairs

9. Layer Progression (Phenomenology)

9 layers

Each layer adds complexity. Progression is NOT automatic — the organism must demonstrate the capacity through measurable criteria. Each layer has concrete falsification conditions: if a capacity cannot emerge, that failure is scientifically documented.

Layer Hegel Criterion Mode
1 Sense-Certainty Metabolic viability (survive) Solo 90-dim
2 Perception Sensorimotor coupling Solo 90-dim
3 Force & Understanding structural_signal > 0.1 Solo + toxic
4 Laws §132-145, sustained understanding Solo + toxic
5 Self-Certainty predictive_accuracy > 0.3 Solo + toxic
6 Desire correction_benefit > 0.1 AND ambient persists Solo + toxic
7 Recognition r > 0.3 AND irreducibility > 0.1 Pair 180-dim
8 Mutual Perception r_ab > 0.4 && r_ba > 0.4 && other_error > 0.5 Pair 180-dim
9 Observing Reason CEILING — curiosity anti-correlated at 80-neuron scale Triad 270-dim

Layer 9 Ceiling (v1.6.2)

Curiosity criteria are anti-correlated at 80-neuron scale: organisms that explore find nothing new; organisms with productive exploration don't need to explore. The world is too simple for curiosity to have somewhere to go. This is the v1 representational boundary. No shared symbolic space, no concept composition, no representation modification from the outside — these would require architectural changes beyond the current CTRNN+Hebbian framework.