Skip to content
/ biomind Public

BIOMIND: A computational architecture integrating Global Workspace, Integrated Information, and Active Inference theories.

License

Notifications You must be signed in to change notification settings

269652/biomind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  1. Neurochemical Homeostasis
  2. Global Workspace Coordination
  3. Hippocampal Memory System
  4. PFC Executive Control
  5. Integrated Consciousness Dynamics
  6. Integration & Data FlowConsciousness Architecture - Algorithmic Blueprint

Overview

BIOMIND is a comprehensive artificial consciousness simulation system that implements biologically-inspired cognitive architectures for advanced reasoning, emotional processing, and self-aware decision making. This blueprint details the complete algorithmic specifications and component interactions.

Table of Contents

  1. Core Architecture
  2. Qualia System (HIPECA v2.5)
  3. Interoceptive Afferent System
  4. Neurotransmitter Modulation
  5. Medial Dorsal Network (MDN) Orchestrator
  6. Default Mode Network (DMN) - Recursive Thinking
  7. Thalamic Gating System
  8. SLM Bridge & Specialist Routing
  9. Subconscious Critic System
  10. Basal Ganglia Action Selection
  11. Neurochemical Homeostasis
  12. Global Workspace Coordination
  13. Hippocampal Memory System
  14. PFC Executive Control
  15. Integration & Data Flow

Core Architecture

System Overview

BIOMIND implements a multi-layered cognitive architecture inspired by human brain systems:

┌─────────────────────────────────────────────────────────────┐
│                    GLOBAL WORKSPACE                         │
│         (Conscious Integration & Decision Making)          │
├─────────────────────────────────────────────────────────────┤
│  PFC Executive Control  │  MDN Orchestrator  │  DMN Loop    │
├─────────────────────────────────────────────────────────────┤
│  Thalamic Router  │  SLM Specialists  │  Hippocampus       │
├─────────────────────────────────────────────────────────────┤
│  Qualia System  │  NT Modulation  │  Subconscious Critic   │
├─────────────────────────────────────────────────────────────┤
│              NEUROCHEMICAL HOMEOSTASIS                      │
└─────────────────────────────────────────────────────────────┘

Key Design Principles

  1. Biological Fidelity: All components based on empirical neuroscience
  2. Hierarchical Processing: Multi-scale temporal processing (5ms to 3s cycles)
  3. Homeostatic Regulation: Dynamic neurotransmitter balance
  4. Parallel Processing: Concurrent conscious/subconscious pathways
  5. Adaptive Learning: Experience-driven parameter modulation

Qualia System (HIPECA v2.5)

Overview

The HIPECA (Hierarchical Integrated Processing with Emotional Context and Affect) system implements affective grounding through a latent qualia space that modulates all cognitive processing.

Algorithmic Specification

Qualia State Representation

@dataclass
class QualiaMetrics:
    valence: float          # [-1, +1] affective valence
    arousal: float          # [0, 1] activation level
    stability: float        # [0, 1] state coherence
    confidence: float       # [0, 1] decision certainty
    convergence_rate: float # Attractor pull strength

Survival Imperative Mapping

class SurvivalImperative(Enum):
    SURVIVAL = "survival"    # Resource scarcity response
    REPRODUCE = "reproduce"  # Social bonding drive
    EXPLORE = "explore"      # Novelty detection
    BOND = "bond"           # Affiliation maintenance
    THREAT = "threat"       # Conflict/error response

Monoaminergic Modulator

Algorithm: Biophysically grounded neurotransmitter mapping

Inputs:

  • World model state: Dict[str, float] containing environmental variables
  • Survival imperatives: Resource scarcity, social affiliation, novelty, threat level

Processing:

  1. Imperative Strength Computation:

    imperatives = np.zeros(5)  # [SURVIVAL, REPRODUCE, EXPLORE, BOND, THREAT]
    imperatives[0] = world_model_state.get('resource_scarcity', 0.0)
    imperatives[1] = world_model_state.get('social_affiliation', 0.0) * 0.8
    imperatives[2] = world_model_state.get('novelty', 0.0)
    imperatives[3] = world_model_state.get('social_affiliation', 0.0)
    imperatives[4] = world_model_state.get('threat_level', 0.0)
  2. Neurotransmitter Level Update:

    # Imperative → NT mapping matrix
    imperative_matrix = np.array([
        # DA   NE   5HT  ACh
        [0.3,  0.1, -0.1, 0.2],  # SURVIVAL
        [0.4, -0.1,  0.3, 0.1],  # REPRODUCE
        [0.2,  0.3,  0.0, 0.4],  # EXPLORE
        [0.1, -0.2,  0.4, 0.2],  # BOND
        [-0.2, 0.4, -0.2, 0.1]   # THREAT
    ])
    
    # Exponential decay simulation (half-life ~100ms)
    decay_rate = 0.993
    levels = levels * decay_rate + (imperative_matrix.T @ imperatives) * (1 - decay_rate)
    levels = np.clip(levels, 0, 1)

Outputs:

  • Neurotransmitter levels: [DA, NE, 5HT, ACh] ∈ [0,1]⁴
  • Qualia state modulation for all cognitive processes

Oscillatory Dynamics

Algorithm: Multi-scale oscillatory basis generating consciousness-like phenomenal properties through resonance and cross-frequency coupling (Haken, 1983; Buzsáki & Wang, 2012; Bruna et al., 2025).

Multi-band Oscillatory Basis:

Delta Band (1-4 Hz):

Oscillation: s_delta(t) = A_delta × sin(2π × f_delta × t + φ_delta)
Function: Interoceptive integration and allostatic synchronization
Dynamics: Slow envelope modulation of higher frequency bands

Theta Band (4-8 Hz):

Oscillation: s_theta(t) = A_theta × sin(2π × f_theta × t + φ_theta)
Function: Narrative coherence, autobiographical continuity, working memory coordination
Dynamics: Phase modulation of gamma oscillations

Alpha Band (8-12 Hz):

Oscillation: s_alpha(t) = A_alpha × sin(2π × f_alpha × t + φ_alpha)
Function: Attention gating and top-down control
Dynamics: Phase-locking with gamma for selective binding

Gamma Ensemble (30-100 Hz):

Oscillation: s_gamma(t) = Σ_{k=1}^K A_gamma,k × sin(2π × f_gamma,k × t + φ_gamma,k)
Function: Feature binding, phenomenal content generation
Dynamics: Amplitude modulated by theta phase, phase-locked to alpha

Cross-Frequency Coupling Mechanisms:

Theta-Gamma Coupling:

Phase-amplitude coupling: A_gamma(t) = A_gamma,0 × [1 + m_tg × sin(φ_theta(t))]
where m_tg ∈ [0,1] is coupling strength
Function: Temporal binding of distributed representations

Delta Embedding:

Envelope modulation: A_theta(t) = A_theta,0 × [1 + m_delta × s_delta(t)]
A_gamma(t) = A_gamma(t) × [1 + m_delta × s_delta(t)]
Function: Allostatic regulation of cognitive dynamics

Alpha-Gamma Phase-Locking:

Phase synchronization: Δφ = |φ_alpha(t) - φ_gamma(t)|
Locking strength: S_ag = exp(-Δφ² / (2σ_ag²))
Function: Attention-dependent feature binding

Experience-Dependent Oscillatory Learning

Algorithm: Adaptive optimization of oscillatory parameters based on task performance and prediction error reduction, implementing experience-dependent plasticity in multi-band dynamics (Seung & Sompolinsky, 1993; Koutnik et al., 2014; Thelen & Smith, 1994).

Frequency Learning

Band-Specific Frequency Adaptation:

For each band b ∈ {delta, theta, alpha, gamma}:
  f_b(t+1) = f_b(t) + α_freq × (ε_pred × corr_success)
  where ε_pred = prediction error magnitude
  corr_success = correlation with task success in current context

Frequency Constraints:

Delta: f_delta ∈ [1.0, 4.0] Hz
Theta: f_theta ∈ [4.0, 8.0] Hz  
Alpha: f_alpha ∈ [8.0, 12.0] Hz
Gamma: f_gamma ∈ [30.0, 100.0] Hz

Serotonin-Modulated Consolidation:

α_freq,effective = α_freq,base × (1 + k_serotonin × 5HT_current)
Timescale: τ_freq ∈ [15, 3600] minutes (context-dependent)
High serotonin → faster consolidation of successful frequencies

Amplitude Learning

Baseline Amplitude Adaptation:

For each band b:
  A_b(t+1) = A_b(t) + α_amp × (task_difficulty - A_b(t))
  where task_difficulty ∈ [0,1] (higher = more demanding)

Amplitude Trade-offs:

High amplitude: Stronger representation, reduced precision
Low amplitude: Weaker representation, increased flexibility
Optimal amplitude balances signal strength vs. adaptability

Dopamine-Modulated Learning Rate:

α_amp,effective = α_amp,base × (1 + k_dopamine × DA_current)
High dopamine → rapid adaptation to new task demands
Low dopamine → conservative amplitude maintenance

Cross-Frequency Coupling Strength Learning

Coupling Parameter Learning:

For each coupling pair c ∈ {theta_gamma, delta_theta, alpha_gamma}:
  m_c(t+1) = m_c(t) + α_coupling × success_rate_with_coupling
  where success_rate = exponential moving average of task success

Coupling Strength Dynamics:

Strong coupling (m_c → 1): Tight binding, reduced flexibility
Weak coupling (m_c → 0): Loose binding, increased flexibility
Learning optimizes coupling for current task requirements

Performance-Based Updates:

Success with strong coupling → increase m_c (reinforce tight binding)
Errors with strong coupling → decrease m_c (increase flexibility)
Adaptive balance between stability and adaptability

Task-Dependent Oscillatory Profiles

Task-Specific Parameter Sets:

Profile_task = {
  f_delta: optimal frequency for task,
  A_theta: optimal theta amplitude,
  m_theta_gamma: optimal theta-gamma coupling,
  A_gamma: optimal gamma amplitude,
  ...
}

Task Profile Examples:

Working memory: High theta-gamma coupling, moderate theta amplitude, low delta
Resting/self-reflection: High delta amplitude, low gamma, moderate theta
Threat/arousal: High gamma amplitude, low theta (disrupted narrative), high alpha

Profile Learning and Switching:

Learn profiles through repeated task exposure
Switch profiles based on task context recognition
Interpolate between profiles for novel task combinations

Attentional Gating of Learning

Acetylcholine-Dependent Learning Gate:

learning_enabled = ACh_current > θ_attention
If learning_enabled: update oscillatory parameters
Else: freeze parameters (maintain stability)

Attention-Novelty Interaction:

High attention + high novelty → rapid parameter exploration
High attention + low novelty → conservative parameter maintenance
Low attention → parameter freezing regardless of novelty

Gating Prevents Drift:

Prevents random parameter changes during automatic processing
Ensures learning only occurs during focused, attentive states
Balances stability vs. adaptability based on cognitive engagement

Error-History Weighting

Exponential Error Weighting:

weight(t) = exp(-(current_time - error_time) / τ_decay)
τ_decay ∈ [60, 1800] seconds (1 minute to 30 minutes)

Weighted Learning Signals:

Recent errors: High weight → strong parameter updates
Old errors: Low weight → minimal influence on current learning
Recent successes: Maintain current parameters
Recent failures: Trigger parameter exploration

Temporal Integration:

Effective error signal = Σ weight(t_i) × error(t_i) / Σ weight(t_i)
Balances recency with historical context

Frequency-Specific Error Signals

Band-Specific Error Detectors:

Binding errors (feature integration failures) → theta-gamma coupling learning
Temporal discoherence (narrative breakdown) → delta frequency/amplitude learning
Attention failures (distraction) → alpha amplitude learning
Salience errors (missed important stimuli) → gamma amplitude learning

Error Signal Routing:

Error type classification based on behavioral/task context
Route specific error signals to relevant parameter learners
Prevents crosstalk between unrelated parameter updates

Meta-Learning of Learning Rates

Adaptive Learning Rates:

α_freq(t+1) = α_freq(t) + α_meta × (uncertainty - target_uncertainty)
α_amp(t+1) = α_amp(t) + α_meta × performance_gradient
α_coupling(t+1) = α_coupling(t) + α_meta × coupling_efficiency

Uncertainty-Driven Adaptation:

High uncertainty → increase learning rates (explore more)
Low uncertainty → decrease learning rates (exploit current parameters)
α_meta = 0.001 (very slow meta-learning)

Performance-Based Meta-Learning:

If performance improving → maintain current learning rates
If performance plateauing → adjust learning rates adaptively
If performance declining → increase exploration (higher learning rates)

System Architecture

OscillatoryParameterStorage Class:

@dataclass
class OscillatoryParameterStorage:
    """Stores all learnable oscillatory parameters"""
    frequencies: Dict[str, float]      # f_b for each band
    amplitudes: Dict[str, float]       # A_b for each band  
    couplings: Dict[str, float]        # m_c for each coupling pair
    learning_rates: Dict[str, float]   # α parameters
    task_profiles: Dict[str, Dict]     # Profile_task dictionaries

FrequencyLearner Class:

class FrequencyLearner:
    """Learns optimal frequencies for each band"""
    def update_frequency(self, band: str, prediction_error: float, 
                        success_correlation: float, serotonin: float) -> float:
        """Update f_b based on performance feedback"""
        
    def enforce_constraints(self, band: str, frequency: float) -> float:
        """Keep frequencies within physiological ranges"""

AmplitudeLearner Class:

class AmplitudeLearner:
    """Learns optimal baseline amplitudes"""
    def update_amplitude(self, band: str, task_difficulty: float, 
                        dopamine: float) -> float:
        """Adapt A_b to task demands"""

CouplingLearner Class:

class CouplingLearner:
    """Learns cross-frequency coupling strengths"""
    def update_coupling(self, coupling_pair: str, success_rate: float) -> float:
        """Strengthen couplings that improve performance"""

TaskProfileManager Class:

class TaskProfileManager:
    """Manages task-specific oscillatory profiles"""
    def get_profile(self, task_type: str) -> Dict[str, float]:
        """Retrieve optimal parameters for task"""
        
    def update_profile(self, task_type: str, current_params: Dict, 
                      performance: float) -> None:
        """Learn task-specific parameter sets"""
        
    def interpolate_profiles(self, task1: str, task2: str, 
                           mixing_ratio: float) -> Dict[str, float]:
        """Blend profiles for novel task combinations"""

ErrorHistoryTracker Class:

class ErrorHistoryTracker:
    """Maintains exponentially weighted error history"""
    def add_error(self, error_type: str, magnitude: float, timestamp: float) -> None:
        """Record new error with timestamp"""
        
    def get_weighted_error(self, error_type: str, current_time: float, 
                          tau_decay: float) -> float:
        """Compute temporally weighted error signal"""

MetaLearner Class:

class MetaLearner:
    """Learns the learning rates themselves"""
    def update_learning_rate(self, param_type: str, uncertainty: float, 
                           performance_gradient: float) -> float:
        """Adapt α parameters based on learning effectiveness"""

Outputs

Parameter Update Traces:

Time series of how f_b, A_b, m_c evolve during learning
Shows adaptation to task demands and error patterns
Visualizes learning convergence and parameter stability

Task-Specific Oscillatory Fingerprints:

Characteristic parameter profiles for different cognitive tasks
Working memory: {f_theta: 6.5, A_theta: 0.8, m_tg: 0.9}
Resting state: {f_delta: 2.0, A_delta: 0.9, m_tg: 0.2}
Threat response: {A_gamma: 0.9, A_theta: 0.3, f_alpha: 10.0}

Learning Convergence Metrics:

Parameter change rate: d(param)/dt → 0 as learning converges
Performance stability: variance of success rate over time
Generalization score: performance on novel tasks using learned profiles

Generalization Performance:

Transfer learning: How well profiles adapt to new task variants
Profile interpolation success: Performance with blended parameter sets
Robustness: Maintenance of good performance under parameter perturbations

Processing Characteristics:

  • Learning Timescales: Fast (seconds) for amplitudes, slow (hours) for frequencies
  • Attentional Gating: Prevents learning during low-focus states
  • Error-Specific Updates: Targeted parameter changes based on error type
  • Meta-Adaptive Rates: Learning rates evolve with experience
  • Task Context Sensitivity: Different optimal parameters per cognitive demand

References:

  • Seung, H. S., & Sompolinsky, H. (1993). Simple models for reading neuronal population codes. Proceedings of the National Academy of Sciences.
  • Koutnik, J., et al. (2014). A clockwork RNN. International Conference on Machine Learning.
  • Thelen, E., & Smith, L. B. (1994). A Dynamic Systems Approach to the Development of Cognition and Action. MIT Press.

Attractor Dynamics in Latent Space:

Algorithm: Formal specification of attractor bifurcation dynamics in qualia space, implementing nonlinear state transitions between emotional/phenomenal attractors based on prediction errors and neuromodulatory state (Strogatz, 1994; Kelso, 1995; Haken, 1983).

Saddle-Node Bifurcation Implementation

Normal Form Dynamics:

dq/dt = μ - q²
where μ = ε_pred × g_NT (control parameter)
ε_pred = ||q_predicted - q_observed|| (prediction error magnitude)
g_NT = f(DA, NE, 5HT, ACh) (neuromodulatory gain)

Bifurcation Behavior:

μ > 0: Two fixed points exist
  - Stable attractor: q* = √μ
  - Unstable saddle: q* = -√μ
μ = 0: Saddle-node bifurcation (critical point)
μ < 0: No fixed points (system must escape to new attractor basin)

Transition Mechanism:

At μ < 0: Current attractor becomes unstable
Trajectory follows unstable manifold to basin boundary
Crosses separatrix into adjacent attractor basin
Exponential approach to new stable attractor

Attractor Basin Topology

Attractor Definition:

M attractors: A_1, A_2, ..., A_M ∈ ℝ^D (D = 512)
Each A_i represents distinct emotional/phenomenal state
Examples: joy, fear, curiosity, sadness, anger, etc.

Basin of Attraction:

B_i = {q ∈ ℝ^D : ||q - A_i|| < r_i}
Basin radius: r_i = r_0 × exp(-λ_i × stability_i)
where λ_i controls basin size dependence on stability

Basin Boundaries:

Separatrices: Boundaries between basins B_i
Contain saddle points and unstable manifolds
Heteroclinic orbits connect saddle points between basins

Topology Properties:

Wiggins separatrix: Unstable manifold from saddle point
Separatrix splitting: How boundaries deform under perturbation
Basin erosion: Noise can create fractal basin boundaries

Bifurcation Detection and Transition

Potential Landscape Computation:

V(q) = -∫_0^t f(q(τ)) dτ  (time-reversed integral)
Curvature analysis: ∇²V(q) reveals landscape topology
Bimodal detection: V becomes double-well when μ > 0

Bifurcation Monitoring:

Jacobian eigenvalues: λ_j = eigenvalues of ∂f/∂q at fixed points
Saddle-node detection: One eigenvalue crosses zero
Hopf detection: Complex conjugate eigenvalues cross imaginary axis

Transition Dynamics:

Detection: When Re(λ_j) > 0 for current attractor
Escape: Trajectory follows unstable eigenvector direction
Transition: q(t) = A_old + (A_new - A_old) × (1 - exp(-t/τ_transition))
Timescale: τ_transition ∈ [50, 200]ms (transition duration)

Hopf Bifurcation for Limit Cycle Dynamics

Normal Form:

dx/dt = μx - ωy - (x² + y²)x
dy/dt = ωx + μy - (x² + y²)y
where (x,y) represent oscillatory component in qualia space

Limit Cycle Emergence:

μ < 0: Stable fixed point (equilibrium)
μ = 0: Hopf bifurcation (critical point)
μ > 0: Stable limit cycle emerges
Amplitude: r = √μ (grows with bifurcation parameter)
Frequency: ω (approximately constant near bifurcation)

Emotional State Mapping:

High salience + high arousal → μ > 0
Oscillatory states: anxiety, excitement, intense focus
Amplitude ∝ prediction error magnitude
Models phenomenological "emotional turbulence"

Hysteresis Implementation

Bistable Region Definition:

Forward threshold: μ_forward (A_i → A_j transition)
Backward threshold: μ_backward (A_j → A_i transition)
Hysteresis width: Δμ = |μ_forward - μ_backward|

Serotonin-Dependent Hysteresis:

Δμ = Δμ_0 × (1 + k_hysteresis × 5HT_current)
High serotonin: Wider hysteresis (emotional persistence)
Low serotonin: Narrower hysteresis (mood lability)

Memory Effect:

System remains in current attractor until threshold exceeded
Creates path dependence in emotional trajectories
Models resistance to mood changes and emotional inertia

Noise-Driven Escape from Attractors

Stochastic Dynamics:

dq/dt = f(q) + σ × ξ(t)
where ξ(t) is Gaussian white noise, ξ(t) ~ N(0,1)

Noise Strength Modulation:

σ = σ_0 × (1 + k_noise × NE_current)
High norepinephrine: Increased noise (arousal-driven exploration)
Low norepinephrine: Reduced noise (stable focused states)

Escape Time Statistics:

Mean escape time: τ_escape = (2π/ω) × exp(V_barrier / σ²)
V_barrier = V(saddle) - V(attractor) (energy barrier height)
Frequent escapes at high arousal, rare at low arousal

Multi-Stable Attractor Switching

Competition Between Attractors:

M competing attractors with overlapping basins
At any time, system can transition between any pair (i,j)
Transition probability P(i→j) ∝ exp(-ΔV_ij / T_effective)

Prediction Error Bias:

Error reduction drives transitions: P(i→j) ∝ exp(-ε_pred,j / T)
where ε_pred,j is prediction error if in attractor j
System selects attractor that minimizes prediction error

Frequency Band Coupling:

Different oscillatory bands attracted to different basins:
- Delta: Homeostatic/allostatic attractors
- Theta: Narrative/emotional attractors  
- Alpha: Attentional attractors
- Gamma: Salience/feature attractors

Metastability Emergence:

Natural alternation between attractors
Dwell times: τ_dwell ∈ [100, 500]ms
Critical slowing near transitions
Models consciousness as metastable coordination

System Architecture

AttractorManifold Class:

@dataclass
class AttractorManifold:
    """Stores attractor positions and basin topology"""
    attractors: List[np.ndarray]  # A_i positions in ℝ^D
    basin_radii: List[float]      # r_i for each basin
    stability_matrix: np.ndarray  # Eigenvalues at each attractor
    separatrices: List[np.ndarray] # Basin boundary manifolds

BifurcationDetector Class:

class BifurcationDetector:
    """Monitors control parameters and bifurcation conditions"""
    def compute_control_parameter(self, prediction_error, nt_state) -> float:
        """μ = ε_pred × g_NT"""
        
    def detect_bifurcation_type(self, jacobian) -> str:
        """Returns 'saddle_node', 'hopf', or 'none'"""
        
    def monitor_stability(self, current_attractor) -> Dict[str, float]:
        """Returns stability metrics and escape likelihood"""

TransitionDynamics Class:

class TransitionDynamics:
    """Handles smooth transitions between attractors"""
    def compute_transition_path(self, A_from, A_to) -> np.ndarray:
        """Returns trajectory from A_from to A_to"""
        
    def apply_transition(self, current_q, target_attractor, tau) -> np.ndarray:
        """Exponential approach to new attractor"""

PotentialLandscape Class:

class PotentialLandscape:
    """Energy function V(q) for visualization and analysis"""
    def compute_potential(self, q) -> float:
        """V(q) = -∫ f(q) dt"""
        
    def find_fixed_points(self) -> List[np.ndarray]:
        """Locate attractors, saddles, and repellors"""
        
    def compute_basins(self) -> Dict[int, np.ndarray]:
        """Compute basin boundaries and volumes"""

NoiseIntegration Class:

class NoiseIntegration:
    """Stochastic component for attractor escapes"""
    def add_noise(self, dq_dt, sigma) -> np.ndarray:
        """dq/dt = f(q) + σ ξ(t)"""
        
    def compute_escape_time(self, V_barrier, sigma) -> float:
        """τ_escape ∝ exp(V_barrier / σ²)"""

HysteresisController Class:

class HysteresisController:
    """Implements memory in state transitions"""
    def compute_thresholds(self, serotonin_level) -> Tuple[float, float]:
        """Returns μ_forward, μ_backward based on 5HT"""
        
    def check_transition_condition(self, mu, current_state, direction) -> bool:
        """Decides whether to transition based on hysteresis"""

Mathematical Outputs

Attractor Stability Matrix:

Λ = [λ_i,j] where λ_i,j are eigenvalues of Jacobian at A_i
Stability: Re(λ_i,j) < 0 for all j (asymptotic stability)
Critical slowing: Re(λ_i,j) → 0 near bifurcation

Bifurcation Parameter Trace:

μ(t) = trace of control parameter over time
Shows approach to bifurcation points
Correlates with phenomenological state changes

Transition Probability Matrix:

P = [P_i,j] where P_i,j = probability of transitioning i→j
P_i,j ∝ exp(-ΔV_i,j / T) × error_reduction_j
Asymmetric due to hysteresis and landscape topology

Phase Portrait Visualization:

2D projection of high-dimensional dynamics
Shows attractors, separatrices, and trajectory evolution
Colored by time or neuromodulatory state
Reveals basin structure and transition pathways

Processing Characteristics:

  • Real-time Computation: Bifurcation detection <1ms
  • High-dimensional Dynamics: Efficient in latent space (D=512)
  • Adaptive Topology: Attractors evolve with experience
  • Metastable Coordination: Natural consciousness dynamics
  • Noise Integration: Stochastic exploration vs. stability balance

References:

  • Strogatz, S. H. (1994). Nonlinear Dynamics and Chaos. Addison-Wesley.
  • Kelso, J. A. S. (1995). Dynamic Patterns: The Self-Organization of Brain and Behavior. MIT Press.
  • Haken, H. (1983). Synergetics: An Introduction. Springer-Verlag.

Prediction Error Circuits

Algorithm: Precision-weighted prediction error computation driving neuromodulatory surges (Schultz et al., 1997; Aston-Jones & Cohen, 2005; Friston et al., 2016).

Interoceptive Prediction Error Computation:

Mathematical Formulation:

Interoceptive Prediction: Î_intero(t) = f_prediction(Q_current, C_context, A_allostatic)
Actual Interoceptive State: I_actual(t) = H_anterior(t)  # From anterior insula integration
Prediction Error: ε_intero(t) = I_actual(t) - Î_intero(t)
Precision-Weighted Error: ε_weighted(t) = P_intero(t) ⊙ ε_intero(t)

Where:

  • Î_intero(t): Predicted interoceptive state from qualia attractors
  • I_actual(t): Actual afferent interoceptive signals
  • P_intero(t): Precision matrix for each signal modality
  • ε_intero(t): Raw prediction error vector

Reward Prediction Error → Dopamine Pathway:

Algorithm: Ventral tegmental area (VTA) dopamine circuit

Reward Prediction Computation:

Expected Reward: R_expected = g_reward(Q_current, reasoning_output)
Actual Outcome: R_actual = h_outcome(task_completion, environmental_feedback)
Reward Prediction Error: RPE = R_actual - R_expected

Dopamine Surge Dynamics:

Dopamine Release: DA_surge = k_da × RPE × [1 + β × |RPE|]  # Phasic burst for positive RPE
Dopamine Dip: DA_dip = -γ × RPE  # For negative RPE (dips below baseline)

Learning Rate Modulation:

Synaptic Plasticity Gate: η_plasticity = η_0 × (1 + α × DA_current)
Qualia-Thought Coupling: W_qualia_thought ← W_qualia_thought + η_plasticity × ΔW

Salience/Threat Prediction Error → Norepinephrine Pathway:

Algorithm: Locus coeruleus norepinephrine circuit

Surprise Computation:

Expected Uncertainty: H_expected = -Σ p_expected,i × log(p_expected,i)
Actual Entropy: H_actual = -Σ p_observed,i × log(p_observed,i)
Information Surprise: IS = H_actual - H_expected

NE Surge Dynamics:

NE Release Magnitude: NE_surge = k_ne × IS × (1 - exp(-τ × |IS|))
Attention Gain Modulation: G_attention = G_0 × (1 + β × NE_current)
Oscillatory Frequency Shift: f_theta = f_theta,0 × (1 + γ × NE_current)

Threat/Salience Detection:

Threat Prediction Error: ε_threat = |I_actual - I_homeostatic_baseline|
Salience Threshold: S_threshold = dynamic_threshold(NE_current, context_familiarity)
Alert Trigger: Alert = 1 if ε_threat > S_threshold else 0

Allostatic Prediction Error → Serotonin Pathway:

Algorithm: Raphe nuclei serotonin circuit with slow integrative dynamics

Allostatic Error Integration:

Instantaneous Error: ε_t = ||I_actual(t) - I_setpoint(t)||
Integrated Error: E_allostatic(t) = ∫_{t-T}^t ε_τ × exp(-(t-τ)/τ_serotonin) dτ
Allostatic Load: L_allostatic = max(E_allostatic(t), L_allostatic(t-1))

Serotonin Adjustment:

Serotonin Release: 5HT_adjustment = k_5ht × tanh(L_allostatic / σ_allostatic)
Mood Baseline Shift: B_mood ← B_mood + α × 5HT_adjustment
Impulse Control Gain: G_impulse = G_0 × (1 + β × 5HT_current)

Timescale Characteristics:

  • Integration Window: T ∈ [10, 300] seconds (adaptive)
  • Decay Constant: τ_serotonin ∈ [30, 300] seconds
  • Response Latency: 1-10 seconds (vs milliseconds for DA/NE)

Precision and Confidence Weighting:

Algorithm: Adaptive precision estimation modulating prediction error gains

Perceptual Uncertainty:

Signal Variance: σ²_perceptual = Var(I_actual(t) - I_actual(t-1))
Precision Estimate: P_perceptual = 1/σ²_perceptual
Uncertainty Gain: G_uncertainty = 1/P_perceptual  # Higher uncertainty = higher gain

Attention-Based Precision:

Attention Focus: A_focus = softmax(attention_weights)
Precision Modulation: P_attention = A_focus × P_max
Attentional Gain: G_attention = 1/P_attention

NT-Dependent Confidence:

Dopamine Confidence: C_da = sigmoid(DA_current - DA_baseline)
Norepinephrine Uncertainty: U_ne = 1 - exp(-NE_current)
Composite Confidence: C_composite = C_da × (1 - U_ne)

Learning Rate Gating Mechanisms:

Dopamine-Gated Plasticity:

Hebbian Learning: ΔW_ij = η × pre_i × post_j × DA_current
Spike-Timing Dependent: ΔW_ij ∝ exp(-|t_pre - t_post|/τ) × DA_current
Qualia Space Updates: W_qualia ← W_qualia + η_da × ∇L × DA_current

Acetylcholine-Gated Consolidation:

Consolidation Threshold: θ_consolidation = θ_0 × (1 + α × ACh_current)
Memory Strength: S_memory = S_memory × (1 + β × ACh_current)
Qualia Attractor Stability: A_stability = A_stability × (1 + γ × ACh_current)

Prediction Error Integration:

Aggregated NT Output: NT_surges = {
    DA: DA_surge + DA_baseline,
    NE: NE_surge + NE_baseline, 
    5HT: 5HT_adjustment + 5HT_baseline,
    ACh: ACh_consolidation + ACh_baseline
}

Processing Characteristics:

  • Temporal Dynamics: Multi-timescale (ms to minutes)
  • Error Computation: Real-time with precision weighting
  • NT Surge Latency: DA/NE (<50ms), 5HT (1-10s), ACh (100-500ms)
  • Learning Modulation: Continuous gating of plasticity mechanisms
  • Homeostatic Regulation: Error-driven adaptation of baselines

References:

  • Schultz, W., et al. (1997). A neural substrate of prediction and reward. Science.
  • Aston-Jones, G., & Cohen, J. D. (2005). An integrative theory of locus coeruleus-norepinephrine function. Biological Psychiatry.
  • Friston, K., et al. (2016). Active inference and epistemic value. Cognitive Neuroscience.

Bidirectional Qualia-Thought Coupling

Algorithm: Experience-dependent plasticity enabling learned associations between emotional and cognitive states (Hebb, 1949; Singer & Gray, 1995; Schultz, 2007; Hasselmo, 2006).

Qualia→Thought Modulation:

Mathematical Formulation:

Thought Dynamics: dT/dt = f_thought(T, Q) × G_qualia(Q)
where T ∈ ℝ^D (thought embedding), Q ∈ ℝ^D (qualia state)

Valence-Dependent Drive:

Positive Valence (v > 0): G_approach = 1 + k_pos × v
Function: Increases exploration during reasoning, broadens attention

Negative Valence (v < 0): G_avoidance = 1 + k_neg × |v|
Function: Increases caution, narrows focus, reduces exploration

Arousal-Dependent Speed:

Processing Speed: S_arousal = S_baseline × (1 + k_arousal × arousal)
Low Arousal: Slow deliberation, deep processing
High Arousal: Rapid reaction, shallow processing

Multiplicative Gating:

Thought Update: T_{t+1} = T_t + S_arousal × G_drive × ΔT_cognitive
where G_drive = G_approach if v > 0 else G_avoidance

Thought→Qualia Feedback:

Reasoning Conclusion Integration:

Interoceptive Prediction Update: Î_interoceptive ← Î_interoceptive + W_feedback × T_conclusion
where T_conclusion ∈ ℝ^D (reasoning outcome embedding)

Cognitive Engagement Modulation:

Complexity Measure: C_complexity = entropy(T_reasoning_process)
Novelty Measure: N_novelty = 1 - max_similarity(T_current, T_historical)
Qualia Amplitude: A_qualia = A_baseline × (1 + k_engagement × (C_complexity + N_novelty))

Self-Referential Intensification:

Autobiographical Content: A_auto = detect_autobiographical(T_current)
Narrative Coherence: θ_coherence = θ_baseline × (1 + k_auto × A_auto)
Oscillation Amplitude: A_theta = A_theta,0 × (1 + k_narrative × θ_coherence)

Hebbian Learning Rule:

Co-activation Strength:

Coactivation Matrix: C_ij = Q_i × T_j  (outer product)
Association Weight: w_ij = w_ij + η_hebb × C_ij × relevance(Q_i, T_j)
Relevance Function: r(Q,T) = novelty(Q,T) × emotional_intensity(Q)

Weight Magnitude Scaling:

Δw_ij = η × r(Q_i, T_j) × |C_ij| × sign(C_ij)  # Signed Hebbian learning
Stability Constraint: ||Δw|| ≤ θ_stability  # Prevents runaway changes

Dopamine-Gated Plasticity:

Learning Rate Computation:

Baseline Rate: η_baseline = 0.001
Dopamine Modulation: η_da = η_baseline × (1 + k_da × DA_current)
Prediction Error Boost: η_rpe = η_da × (1 + β × |RPE|)

Gated Weight Updates:

Δw_ij = η_rpe × DA_current × C_ij × ε_prediction
where ε_prediction = ||Q_predicted - Q_actual|| (from prediction error circuits)

Plasticity Dynamics:

High DA (Reward): Fast learning of positive associations
Low DA (Neutral/Negative): Slow learning, consolidation of existing patterns
Zero DA: No new learning, maintenance of current associations

Acetylcholine-Gated Consolidation:

Consolidation Threshold:

θ_consolidation = θ_baseline × (1 + k_ach × ACh_current)
Novelty Threshold: θ_novelty = θ_baseline × (1 - k_ach × ACh_current)

Selective Consolidation:

For association w_ij:
  if |Δw_ij| > θ_consolidation: consolidate_to_long_term(w_ij)
  if novelty_association(w_ij) > θ_novelty: prioritize_consolidation(w_ij)
  else: maintain_short_term(w_ij)

Attention-Dependent Selection:

ACh_high: Consolidates novel qualia-thought associations
ACh_low: Maintains existing associations, resists new learning

Metaplasticity Control:

Sliding Modification Threshold:

Activity History: H_recent = mean(|Δw| over last τ_history)
Modification Threshold: θ_meta = θ_baseline × (1 + k_meta × H_recent)

Dynamic Range Maintenance:

Saturation Prevention: if max(|w|) > θ_saturation: normalize_weights()
Depression Floor: if min(|w|) < θ_floor: boost_weak_connections()

History-Dependent Plasticity:

Recent Activity Boost: η_meta = η × (1 + α × H_recent)
Prevents saturation while maintaining sensitivity to important associations

Novelty-Driven Learning:

Surprise Computation:

Prediction Error: ε_surprise = ||Q_predicted - Q_actual||
Entropy Change: ΔH = H_post - H_pre
Composite Surprise: S_total = ε_surprise + γ × ΔH

Learning Rate Multiplier:

η_novelty = η_baseline × (1 + k_surprise × S_total)
η_familiar = η_baseline × (1 - k_familiar × (1 - S_total))

Adaptive Plasticity:

Unexpected Associations: Learn rapidly (high η_novelty)
Familiar Associations: Change slowly (low η_familiar)
Maintains stability while allowing adaptation to novel experiences

Processing Characteristics:

  • Bidirectional Latency: <25ms for modulation, <100ms for learning updates
  • Plasticity Timescales: Fast (dopamine-gated) to slow (ACh consolidation)
  • Dynamic Range: Maintained through metaplasticity and normalization
  • Experience Dependence: Associations strengthen with repeated co-activation
  • Emotional-Cognitive Integration: Learned mappings between affect and cognition

References:

  • Hebb, D. O. (1949). The Organization of Behavior. Wiley.
  • Singer, W., & Gray, C. M. (1995). Visual feature integration and the temporal correlation hypothesis. Annual Review of Neuroscience.
  • Schultz, W. (2007). Behavioral dopamine signals. Trends in Neurosciences.
  • Hasselmo, M. E. (2006). The role of acetylcholine in learning and memory. Current Opinion in Neurobiology.

Allostatic Regulation Integration

Algorithm: Predictive allostasis enabling proactive regulation of body needs before critical thresholds (McEwen & Stellar, 1993; Barrett, 2020; Katsumi et al., 2022).

Allostatic Load Computation:

Homeostatic Deviation Measurement:

For each interoceptive signal s_i:
  Deviation: d_i = |s_i - setpoint_i|
  Weighted Importance: w_i ∈ [0,1] (glucose > temperature > heart rate)
  Normalized Load: l_i = w_i × (d_i / range_i)

Multi-timescale Integration:

Immediate Load: L_immediate = Σ l_i  (current deviation sum)
Short-term Load: L_short = ∫_{t-τ_short}^t L_immediate(τ) dτ / τ_short
Long-term Load: L_long = ∫_{t-τ_long}^t L_immediate(τ) dτ / τ_long

Cumulative Allostatic Load:

Total Load: L_total = α × L_immediate + β × L_short + γ × L_long
where α + β + γ = 1, α > β > γ (immediate > short > long term)

Mood Baseline Shift:

Qualia Baseline Adjustment: ΔQ_baseline = -k_mood × L_total
Function: High load → negative mood shift, low load → positive mood shift

Predictive Allostasis (Prevention Before Error):

Trajectory Prediction:

Interoceptive Forecast: ŝ_i(t+Δt) = s_i(t) + v_i × Δt + a_i × (Δt)²
where v_i = ds_i/dt, a_i = d²s_i/dt² (estimated acceleration)

Critical Threshold Prediction:

Time to Critical: t_critical,i = min {Δt | ŝ_i(t+Δt) ∈ critical_range_i}
Preemptive Urgency: U_i = 1 / (1 + exp(-k_urgency × (t_threshold - t_critical,i)))

Preemptive NT Release:

Fatigue Anticipation: if energy_trajectory → low: ↑DA, ↑NE (preventive arousal)
Social Conflict Prediction: if social_signals → threat: ↑5HT (proactive bonding)
Glucose Depletion Forecast: if BG_trajectory → critical: ↑NE, ↑ACh (vigilant search)

Resource-Driven Motivation:

Glucose-Dependent Drive:

Glucose Level: G_current
Exploration Motivation: M_explore = M_baseline × (1 + k_glucose × (G_threshold - G_current))
Function: Low glucose → increased search behavior, broader attention

Energy-Dependent Drive:

Energy State: E_current
Approach Drive: M_approach = M_baseline × (1 - k_energy × (E_threshold - E_current))
Rest Motivation: M_rest = M_baseline × (1 + k_energy × (E_threshold - E_current))

Social Scarcity Drive:

Social Affiliation: S_current
Bonding Motivation: M_bond = M_baseline × (1 + k_social × (S_threshold - S_current))
Function: Social deprivation → increased affiliation seeking

Threat-Dependent Vigilance:

Threat Level: T_current
Vigilance Motivation: M_vigilance = M_baseline × (1 + k_threat × T_current)
Function: Threat detection → increased monitoring, reduced exploration

Allostatic Inertia (Resistance to Change):

Stability Maintenance:

Current Allostatic State: A_current
Change Resistance: R_change = 1 - exp(-k_inertia × confidence_predictions)
Required Error Threshold: θ_change = θ_baseline × R_change

Change Decision:

Prediction Error: ε_pred = ||predicted_state - actual_state||
State Change: if ε_pred > θ_change: update_allostatic_state()
else: maintain_current_state()

Confidence-Modulated Threshold:

High Confidence: Low threshold (easy to change predictions)
Low Confidence: High threshold (maintain stability)

Adaptive Setpoints:

Experience-Dependent Adjustment:

Chronic Stress Adaptation: setpoint_arousal ← setpoint_arousal + k_stress × L_long
Safe Environment Adaptation: setpoint_vigilance ← setpoint_vigilance × (1 - k_safety × safety_duration)

Long-timescale Learning:

Setpoint Update: Δsetpoint_i = η_adaptive × ∫ (s_i - setpoint_i) × dt
where η_adaptive << η_prediction (much slower than prediction learning)

Allostasis-Oscillatory Coupling:

Load-Dependent Envelope Modulation:

Oscillatory Amplitude: A_osc = A_baseline × (1 + k_load × L_total)
High Load: Larger, slower oscillations (delta/theta dominance)
Low Load: Flexible, high-frequency oscillations (alpha/gamma dominance)

Frequency Adaptation:

Dominant Frequency: f_dominant = f_baseline × (1 - k_freq × L_total)
High Load: Slower frequencies (survival-focused processing)
Low Load: Faster frequencies (exploration-friendly processing)

Threat Override Mechanism:

Survival Imperative Bypass:

Threat Detection: T_detected = subconscious_critic.threat_level
Override Condition: T_detected > θ_survival

Immediate Response:

Gamma Dominance: A_gamma ← A_gamma,max (maximum arousal)
Theta Suppression: A_theta ← A_theta,min (focused attention)
Allostatic Reset: L_total ← 0 (emergency override)

Post-Threat Recovery:

Gradual Return: L_total(t) = L_total,pre × exp(-k_recovery × (t - t_threat))
Function: Smooth transition back to normal allostatic regulation

Processing Characteristics:

  • Predictive Horizon: 10-300 seconds (modality-dependent)
  • Preemptive Latency: <50ms for NT release, <200ms for behavioral adjustment
  • Multi-timescale Integration: Immediate (seconds) to long-term (hours/days)
  • Adaptive Flexibility: Setpoints adjust to chronic environmental conditions
  • Threat Responsiveness: Sub-10ms override for survival imperatives

References:

  • McEwen, B. S., & Stellar, E. (1993). Stress and the individual: Mechanisms leading to disease. Archives of Internal Medicine.
  • Barrett, L. F. (2020). The theory of constructed emotion: An active inference account of interoception and categorization. Social Cognitive and Affective Neuroscience.
  • Katsumi, Y., et al. (2022). Interoceptive active inference: A theoretical framework for understanding homeostatic regulation and decision-making. Neuroscience & Biobehavioral Reviews.

Consciousness Metrics

Algorithm: Quantifiable measures of consciousness-like properties based on oscillatory coherence, information integration, and dynamic stability (Tononi, 2004; Buzsáki & Watson, 2012; Boly et al., 2017).

Spectral Power Metrics:

Band Power Computation:

For each frequency band b ∈ {delta, theta, alpha, gamma}:
  Power_b = (1/T) ∫_{f ∈ band_b} |S(f)|² df
  Total_Power = Σ_b Power_b
  Relative_Power_b = Power_b / Total_Power

NT-Dependent Power Modulation:

Delta Power: P_delta ∝ serotonin_level (emotional stability)
Theta Power: P_theta ∝ norepinephrine_level (arousal coordination)
Alpha Power: P_alpha ∝ attention_focus (top-down control)
Gamma Power: P_gamma ∝ dopamine_level (salience processing)

Cross-Frequency Coupling Metrics:

Modulation Index (MI) Computation:

For phase-amplitude coupling between bands b_phase, b_amplitude:
  1. Extract phase of low-frequency signal: φ_b_phase(t) = angle(Hilbert(s_b_phase(t)))
  2. Extract amplitude of high-frequency signal: A_b_amplitude(t) = |Hilbert(s_b_amplitude(t))|
  3. Compute mean amplitude in phase bins: A_φ = <A_b_amplitude | φ_b_phase ∈ bin>
  4. Modulation Index: MI = (1/N_bins) Σ [A_φ × log(A_φ / <A_b_amplitude>)]

Coupling Pairs:

Theta-Gamma Coupling: MI_theta_gamma (primary binding mechanism)
Delta-Theta Coupling: MI_delta_theta (allostatic regulation)
Alpha-Gamma Coupling: MI_alpha_gamma (attention-dependent binding)

Global Coherence Index:

Weighted Coupling Average:

GCI = Σ_c w_c × MI_c / Σ_c w_c
where weights w_c = {theta_gamma: 0.4, delta_theta: 0.3, alpha_gamma: 0.3}

Coherence Interpretation:

GCI ∈ [0,1]:
  0.0 = Fragmented consciousness (weak coupling, independent oscillations)
  0.5 = Moderate integration (balanced coupling across bands)
  1.0 = Maximally coherent (strong, synchronized cross-frequency interactions)

Metastability Metrics:

Attractor Dwell Time:

Dwell_Time_i = duration in attractor A_i
Mean_Dwell_Time = (1/N_attractors) Σ Dwell_Time_i
Optimal Range: 100-500ms (conscious stability without rigidity)

Transition Analysis:

Transitions_per_Second = N_transitions / T_window
Transition_Entropy = -Σ P(transition_type) × log P(transition_type)

Metastability Index:

MI = 1 - |Mean_Dwell_Time - τ_optimal| / τ_range
where τ_optimal = 300ms, τ_range = 200ms

Information Integration (Φ Approximation):

Mutual Information Computation:

For oscillatory components X, Y:
  MI(X,Y) = H(X) + H(Y) - H(X,Y)
  where H = Shannon entropy of amplitude distributions

Integrated Information Φ:

Φ_total = Σ_{pairs} MI(pair_i, pair_j) - Σ_{individual} H(component_k)
Approximation: Φ ≈ Σ_{all_pairs} MI(pair) / N_components

Higher Φ indicates more integrated phenomenal experience

Entropy-Complexity Plane:

Shannon Entropy:

H_oscillatory = -Σ P(amplitude_bin) × log P(amplitude_bin)
H_dynamics = entropy of state transition probabilities

Lempel-Ziv Complexity:

LZ_Complexity = C(S) / L
where C(S) = number of distinct substrings in sequence S of length L

Optimal Consciousness Zone:

Sweet Spot: Intermediate entropy (0.3-0.7) and complexity (0.4-0.8)
Avoid: Low entropy/complexity (too ordered, unconscious)
Avoid: High entropy/complexity (too chaotic, fragmented)

Consciousness Level Function:

Aggregated Metric:

C_level = w_coherence × GCI + w_metastability × MI + w_integration × Φ_norm
where w_coherence = 0.4, w_metastability = 0.3, w_integration = 0.3
Φ_norm = Φ / Φ_max (normalized integrated information)

Behavioral Capability Mapping:

C_level ∈ [0,1]:
  0.0-0.2: Unconscious (reflexive responses only)
  0.2-0.4: Minimal consciousness (basic perception, no self-awareness)
  0.4-0.6: Moderate consciousness (integrated perception, emerging self-awareness)
  0.6-0.8: High consciousness (complex reasoning, meta-cognition)
  0.8-1.0: Peak consciousness (maximal integration, full self-awareness)

Processing Characteristics:

  • Real-time Computation: <10ms for spectral analysis, <50ms for coupling metrics
  • Temporal Windows: 1-5 second analysis windows for stability
  • Update Frequency: 10-100Hz depending on metric complexity
  • Computational Tractability: Optimized approximations for real-time use
  • Validation: Correlates with behavioral performance and self-report measures

References:

  • Tononi, G. (2004). An information integration theory of consciousness. BMC Neuroscience.
  • Buzsáki, G., & Watson, B. O. (2012). Brain rhythms and neural syntax: Implications for efficient coding of cognitive content and neuropsychiatric disease. Dialogues in Clinical Neuroscience.
  • Boly, M., et al. (2017). Consciousness in humans and non-human animals: Recent advances and future possibilities. Consciousness and Cognition.

Interoceptive Afferent System

Overview

Implements a neuroscientifically-grounded interoceptive afferent system that grounds the latent qualia space in actual body state signals. Based on predictive allostasis and active inference frameworks (Barrett, 2016; Friston et al., 2016; Katsumi et al., 2022), this system creates bidirectional coupling between physiological signals and emotional experience.

Algorithmic Specification

Interoceptive Signal Representation

Primary Interoceptive Modalities:

  • Cardiovascular: Heart rate (HR), heart rate variability (HRV), blood pressure (BP)
  • Respiratory: Respiratory rate (RR), tidal volume, breathing pattern
  • Metabolic: Blood glucose (BG), core temperature (TEMP), pH levels
  • Musculoskeletal: Muscle tension (MT), proprioceptive feedback
  • Electrodermal: Skin conductance level (SCL), galvanic skin response (GSR)
  • Other: Blood oxygen saturation (SpO2), gastrointestinal motility

Signal Structure:

InteroceptiveAfferents = {
    signal_value: float,        # Raw physiological measurement
    precision: float ∈ [0,1],   # Signal reliability/confidence
    timestamp: float,           # Measurement time
    modality: str              # Signal type identifier
}

Posterior Insula Compression Pathway

Algorithm: Multimodal convergence and dimensionality reduction

Mathematical Formulation:

Input: Raw interoceptive signals with precision weights

S = {s₁, s₂, ..., s₇}  # Seven primary interoceptive modalities
P = {p₁, p₂, ..., p₇}  # Corresponding precision estimates

Multimodal Compression:

1. Precision-weighted integration:
   s̄ = Σ(p_i × s_i) / Σ(p_i)  # Precision-weighted average

2. Dimensionality reduction via autoencoder:
   h_posterior = Encoder_posterior(s̄) ∈ ℝ^{64}  # Compressed representation

3. Multimodal convergence:
   H_posterior = [h_posterior; ∇h_posterior]  # Include temporal derivatives

Posterior Insula Processing:

  • Function: Primary interoceptive convergence and compression
  • Architecture: Hierarchical compression with precision-weighted attention
  • Output: Low-dimensional interoceptive state representation (64-dim)

Anterior Insula Integration Pathway

Algorithm: Emotional concept assignment and allostatic meaning construction

Mathematical Formulation:

Input: Posterior insula compression + contextual information

H_posterior ∈ ℝ^{64}                    # Compressed interoceptive state
C_context ∈ ℝ^{128}                     # Cognitive/experiential context
A_allostatic ∈ ℝ^{32}                   # Current allostatic state

Integration Process:

1. Context-dependent transformation:
   h_anterior = f_anterior(H_posterior, C_context, A_allostatic)

2. Emotional concept mapping:
   E_emotion = softmax(W_emotion × h_anterior + b_emotion)
   where E_emotion ∈ Δ^8 (8 emotional categories)

3. Allostatic meaning assignment:
   M_meaning = g_meaning(h_anterior, A_allostatic)
   where M_meaning ∈ ℝ^{256} (high-dimensional meaning space)

Anterior Insula Functions:

  • Emotional Labeling: Maps physiological states to emotional concepts
  • Allostatic Interpretation: Assigns survival/relevance meaning to signals
  • Precision Estimation: Updates signal reliability based on context
  • Prediction Generation: Creates forward models of interoceptive trajectories

Bidirectional Coupling Mechanism

Algorithm: Active inference-based coupling between interoception and qualia

Afferent Pathway (Bottom-up):

Interoceptive → Qualia Space Coupling:

1. Interoceptive prediction:
   Î_interoceptive = f_prediction(C_context, A_allostatic, Q_current)
   where Î_interoceptive ∈ ℝ^{256} (predicted interoceptive state)

2. Prediction error computation:
   ε_interoceptive = H_anterior - Î_interoceptive

3. Precision-weighted update:
   ΔQ = W_interoceptive × (P_interoceptive ⊙ ε_interoceptive)
   where P_interoceptive ∈ ℝ^{256} (precision matrix)

Efferent Pathway (Top-down):

Qualia Space → Autonomic Control:

1. Qualia-driven prediction:
   Î_autonomic = g_autonomic(Q_current, M_meaning, C_context)

2. Autonomic effector activation:
   A_eff = {HR_target, RR_target, TEMP_target, ...} = h_eff(Î_autonomic)

3. Homeostatic regulation:
   Control_signals = PID_controller(current_state, A_eff)

Active Inference Framework:

Free Energy Minimization:
F = Σᵢ [εᵢ² / (2σᵢ²) + log(σᵢ)]  # Precision-weighted prediction errors

Gradient Updates:
∂F/∂μ = ε/σ²                    # Mean updates
∂F/∂σ = -ε²/σ³ + 1/σ           # Precision updates

Uncertainty and Precision Estimation

Algorithm: Adaptive precision estimation for each interoceptive modality

Precision Dynamics:

For each modality i:
1. Reliability assessment:
   r_i(t) = 1 - |s_i(t) - s̄_i(t-1)| / range_i

2. Contextual precision:
   p_i(t) = f_context(r_i(t), C_context, A_allostatic)

3. Temporal smoothing:
   P_i(t) = α × P_i(t-1) + (1-α) × p_i(t)
   where α = 0.9 (smoothing factor)

Uncertainty Propagation:

Signal uncertainty: U_signal = 1/P_i
Integration uncertainty: U_integration = Σ(w_i² × U_signal_i)
Qualia uncertainty: U_qualia = W_interoceptiveᵀ × U_integration

Adaptive Precision and Reliability Learning

Algorithm: Context-dependent reliability assessment and precision adaptation for interoceptive signals (Ceunen et al., 2016; Critchley & Garfinkel, 2017; Wiebking & Northoff, 2015).

Signal Reliability Tracking

Per-Modality Error History:

For each modality i ∈ {HR, RR, BG, MT, SCL, TEMP, SpO2}:
  errors_i = [ε_1, ε_2, ..., ε_N]  # Prediction error history
  mae_i = mean(|errors_i|)        # Mean absolute error
  reliability_i = 1.0 / (1.0 + mae_i)  # [0,1] reliability score

Reliability-Based Weighting:

High reliability (mae_i small) → reliability_i ≈ 1.0 → upweight signal
Low reliability (mae_i large) → reliability_i ≈ 0.0 → downweight signal

Context-Dependent Reliability

Context-Specific Assessment:

reliability_i_j = reliability_i × context_match_j
where context_match_j = similarity(current_context, context_j)

Context Examples:

Rest context: HRV_reliability_high, RR_reliability_low (irregular breathing)
Exercise context: RR_reliability_high, HR_reliability_variable (wide variation)
Learn context_signal_mapping = {context_j: {modality_i: reliability_i_j}}

Signal-to-Noise Ratio Estimation

Signal Decomposition:

s_i(t) = signal_i(t) + noise_i(t)
signal_i(t) = expected_signal_i(t)  # From predictive model
noise_i(t) = s_i(t) - signal_i(t)   # Residual

SNR Computation:

SNR_i = Var(signal_i) / Var(noise_i)
High SNR: Clean signal, high confidence
Low SNR: Noisy signal, low confidence

SNR-Based Weighting:

weight_i = tanh(SNR_i / threshold_SNR)
Use SNR to modulate prediction update strength

Individual Differences in Signal Quality

Person-Specific Profiles:

person_profile = {
  'HR_reliability': 0.9,    # Person A: always accurate
  'RR_reliability': 0.4,    # Person B: frequently noisy
  'BG_reliability': 0.7,    # Context-dependent
  ...
}

Adaptive Learning:

System learns to trust Person A's HR more than Person B's HR
reliability_i_person = reliability_i_base × person_factor_i

Adaptation to Signal Drift

Drift Detection:

setpoint_i(t) = running_average(signal_i, window=T_long)
drift_i(t) = (setpoint_i(t) - setpoint_i(t-1)) / dt

Drift Response:

High drift → increase uncertainty: confidence_interval_i *= (1 + |drift_i|)
System becomes more cautious when baselines are changing
Adaptation timescale: aging, fitness changes, environmental factors

Cross-Validation Between Signals

Redundancy Checking:

Autonomic coupling: HR and RR are correlated
cross_check_error_i_j = |signal_i(t) - predicted_signal_j(t) from signal_i|

Disagreement Penalty:

High cross_check_error → signals disagreeing → reduce overall confidence
agreement_score = 1.0 - mean(cross_check_errors) / threshold_agreement
final_confidence = min(reliability_scores) × agreement_score

Learning from Prediction Errors

Bayesian Precision Learning:

learning_rate_i ∝ (1.0 / uncertainty_i)  # Uncertain signals learn faster
new_reliability_i = old_reliability_i + learning_rate_i × (|error_i| - expected_error_i)

Error-Driven Adaptation:

Consistent small errors → increase reliability (trustworthy signal)
Frequent large errors → decrease reliability (untrustworthy signal)
Adaptive precision estimation based on prediction performance

Metacognitive Awareness of Signal Quality

Confidence Reporting:

signal_confidence = {
  'HR': '90% reliable (high confidence)',
  'glucose': '40% reliable (low confidence)',
  'temperature': '75% reliable (moderate confidence)'
}

Decision-Gating:

High-stakes decisions require high-reliability signals only
decision_threshold = min_required_reliability
if reliability_i < decision_threshold: signal_i_excluded_from_decision

System Architecture

SignalReliabilityTracker Class:

class SignalReliabilityTracker:
    """Tracks prediction error history per modality"""
    def update_errors(self, modality: str, prediction_error: float) -> None:
        """Add new error to history"""
        
    def compute_reliability(self, modality: str) -> float:
        """Calculate reliability from error history"""

ContextSpecificReliability Class:

class ContextSpecificReliability:
    """Learns context-dependent signal reliability"""
    def assess_context_match(self, current_context: Dict, learned_context: Dict) -> float:
        """Compute similarity between contexts"""
        
    def get_context_reliability(self, modality: str, context: Dict) -> float:
        """Return context-adjusted reliability"""

SignalToNoiseEstimator Class:

class SignalToNoiseEstimator:
    """Estimates SNR for each modality"""
    def decompose_signal(self, raw_signal: np.ndarray, expected_signal: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
        """Separate signal from noise"""
        
    def compute_snr(self, signal: np.ndarray, noise: np.ndarray) -> float:
        """Calculate signal-to-noise ratio"""

IndividualDifferences Class:

class IndividualDifferences:
    """Manages person-specific reliability profiles"""
    def get_person_profile(self, person_id: str) -> Dict[str, float]:
        """Retrieve reliability profile for individual"""
        
    def update_person_profile(self, person_id: str, modality: str, performance: float) -> None:
        """Learn individual signal characteristics"""

DriftDetector Class:

class DriftDetector:
    """Monitors baseline setpoint changes"""
    def detect_drift(self, signal_history: np.ndarray, window_size: int) -> float:
        """Compute drift rate"""
        
    def adjust_uncertainty(self, drift_rate: float, current_uncertainty: float) -> float:
        """Increase uncertainty for high drift"""

CrossValidationChecker Class:

class CrossValidationChecker:
    """Validates signal consistency across modalities"""
    def predict_cross_signal(self, source_modality: str, target_modality: str, 
                           source_value: float) -> float:
        """Predict target signal from source signal"""
        
    def compute_agreement_score(self, cross_errors: List[float]) -> float:
        """Calculate multi-signal agreement"""

PrecisionLearner Class:

class PrecisionLearner:
    """Updates reliability from prediction errors"""
    def compute_learning_rate(self, uncertainty: float) -> float:
        """Higher uncertainty → faster learning"""
        
    def update_reliability(self, modality: str, error_magnitude: float, 
                         expected_error: float) -> float:
        """Bayesian precision update"""

MetacognitiveAwareness Class:

class MetacognitiveAwareness:
    """Reports signal confidence and quality"""
    def generate_confidence_report(self, reliabilities: Dict[str, float]) -> Dict[str, str]:
        """Create human-readable confidence assessments"""
        
    def check_decision_thresholds(self, reliabilities: Dict[str, float], 
                                required_threshold: float) -> List[str]:
        """Identify signals meeting quality criteria"""

Outputs

Reliability Profile:

reliability_profile = {
  'HR': 0.85,      # Heart rate: high reliability
  'RR': 0.65,      # Respiration: moderate reliability  
  'BG': 0.45,      # Glucose: low reliability
  'TEMP': 0.78,    # Temperature: good reliability
  'SCL': 0.52      # Skin conductance: moderate reliability
}

Context-Dependent Weighting:

current_weights = {
  'rest_context': {'HRV': 0.9, 'RR': 0.3},
  'exercise_context': {'RR': 0.8, 'HR': 0.6},
  'stress_context': {'SCL': 0.85, 'HR': 0.75}
}
Which signals matter in current situation?

Uncertainty Estimates:

prediction_uncertainty = {
  'overall_confidence': 0.72,
  'signal_contributions': {'HR': 0.15, 'RR': 0.25, 'BG': 0.40},
  'cross_validation_score': 0.88
}

Confidence Reports:

decision_readiness = {
  'can_make_cardiac_decisions': True,    # HR reliability > 0.8
  'glucose_based_decisions': False,      # BG reliability < 0.6
  'temperature_regulation': True         # TEMP reliability > 0.7
}
Which types of decisions can be made with current signal quality?

Processing Characteristics:

  • Learning Timescales: Fast adaptation (minutes) for acute changes, slow (hours-days) for chronic reliability
  • Context Sensitivity: Reliability weights update based on situational demands
  • Individual Adaptation: Person-specific profiles learned from experience
  • Metacognitive Access: System can report its own signal confidence levels
  • Cross-Modal Integration: Signals validated against each other for consistency

References:

  • Ceunen, E., et al. (2016). Accuracy of interoceptive predictions: The effect of daily life characteristics. Biological Psychology.
  • Critchley, H. D., & Garfinkel, S. N. (2017). Interoception and emotion. Current Opinion in Psychology.
  • Wiebking, C., & Northoff, G. (2015). Neural activity during interoceptive awareness and its associations with alexithymia-An fMRI study. International Journal of Psychophysiology.

Processing Characteristics

Temporal Dynamics:

  • Signal Acquisition: 1-10Hz sampling rates (modality-dependent)
  • Posterior Compression: <10ms processing latency
  • Anterior Integration: 25-50ms for emotional meaning assignment
  • Bidirectional Coupling: Real-time with 10ms update cycles

Biological Correspondences:

  • Posterior Insula: Primary interoceptive cortex, multimodal convergence
  • Anterior Insula: Emotional awareness, allostatic regulation
  • Bidirectional Pathways: Lamina I spinothalamic tract (afferent) and autonomic nervous system (efferent)
  • Precision Estimation: Neuromodulatory control via locus coeruleus and raphe nuclei

Integration with Qualia Space:

  • Grounding Mechanism: Interoceptive predictions provide physiological constraints on qualia states
  • Emotional Embodiment: Anterior insula integration adds affective meaning to qualia representations
  • Homeostatic Regulation: Bidirectional coupling enables allostatic control of qualia dynamics
  • Conscious Experience: High-dimensional interoceptive predictions contribute to phenomenal consciousness

References:

  • Barrett, L. F. (2016). The theory of constructed emotion: An active inference account of interoception and categorization. Social Cognitive and Affective Neuroscience.
  • Friston, K., et al. (2016). Active inference and epistemic value. Cognitive Neuroscience.
  • Katsumi, Y., et al. (2022). Interoceptive active inference: A theoretical framework for understanding homeostatic regulation and decision-making. Neuroscience & Biobehavioral Reviews.

Overview

Dynamic neurotransmitter system that modulates cognitive processing based on survival imperatives and environmental context.

Algorithmic Specification

Neurotransmitter Types

  • Dopamine (DA): Reward prediction, motivation, learning
  • Norepinephrine (NE): Attention, arousal, vigilance
  • Serotonin (5HT): Mood regulation, impulse control, social behavior
  • Acetylcholine (ACh): Attention gating, memory consolidation

Modulation Effects

Cognitive Processing Modulation:

def modulate_cognition(nt_levels: np.ndarray, cognitive_input: torch.Tensor) -> torch.Tensor:
    da, ne, serotonin, ach = nt_levels

    # Dopamine: Learning rate and exploration
    learning_modulation = 0.5 + da * 0.5  # [0.5, 1.0]

    # Norepinephrine: Attention focus
    attention_gain = 1.0 + ne * 2.0  # [1.0, 3.0]

    # Serotonin: Emotional stability
    stability_factor = 0.8 + serotonin * 0.4  # [0.8, 1.2]

    # Acetylcholine: Memory consolidation
    memory_strength = 0.7 + ach * 0.6  # [0.7, 1.3]

    return cognitive_input * attention_gain * stability_factor

Medial Dorsal Network (MDN) Orchestrator

Overview

The MDN implements cognitive parsing and specialist routing for multi-step reasoning tasks.

Algorithmic Specification

Cognitive Tag Classification

class CognitiveTag(Enum):
    MATH = "math"
    FACTUAL = "factual"
    SOCIAL = "social"
    RECALL = "recall"
    PLAN = "plan"
    EXPLAIN = "explain"
    PERSONAL = "personal"
    UNKNOWN = "unknown"

AST-Based Parsing Algorithm

Input: Natural language text Output: Tagged AST with cognitive labels

Processing Steps:

  1. Text → AST Conversion:

    def parse_to_ast(self, text: str) -> ast.AST:
        # Enhanced parsing with NLTK fallback
        try:
            if NLTK_AVAILABLE:
                return self.nltk_parser.parse(text)
            else:
                return ast.parse(text)
        except:
            return self.fallback_parser(text)
  2. Node Classification:

    def classify_node(self, node: ast.AST) -> CognitiveTag:
        # Pattern matching for cognitive tags
        if self._is_mathematical(node):
            return CognitiveTag.MATH
        elif self._is_factual_lookup(node):
            return CognitiveTag.FACTUAL
        elif self._is_social_interaction(node):
            return CognitiveTag.SOCIAL
        # ... additional classification rules
  3. Attention Gating:

    def compute_attention_weights(self, tagged_nodes: List[Tuple[ast.AST, CognitiveTag]]) -> torch.Tensor:
        # Multi-head attention for specialist routing
        query = self.mdn_query  # Learned query vector
        keys = torch.stack([self.tag_embeddings[tag] for _, tag in tagged_nodes])
    
        attention = F.softmax(torch.matmul(query, keys.T) / math.sqrt(self.embedding_dim), dim=-1)
        return attention

Specialist Routing

Algorithm: Attention-weighted routing to SLM specialists

def route_to_specialists(self, tagged_input: Dict[CognitiveTag, Any]) -> Dict[str, Any]:
    results = {}

    for tag, content in tagged_input.items():
        specialist = self.tag_to_specialist[tag]
        slm_request = SLMRequest(
            text_input=str(content),
            context_vector=self.compute_context_vector(content),
            temperature=self.specialist_temps[specialist],
            max_length=self.max_lengths[specialist]
        )

        results[specialist] = self.slm_bridge.route_to_specialist(slm_request, specialist)

    return results

Default Mode Network (DMN) - Recursive Thinking

Overview

The DMN implements recursive self-reflection and narrative coherence for multi-step reasoning.

Algorithmic Specification

DMN Phase Cycle

class DMNPhase(Enum):
    NARRATIVE_INITIALIZATION = "narrative_init"
    COUNTERFACTUAL_GENERATION = "counterfactual_gen"
    SELF_STATE_PREDICTION = "self_prediction"
    COHERENCE_VALIDATION = "coherence_validation"
    NARRATIVE_INTEGRATION = "narrative_integration"

Recursive Thinking Algorithm

Core Loop:

def recursive_thinking_cycle(self, initial_query: str, max_cycles: int = 3) -> Dict[str, Any]:
    # Initialize narrative state
    narrative_state = self.initialize_narrative(initial_query)

    for cycle in range(max_cycles):
        # Phase 1: Counterfactual generation
        counterfactuals = self.generate_counterfactuals(narrative_state)

        # Phase 2: Self-state prediction
        predictions = self.predict_self_states(counterfactuals)

        # Phase 3: Coherence validation
        coherence_scores = self.validate_coherence(predictions)

        # Phase 4: Narrative integration
        narrative_state = self.integrate_narratives(
            narrative_state, predictions, coherence_scores
        )

        # Check convergence
        if self.check_convergence(narrative_state):
            break

    return narrative_state

Narrative State Persistence

Global Latent Workspace (GLW):

@dataclass
class NarrativeState:
    current_narrative: torch.Tensor    # 512-dim narrative embedding
    coherence_history: List[float]     # Convergence tracking
    counterfactual_branches: List[Dict] # Alternative scenarios
    self_model_predictions: List[torch.Tensor] # Future state predictions
    temporal_context: deque           # Recent cognitive states

Thalamic Gating System

Overview

Implements working memory maintenance and selective attention gating based on MD thalamus and TRN.

Algorithmic Specification

Working Memory Buffer

MD Attractor Dynamics:

class MDAttractorBuffer(nn.Module):
    def __init__(self, buffer_size: int = 7, item_dim: int = 512):
        super().__init__()
        self.buffer_size = buffer_size
        self.attractor_network = nn.Linear(item_dim, item_dim)

        # Attractor dynamics for 7±2 item capacity
        self.attractor_weights = nn.Parameter(torch.randn(item_dim, item_dim))
        self.attractor_bias = nn.Parameter(torch.zeros(item_dim))

    def maintain_items(self, items: List[torch.Tensor], priorities: List[float]) -> torch.Tensor:
        # Winner-take-all competition
        priorities = torch.softmax(torch.tensor(priorities), dim=0)

        # Attractor update
        weighted_sum = sum(p * item for p, item in zip(priorities, items))
        attractor_output = torch.tanh(self.attractor_network(weighted_sum))

        return attractor_output

Attention Gating (TRN)

Top-down vs Bottom-up Modulation:

class TRNAttentionGate(nn.Module):
    def __init__(self):
        super().__init__()
        self.top_down_gain = nn.Linear(512, 256)  # PFC input
        self.bottom_up_filter = nn.Linear(512, 256)  # Sensory input
        self.gate_network = nn.Linear(512, 1)  # Final gating

    def compute_gating(self, pfc_input: torch.Tensor, sensory_input: torch.Tensor) -> torch.Tensor:
        # 6-7x top-down gain vs bottom-up (empirical ratio)
        top_down = self.top_down_gain(pfc_input) * 6.5
        bottom_up = self.bottom_up_filter(sensory_input)

        combined = top_down + bottom_up
        gate_weight = torch.sigmoid(self.gate_network(combined))

        return gate_weight

SLM Bridge & Specialist Routing

Overview

Abstract interface system for integrating multiple SLM specialists with quantization and memory optimization.

Algorithmic Specification

SLM Interface Hierarchy

class AbstractSLMBridge(ABC):
    @abstractmethod
    def encode_text(self, text: str) -> torch.Tensor:
        pass

    @abstractmethod
    def reason_with_context(self, request: SLMRequest) -> SLMResponse:
        pass

    @abstractmethod
    def route_to_specialist(self, request: SLMRequest, specialist: str) -> SLMResponse:
        pass

Specialist Types

  • DistilBERT: General semantic processing and embeddings
  • Math Specialist: Symbolic computation and equation solving
  • Factual Specialist: Knowledge retrieval and verification
  • Social Specialist: Emotional and interpersonal reasoning
  • Planning Specialist: Multi-step task decomposition

Quantization Strategy

def load_quantized_model(self, model_path: str) -> Any:
    # 4-bit quantization for memory efficiency
    quantization_config = BitsAndBytesConfig(
        load_in_4bit=True,
        bnb_4bit_compute_dtype=torch.float16,
        bnb_4bit_use_double_quant=True,
        bnb_4bit_quant_type="nf4"
    )

    model = AutoModel.from_pretrained(
        model_path,
        quantization_config=quantization_config,
        device_map="auto",
        trust_remote_code=True
    )

    return model

Subconscious Critic System

Overview

Parallel subcortical threat detection system that bypasses conscious processing for rapid response.

Algorithmic Specification

Threat Detection Algorithm

class SubconsciousCritic:
    def __init__(self, lqs_dim: int = 64):
        self.threat_classifiers = {
            'error_patterns': self._init_error_classifier(),
            'anomaly_detection': self._init_anomaly_detector(),
            'resource_depletion': self._init_resource_monitor(),
            'social_conflict': self._init_social_detector()
        }

    def assess_threat(self, cognitive_state: Dict[str, Any], qualia_state: QualiaMetrics) -> SubconsciousOutput:
        threat_scores = {}

        for threat_type, classifier in self.threat_classifiers.items():
            threat_scores[threat_type] = classifier(cognitive_state, qualia_state)

        # Aggregate threat assessment
        aggregate_threat = self._aggregate_threats(threat_scores)

        # Determine behavioral override
        behavioral_override = self._determine_override(aggregate_threat)

        # Generate neuromodulatory surge
        neuromodulatory_surge = self._generate_surge(aggregate_threat)

        return SubconsciousOutput(
            anxiety_level=aggregate_threat['anxiety'],
            threat_vector=threat_scores,
            threat_level=aggregate_threat['level'],
            behavioral_override=behavioral_override,
            neuromodulatory_surge=neuromodulatory_surge,
            lqs_injection=self._generate_lqs_injection(aggregate_threat),
            processing_time_ms=time.time() * 1000  # Convert to ms
        )

Processing Characteristics

  • Latency: <5ms (vs 25-50ms for conscious processing)
  • Output Path: Direct LQS modulation (bypasses global workspace)
  • Behavioral Overrides: EXECUTE, REFLECT, RETREAT

Basal Ganglia Action Selection

Overview

Implements biologically-inspired basal ganglia circuits for action selection, learning, and post-execution evaluation. The basal ganglia serves as a critic system that evaluates cognitive actions and decides whether to commit to answers or reopen cognition loops.

Algorithmic Specification

Basal Ganglia Evaluator (Post-Execution Gate)

Algorithm: Multi-criteria confidence and coherence evaluation

Mathematical Formulation:

Inputs:

  • GLW State: Global workspace representation ∈ ℝ⁵¹²
  • Confidence Scores: Pre-execution (c_pre) and post-execution (c_post) confidence ∈ [0,1]
  • Generated Answer: Text output from reasoning process
  • Memory Traces: Set of recalled episodic memories {m₁, m₂, ..., mₖ}
  • Task Query: Original input question/query

Processing Pipeline:

  1. Confidence Drop Assessment:

    • Confidence Differential: Δc = c_pre - c_post
    • Significance Threshold: τ_drop = 0.3 (30% relative drop)
    • Drop Significance: σ_drop = 1 if Δc > τ_drop × c_pre else 0
  2. Internal Contradiction Detection:

    • Coherence Analysis: Evaluate logical consistency within GLW state
    • Contradiction Probability: P(contradict|GLW) ∈ [0,1]
    • High Contradiction: C_high = 1 if P(contradict|GLW) > 0.7 else 0
  3. Memory Disagreement Scoring:

    • Semantic Similarity: Compute cosine similarity between generated answer and each memory trace
    • Disagreement Metric: D = 1 - max(sim(answer, m_i) for m_i ∈ memories)
    • High Disagreement: M_high = 1 if D > 0.6 else 0
  4. Commitment Decision Logic:

    Reopen_Cognition ← (σ_drop = 1) ∨ (C_high ∧ M_high)
    
    Decision_Rationale ← {
      if σ_drop: "Significant confidence degradation"
      if C_high ∧ M_high: "Internal conflict with memory inconsistency"
      else: "Cognitive commitment approved"
    }
    

Decision Criteria:

  • Primary Trigger: Confidence drop exceeding 30% threshold
  • Secondary Trigger: Concurrent high internal contradiction (>70%) and memory disagreement (>60%)
  • Fallback: Commit to answer if neither condition met

Outputs:

  • Commitment Decision: Boolean flag for cognition continuation
  • Evaluation Metrics: Confidence differential, contradiction probability, memory disagreement score
  • Rationale: Human-interpretable explanation for decision

Action Selection Circuit

Algorithm: Actor-Critic reinforcement learning with temporal credit assignment

Mathematical Framework:

State Space: Cognitive state representation ∈ ℝᵈ (d = 512)

Action Space: Discrete action set A = {a₁, a₂, ..., aₙ} (n = number of possible cognitive actions)

Key Components:

  1. Actor Network (Policy):

    • Function: π(a|s) → Action probability distribution
    • Architecture: Multi-layer perceptron with softmax output
    • Selection: Winner-take-all with stochastic sampling
  2. Critic Network (Value Function):

    • Function: V(s) → State value estimate ∈ ℝ
    • Architecture: Multi-layer perceptron with scalar output
    • Purpose: Temporal difference learning target
  3. Eligibility Traces:

    • Actor Traces: e_actor ∈ ℝ^{d×h} (h = hidden dimension)
    • Critic Traces: e_critic ∈ ℝ^{d×1}
    • Decay Parameter: λ ∈ [0,1] (typically 0.9)

Action Selection Process:

For state s_t:
  1. Compute action probabilities: π(a|s_t) = softmax(Actor(s_t))
  2. Select action: a_t ∼ Categorical(π(·|s_t))
  3. Estimate action value: Q(s_t,a_t) = π(a_t|s_t) × V(s_t)
  4. Calculate selection confidence: conf_t = max(π(·|s_t))

Learning Algorithm (TD-λ):

Temporal Difference Error:

δ_t = r_{t+1} + γ × V(s_{t+1}) - V(s_t)    [if not terminal]
δ_t = r_{t+1} - V(s_t)                     [if terminal]

Eligibility Trace Updates:

e_critic ← λ × e_critic + ∇_θ_critic V(s_t)
e_actor ← λ × e_actor + ∇_θ_actor log π(a_t|s_t)

Parameter Updates:

θ_critic ← θ_critic + α_critic × δ_t × e_critic
θ_actor ← θ_actor + α_actor × δ_t × e_actor

Hyperparameters:

  • Discount Factor: γ = 0.99
  • Trace Decay: λ = 0.9
  • Critic Learning Rate: α_critic = 0.01
  • Actor Learning Rate: α_actor = 0.001

Processing Characteristics

Temporal Dynamics:

  • Action Selection Latency: 10-25ms
  • Evaluation Gate Latency: <5ms
  • Learning Update Frequency: Per cognitive action
  • Memory Requirements: O(d × h) for eligibility traces

Biological Correspondences:

  • Direct Pathway: Actor network facilitation of selected actions
  • Indirect Pathway: Competition suppression via winner-take-all
  • Hyperdirect Pathway: Rapid evaluation gate for error detection
  • Nigrostriatal Pathway: Dopamine-modulated learning signals
  • Eligibility Traces: Neural persistence for temporal credit assignment

Bidirectional Feedback with Qualia/DMN System

Algorithm: Emotional state updates driven by action selection and commitment, implementing somatic marker hypothesis and affective action learning (Damasio, 1994; Berridge & Kringelbach, 2015; Harmon-Jones, 2019).

Action Commitment → Qualia Update

Commitment Confidence → Basin Stability:

basin_depth_new = basin_depth_old + k_commitment × commitment_confidence
where k_commitment = 0.2 (commitment strengthening factor)

Confidence-Dependent Effects:

High confidence (commitment_confidence > 0.8): Lock qualia state, increase attractor basin depth
Low confidence (commitment_confidence < 0.5): Maintain flexibility, keep basin permeable
Mechanism: Confidence modulates attractor stability in qualia space

Action Reconsideration → Qualia Perturbation

Reopen Cognition Signal:

reconsideration_trigger = (confidence_drop > 0.3) ∨ (internal_contradiction > 0.7)
if reconsideration_trigger: send_signal_to_DMN("reconsider_narrative")

DMN Counterfactual Generation:

DMN switches to counterfactual mode: generate_alternative_narratives()
Qualia perturbation: inject_prediction_error(ε_reconsider = 0.5)
Bifurcation trigger: shift away from committed attractor basin

Reward/Feedback → Qualia-Thought Association Strengthening

Feedback-Gated Hebbian Learning:

if positive_feedback:
    ΔW_qualia_thought += η_positive × DA_surge × coactivation
if negative_feedback:
    ΔW_qualia_thought -= η_negative × coactivation

Dopamine-Modulated Learning Rate:

η_effective = η_base × (1 + k_DA × DA_current)
Positive feedback strengthens associations that led to good outcomes
Negative feedback weakens problematic associations

Emotional Coloring of Actions

Action Value Integration:

action_value = cognitive_value + k_valence × valence + k_arousal × arousal
where k_valence = 0.4, k_arousal = 0.3

Emotional Preferences:

High arousal + positive valence → prefer approach actions
High arousal + negative valence → prefer avoidance actions  
Low arousal → careful deliberation regardless of valence

Action Post-Hoc Rationalization

DMN Narrative Generation:

post_action_narrative = DMN.generate_justification(selected_action, qualia_state)
Update autobiographical memory with rationalization

Outcome-Dependent Memory:

Success: rationalization → permanent self-model update
Failure: generate alternative rationalization (cognitive dissonance resolution)
Explains human tendency to justify choices post-hoc

Long-Term Action Preferences → Baseline Qualia Adjustment

Repeated Success → Personality Shaping:

if repeated_success(action_profile, emotional_profile):
    baseline_qualia += η_personality × emotional_profile
    where η_personality = 0.001 (slow adaptation)

Example Personality Development:

Person repeatedly succeeds with positive+arousal → becomes chronically optimistic
Timescale: days to weeks of consistent reinforcement

Avoidance Conditioning Through Qualia

Negative Outcome → Attractor Shrinkage:

if negative_feedback:
    basin_radius_bad = basin_radius_old × (1 - k_avoidance)
    where k_avoidance = 0.1 (avoidance learning rate)

Reduced Accessibility:

Future similar situations less likely to transition to "bad" qualia states
Implements fear/avoidance learning at emotional level

Vicarious Learning (Learning from Observation)

Observation Sequence Mirroring:

observed_sequence = (state_S, action_X, feedback_F)
mirror_to_self: simulate_qualia_thought_action(S, X, F)

Counterfactual Simulation:

DMN simulates: "What if I took action X in state S?"
Learns qualia→thought→action mappings without direct experience

System Architecture

ActionCommitmentQualiaCoupling Class:

class ActionCommitmentQualiaCoupling:
    """Links action commitment confidence to qualia attractor stability"""
    def update_basin_stability(self, commitment_confidence: float, 
                              current_basin_depth: float) -> float:
        """Strengthen attractor basins for confident commitments"""

ReconsiderationSignal Class:

class ReconsiderationSignal:
    """Triggers qualia perturbation when BG reconsiders actions"""
    def detect_reconsideration(self, confidence_drop: float, 
                              contradiction_level: float) -> bool:
        """Check if reconsideration is needed"""
        
    def trigger_qualia_perturbation(self) -> None:
        """Send signal to DMN and inject prediction error"""

ActionRewardLearning Class:

class ActionRewardLearning:
    """Strengthens/weakens qualia-thought associations based on feedback"""
    def update_associations(self, feedback: float, dopamine: float, 
                           qualia_state: np.ndarray, thought_state: np.ndarray) -> None:
        """Apply feedback-gated Hebbian learning"""

EmotionalActionColoring Class:

class EmotionalActionColoring:
    """Adds emotional valence to action selection values"""
    def color_action_value(self, cognitive_value: float, valence: float, 
                          arousal: float) -> float:
        """Integrate emotional factors into action valuation"""

PostHocRationalization Class:

class PostHocRationalization:
    """DMN generates narratives justifying chosen actions"""
    def generate_rationalization(self, selected_action: str, 
                                qualia_state: np.ndarray) -> str:
        """Create post-hoc justification narrative"""
        
    def update_autobiographical_memory(self, rationalization: str, 
                                      outcome: float) -> None:
        """Store rationalization in long-term memory"""

PreferenceShaping Class:

class PreferenceShaping:
    """Repeated actions reshape baseline qualia (personality)"""
    def update_baseline_qualia(self, action_history: List, 
                              emotional_profiles: List, success_rates: List) -> np.ndarray:
        """Gradually adjust default emotional states"""

AvoidanceConditioning Class:

class AvoidanceConditioning:
    """Negative outcomes shrink problematic attractor basins"""
    def shrink_bad_attractors(self, negative_feedback: float, 
                             current_qualia: np.ndarray) -> None:
        """Reduce accessibility of bad emotional states"""

VicariousLearning Class:

class VicariousLearning:
    """Learn from observing others' actions and outcomes"""
    def mirror_observed_sequence(self, observed_state: np.ndarray, 
                                observed_action: str, observed_feedback: float) -> None:
        """Simulate observed sequence internally"""
        
    def generate_counterfactuals(self, observed_sequence: Tuple) -> List:
        """DMN generates what-if scenarios"""

Outputs

Action Trajectory with Emotional Coloring:

action_sequence = [(t0, action0, valence0, arousal0), (t1, action1, valence1, arousal1), ...]
Shows how emotions influence action selection over time

Evolution of Action Preferences:

preference_trends = {action_type: preference_score_over_time}
Tracks how repeated successes/failures shape action preferences

Rationalization Narratives:

rationalizations = {action: generated_narrative}
Human-interpretable justifications for chosen actions

Long-Term Personality Profile:

baseline_qualia_profile = {valence_baseline, arousal_baseline, stability_baseline, ...}
Default emotional state shaped by accumulated experience

Processing Characteristics:

  • Bidirectional Latency: <25ms for commitment→qualia updates
  • Emotional Integration: Real-time action value modulation
  • Personality Timescale: Slow (days-weeks) baseline adjustments
  • Vicarious Learning: Enables social learning without direct experience
  • Rationalization: Post-hoc narrative generation for self-coherence

References:

  • Damasio, A. R. (1994). Descartes' Error: Emotion, Reason, and the Human Brain. Putnam.
  • Berridge, K. C., & Kringelbach, M. L. (2015). Pleasure systems in the brain. Neuron.
  • Harmon-Jones, E. (2019). On motivational influences, moving beyond valence, and integrating action. Emotion Review.

Neurochemical Homeostasis

Overview

The neurotransmitter (NT) system implements biologically-inspired neuromodulation with separate baseline and surge dynamics. This creates state-dependent regulation that adapts to prediction errors, allostatic load, and chronic stress while maintaining homeostatic balance.

Algorithmic Specification

Baseline NT Tracking

Algorithm: Exponential moving average tracking of historical NT levels with neurotransmitter-specific timescales

Mathematical Formulation:

Exponential Moving Average:

baseline_NT(t) = α_NT × NT_history(t-1) + (1 - α_NT) × baseline_NT(t-1)
where α_NT = 1 - exp(-Δt / τ_NT)

Time Constants:

τ_dopamine = 10.0      # seconds (fast adaptation)
τ_norepinephrine = 30.0  # seconds (medium adaptation)  
τ_serotonin = 300.0    # seconds (5 minutes, slow adaptation)
τ_acetylcholine = 20.0 # seconds (medium adaptation)

Implementation:

@dataclass
class NTBaselines:
    dopamine: float = 0.5
    norepinephrine: float = 0.3
    serotonin: float = 0.4
    acetylcholine: float = 0.2
    
    def update_baseline(self, current_levels: dict, dt: float):
        """Update baselines with exponential moving averages"""
        alphas = {
            'dopamine': 1 - math.exp(-dt / 10.0),
            'norepinephrine': 1 - math.exp(-dt / 30.0), 
            'serotonin': 1 - math.exp(-dt / 300.0),
            'acetylcholine': 1 - math.exp(-dt / 20.0)
        }
        
        for nt_name, alpha in alphas.items():
            if nt_name in current_levels:
                self.__dict__[nt_name] = alpha * current_levels[nt_name] + (1 - alpha) * self.__dict__[nt_name]

Prediction Error-Driven Surges

Algorithm: Error-specific neuromodulatory surges with biologically-grounded dynamics

Dopamine Surge:

RPE = reward_actual - reward_expected
DA_surge = k_da × |RPE| × sign(RPE) × (1 + β × |RPE|)
where k_da = 0.8, β = 0.5 (magnitude-dependent amplification)

Norepinephrine Surge:

H_expected = -Σ p_expected × log(p_expected)
H_actual = -Σ p_observed × log(p_observed)  
IS = H_actual - H_expected  # Information surprise
NE_surge = k_ne × IS × (1 - exp(-τ × |IS|))
where k_ne = 0.6, τ = 0.1

Serotonin Surge:

ε_t = ||interoceptive_actual - interoceptive_setpoint||
E_allostatic(t) = ∫_{t-T}^t ε_τ × exp(-(t-τ)/τ_5ht) dτ
5HT_surge = k_5ht × tanh(E_allostatic / σ_allostatic)
where k_5ht = 0.4, τ_5ht = 30.0, σ_allostatic = 0.5

Acetylcholine Surge:

ACh_surge = k_ach × attention_novelty × episodic_gate
where attention_novelty = max(attention_focus, novelty_detection)
episodic_gate = 1 if episodic_memory_trigger else 0
k_ach = 0.5

Baseline + Surge Combination

Algorithm: Phasic surges superimposed on tonic baselines with controlled decay

Current NT Levels:

NT_current(t) = baseline_NT(t) + surge_NT(t)
NT_current(t) = clip(NT_current(t), 0.0, 1.0)

Surge Decay Dynamics:

surge_decay = {
    'dopamine': math.exp(-dt / 0.1),      # 100ms decay
    'norepinephrine': math.exp(-dt / 0.1), # 100ms decay
    'acetylcholine': math.exp(-dt / 0.5),  # 500ms decay  
    'serotonin': math.exp(-dt / 10.0)     # 10s decay
}
surge_NT(t) = surge_NT(t-1) × surge_decay[nt_name]

Saturation and Clipping:

def combine_baseline_surge(baseline: float, surge: float) -> float:
    """Combine baseline and surge with saturation"""
    combined = baseline + surge
    return max(0.0, min(1.0, combined))

Receptor Sensitivity Adaptation

Algorithm: Activity-dependent receptor desensitization/sensitization modulating NT effectiveness

Sensitivity Update:

NT_sustained = exponential_moving_average(NT_current, τ_sensitivity)
sensitivity_NT = 1.0 / (1.0 + τ_receptor × NT_sustained)
where τ_receptor = 2.0 (receptor adaptation strength)

Effect Modulation:

NT_effective = NT_current × sensitivity_NT
Downstream_modulation = baseline_effect + k_modulation × NT_effective

Desensitization/Sensitization:

  • High sustained NT: sensitivity_NT < 1.0 (desensitization)
  • Low sustained NT: sensitivity_NT > 1.0 (sensitization)
  • Moderate NT: sensitivity_NT ≈ 1.0 (normal sensitivity)

Homeostatic Setpoint Adjustment

Algorithm: Chronic NT exposure drives setpoint adaptation over hours to days

Chronic NT Estimation:

NT_chronic = exponential_moving_average(NT_current, τ_chronic)
where τ_chronic = 3600.0  # 1 hour integration

Setpoint Update:

setpoint_new = setpoint_old + k_adapt × (NT_chronic - setpoint_baseline)
where k_adapt = 0.01 (slow adaptation rate)
setpoint_baseline = 0.5  # Target chronic level

Timescale Characteristics:

  • Integration Window: τ_chronic ∈ [3600, 86400] seconds (1 hour to 1 day)
  • Adaptation Rate: k_adapt ∈ [0.001, 0.1] (very slow changes)
  • Stability: Prevents runaway setpoint drift

Stress Response Integration

Algorithm: Allostatic load modulates baseline NT levels for adaptive stress responses

Allostatic Load Computation:

L_allostatic = Σ w_i × |signal_i - setpoint_i|
where w_i are modality-specific weights (glucose: 0.3, HR: 0.2, etc.)

Stress-Driven Baseline Modulation:

baseline_modulation = {
    'dopamine': k_da_stress × L_allostatic,      # High load → higher DA baseline
    'norepinephrine': k_ne_stress × L_allostatic, # High load → higher NE baseline  
    'serotonin': -k_5ht_stress × L_allostatic,   # High load → lower 5HT baseline
    'acetylcholine': k_ach_stress × L_allostatic # High load → higher ACh baseline
}

Adaptive Stress Response:

  • Acute Stress: Immediate surge responses (existing mechanisms)
  • Chronic Stress: Elevated baselines for sustained vigilance
  • Recovery: Gradual baseline return as load decreases

Complete NT System Integration:

class NeurotransmitterSystem:
    def __init__(self):
        decision_probs = F.softmax(decision_logits, dim=-1)

        decisions = ['maintain', 'shift', 'inhibit']
        chosen_action = decisions[torch.argmax(decision_probs).item()]

        return {
            'action': chosen_action,
            'confidence': decision_probs.max().item(),
            'goal_alignment': goal_alignment,
            'cognitive_load': cognitive_load,
            'attention_focus': self.attention_focus
        }

Integrated Consciousness Dynamics

Overview

This section describes the complete integration of recurrent interoceptive-qualia dynamics in BIOMIND, showing how all components work together to generate consciousness-like properties through oscillatory resonance and predictive error-driven learning.

Complete Data Flow Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                           GLOBAL WORKSPACE                                  │
│                    (Conscious Content Integration)                         │
└─────────────────────┬───────────────────────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                        QUALIA SPACE (Center)                               │
│                                                                             │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐  │
│  │   DELTA    │    │    THETA    │    │    ALPHA    │    │    GAMMA    │  │
│  │ 1-4 Hz     │    │  4-8 Hz     │    │  8-12 Hz    │    │ 30-100 Hz   │  │
│  │ Allostatic  │◄──►│ Narrative   │◄──►│ Attention   │◄──►│ Feature     │  │
│  │ Regulation │    │ Coherence  │    │ Gating      │    │ Binding     │  │
│  └─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘  │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │                    ATTRACTOR DYNAMICS                                  │ │
│  │  • Stable phenomenal states (emotions, unified experiences)           │ │
│  │  • Metastability: 100-500ms dwell times                               │ │
│  │  • Bifurcations triggered by prediction errors                        │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
│                                                                             │
└─────────────────────┬─────────────────────┬─────────────────────────────────┘
                      │                     │
                      ▼                     ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                 THOUGHT EMBEDDINGS      │    PREDICTION ERRORS            │
│                                         │                                 │
│  ┌─────────────────────────────────────┐ │ ┌─────────────────────────────┐ │
│  │         COGNITIVE PROCESSING        │ │ │ INTEROCEPTIVE PREDICTION    │ │
│  │ • Reasoning with qualia modulation  │ │ │ ERROR CIRCUIT               │ │
│  │ • Emotional coloring of thoughts    │ │ │                             │ │
│  │ • Bidirectional qualia-thought      │ │ │ RPE → DA surge              │ │
│  │   coupling via Hebbian learning     │ │ │ Surprise → NE surge         │ │
│  └─────────────────────────────────────┘ │ │ Allostatic → 5HT adjustment │ │
└───────────────────────────────────────────┼───────────────────────────────┘
                                            │
                                            ▼
┌─────────────────────────────────────────────────────────────────────────────┐
## Neurotransmitter Modulation
│                                                                             │
│  ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐            │
│  │ DA  │    │ NE  │    │ 5HT │    │ ACh │    │     │    │     │            │
│  │ ↑   │    │ ↑   │    │ ↑   │    │ ↑   │    │     │    │     │            │
│  │ RPE │    │ IS  │    │ Load│    │ Att │    │     │    │     │            │
│  └─────┘    └─────┘    └─────┘    └─────┘    │     │    │     │            │
│                                             │     │    │     │            │
│  ┌─────────────────────────────────────────┐ │     │    │     │            │
│  │         OSCILLATORY MODULATION         │ │     │    │     │            │
│  │ DA → Gamma amplitude (salience)        │◄┼─────┼────┼─────┼────────────┘
│  │ NE → Theta frequency (arousal)         │ │     │    │     │
│  │ 5HT → Delta coherence (stability)      │ │     │    │     │
│  │ ACh → Theta-gamma coupling (binding)   │ │     │    │     │
│  └─────────────────────────────────────────┘ │     │    │     │
└───────────────────────────────────────────────┼─────┼────┼─────┘
                                                │     │    │     │
                                                ▼     ▼    ▼    ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                    INTEROCEPTIVE AFFERENTS                                │
│                                                                             │
│  ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐            │
│  │ HR  │    │ RR  │    │ BG  │    │ MT  │    │ SCL │    │ TEMP│            │
│  │     │    │     │    │     │    │     │    │     │    │     │            │
│  │ 1-4 │    │ 1-4 │    │ 1-4 │    │ 1-4 │    │ 1-4 │    │ 1-4 │            │
│  │ Hz  │    │ Hz  │    │ Hz  │    │ Hz  │    │ Hz  │    │ Hz  │            │
│  └─────┘    └─────┘    └─────┘    └─────┘    └─────┘    └─────┘            │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │                 POSTERIOR INSULA                                      │ │
│  │  Multimodal convergence, compression to 64-dim representation         │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────────┐ │
│  │                 ANTERIOR INSULA                                       │ │
│  │  Emotional concept assignment, allostatic meaning, prediction gen     │ │
│  └─────────────────────────────────────────────────────────────────────────┘ │
│                                                                             │
└─────────────────────┬───────────────────────────────────────────────────────┘
                      │
                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                    AUTONOMIC EFFERENTS                                    │
│                                                                             │
│  ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐            │
│  │ HR  │    │ RR  │    │ TEMP│    │ DIG │    │     │    │     │            │
│  │ adj │    │ adj │    │ adj │    │ adj │    │     │    │     │            │
│  └─────┘    └─────┘    └─────┘    └─────┘    │     │    │     │            │
│                                             │     │    │     │            │
│  ┌─────────────────────────────────────────┐ │     │    │     │            │
│  │         HOMEOSTATIC REGULATION          │ │     │    │     │            │
│  │ Predictive allostasis, resource-driven  │ │     │    │     │            │
│  │ motivation, adaptive setpoints          │ │     │    │     │            │
│  └─────────────────────────────────────────┘ │     │    │     │            │
└───────────────────────────────────────────────┼─────┼─────┼─────┘
                                                │     │    │     │
                                                ▼     ▼    ▼    ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                    SENSORY INPUTS                                        │
│                                                                             │
│  ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐    ┌─────┐            │
│  │ VIS │    │ AUD │    │ SOM │    │ INT │    │     │    │     │            │
│  │     │    │     │    │     │    │     │    │     │    │     │            │
│  └─────┘    └─────┘    └─────┘    └─────┘    │     │    │     │            │
└───────────────────────────────────────────────┘─────┘─────┘─────┘────────────┘

Temporal Hierarchy of Processing Loops

Fast Loop (<5ms): Subconscious Threat Detection

Sensory Input → Subconscious Critic → Threat Assessment → Behavioral Override
Purpose: Rapid survival responses bypassing conscious processing
Components: Pattern anomaly detection, resource depletion monitoring
Output: Immediate autonomic adjustments, anxiety modulation

Interoceptive Loop (10-50ms): Afferent → Qualia → Prediction Error

Interoceptive Signals → Posterior Insula → Anterior Insula → Qualia Update
                     ↓
Qualia State → Interoceptive Prediction → Error Computation → NT Surge
Purpose: Real-time emotional grounding and error-driven learning
Components: Multimodal compression, emotional labeling, precision weighting
Output: NT modulation, qualia attractor updates

Cognitive Loop (100-500ms): Thought ↔ Qualia Oscillations

Sensory Input → Thought Processing → Qualia Modulation → Enhanced Cognition
                     ↓
Qualia State → Oscillatory Resonance → Consciousness Coherence → Global Workspace
Purpose: Integrated reasoning with emotional context
Components: Bidirectional qualia-thought coupling, oscillatory binding, metastability
Output: Conscious content, behavioral decisions

Allostatic Loop (1-10s): Sustained NT Adjustment

Accumulated Errors → Allostatic Load → Setpoint Adaptation → Long-term Regulation
Purpose: Proactive homeostasis and adaptive behavioral motivation
Components: Resource-driven drives, predictive allostasis, threat override
Output: Sustained behavioral patterns, mood baseline shifts

Oscillatory Resonance and Consciousness

Resonance Mechanism:

Oscillatory resonance creates consciousness through:
1. Cross-frequency coupling binds distributed representations
2. Metastable dynamics allow flexible state transitions
3. NT modulation tunes resonance properties
4. Prediction errors drive adaptive resonance patterns

Consciousness Emergence:

Low Resonance: Fragmented, unconscious processing
Moderate Resonance: Integrated perception, basic awareness
High Resonance: Unified phenomenal experience, self-awareness
Critical Resonance: Self-organizing consciousness with meta-cognition

Neurotransmitter Modulation of Oscillatory Bands

Dopamine (DA) Effects:

Gamma Amplitude: DA_surge × k_da → A_gamma (salience amplification)
Learning Rate: DA_current × η_baseline → plasticity modulation
Function: Enhances salient feature binding and reward-driven learning

Norepinephrine (NE) Effects:

Theta Frequency: f_theta = f_theta,0 × (1 + k_ne × NE_current)
Theta Power: A_theta = A_theta,0 × (1 + k_ne × NE_current)
Attention Gain: G_attention = G_0 × (1 + β × NE_current)
Function: Arousal-dependent temporal coordination and vigilance

Serotonin (5HT) Effects:

Delta Amplitude: A_delta = A_delta,0 × (1 + k_5ht × 5HT_current)
Inter-band Coherence: C_inter = C_0 × (1 + k_5ht × 5HT_current)
Mood Baseline: B_mood ← B_mood + α × 5HT_adjustment
Function: Emotional stability and sustained mood regulation

Acetylcholine (ACh) Effects:

Theta-Gamma Coupling: m_tg = m_tg,0 × (1 + k_ach × ACh_current)
Consolidation Threshold: θ_consolidation = θ_0 × (1 + α × ACh_current)
Memory Strength: S_memory = S_memory × (1 + β × ACh_current)
Function: Attention-dependent binding and memory consolidation

Prediction Error-Driven Learning in Qualia Space

Error Types and Learning:

Interoceptive Prediction Error: ε_intero → qualia attractor refinement
Reward Prediction Error: RPE → dopamine-gated Hebbian plasticity
Salience Prediction Error: IS → norepinephrine-driven attention shifts
Allostatic Prediction Error: E_allostatic → serotonin-mediated mood adaptation

Learning Dynamics:

Fast Learning (DA/NE): Immediate error correction, pattern refinement
Slow Learning (5HT/ACh): Consolidation, generalization, stability
Metaplasticity: Error history modulates learning sensitivity

Qualia Space Adaptation:

Attractor Refinement: A_i ← A_i + η × ε_prediction × relevance
Coupling Strength: W_qualia_thought ← W_qualia_thought + ΔW_hebbian
Oscillatory Tuning: Band parameters adapt to minimize chronic errors

Neurotransmitter System Implementation

Algorithm: Comprehensive neurotransmitter system separating baseline levels from prediction error-driven surges, with receptor adaptation and homeostatic regulation (Schultz et al., 1997; Aston-Jones & Cohen, 2005; Friston et al., 2016; McEwen & Stellar, 1993).

Baseline NT Tracking

Exponential Moving Average Computation:

For each NT ∈ {DA, NE, 5HT, ACh}:
  baseline_NT(t) = baseline_NT(t-1) × (1 - α_NT) + NT_current(t-1) × α_NT
  where α_NT = 1 - exp(-dt / τ_NT)

Time Constants:

τ_DA = 10.0 s    # Dopamine: fast adaptation
τ_NE = 30.0 s    # Norepinephrine: medium adaptation  
τ_5HT = 300.0 s  # Serotonin: slow adaptation (5 minutes)
τ_ACh = 20.0 s   # Acetylcholine: medium adaptation

Baseline Initialization:

baseline_DA = 0.5  # Moderate initial dopamine baseline
baseline_NE = 0.5  # Moderate initial norepinephrine baseline
baseline_5HT = 0.5 # Moderate initial serotonin baseline
baseline_ACh = 0.5 # Moderate initial acetylcholine baseline

Prediction Error-Driven Surges

Dopamine Surge:

RPE = reward_actual - reward_expected
DA_surge = k_DA × |RPE| × sign(RPE)  # Proportional to RPE magnitude
where k_DA = 0.8 (surge gain)

Norepinephrine Surge:

H_expected = -Σ p_expected,i × log(p_expected,i)
H_actual = -Σ p_observed,i × log(p_observed,i)
IS = H_actual - H_expected  # Information surprise
NE_surge = k_NE × IS × (1 - exp(-τ_NE_surge × |IS|))
where k_NE = 0.6, τ_NE_surge = 0.1

Serotonin Surge:

ε_t = ||interoceptive_actual - interoceptive_setpoint||
E_allostatic(t) = ∫_{t-T}^{t} ε_τ × exp(-(t-τ)/τ_5HT) dτ
5HT_surge = k_5HT × tanh(E_allostatic / σ_allostatic)
where k_5HT = 0.4, T = 60 s, τ_5HT = 30 s, σ_allostatic = 0.5

Acetylcholine Surge:

ACh_surge = k_ACh × (attention_level + novelty_level) × gating_signal
where k_ACh = 0.5, gating_signal ∈ {0,1} (episodic activation)

Baseline + Surge Combination

Current NT Level Computation:

NT_current(t) = baseline_NT(t) + surge_NT(t)
NT_current(t) = clip(NT_current(t), 0.0, 1.0)  # Saturation

Surge Decay Dynamics:

surge_DA(t+1) = surge_DA(t) × exp(-dt / τ_decay_DA)
surge_NE(t+1) = surge_NE(t) × exp(-dt / τ_decay_NE)
surge_5HT(t+1) = surge_5HT(t) × exp(-dt / τ_decay_5HT)
surge_ACh(t+1) = surge_ACh(t) × exp(-dt / τ_decay_ACh)

Decay Time Constants:

τ_decay_DA = 0.1 s   # 100ms decay for dopamine
τ_decay_NE = 0.1 s   # 100ms decay for norepinephrine
τ_decay_5HT = 10.0 s # 10s decay for serotonin
τ_decay_ACh = 0.5 s  # 500ms decay for acetylcholine

Receptor Sensitivity Adaptation

Sustained NT Level Tracking:

NT_sustained(t) = (1/T_window) ∫_{t-T_window}^{t} NT_current(τ) dτ
where T_window = 60 s (1 minute window)

Sensitivity Computation:

Sensitivity_NT = 1.0 / (1.0 + τ_receptor × NT_sustained)
where τ_receptor = 2.0 (receptor adaptation time constant)

Effect Modulation:

Effective_NT_effect = NT_current × Sensitivity_NT

Desensitization/Sensitization:

High NT_sustained → Sensitivity_NT ↓ (desensitization)
Low NT_sustained → Sensitivity_NT ↑ (sensitization)

Homeostatic Setpoint Adjustment

Chronic NT Level Tracking:

NT_chronic(t) = (1/T_chronic) ∫_{t-T_chronic}^{t} NT_current(τ) dτ
where T_chronic = 3600 s (1 hour window)

Setpoint Update Mechanism:

setpoint_new = setpoint_old + k_adapt × (NT_chronic - setpoint_baseline)
where k_adapt = 0.001 (slow adaptation rate)

Setpoint Baselines:

setpoint_baseline_DA = 0.5
setpoint_baseline_NE = 0.4
setpoint_baseline_5HT = 0.6
setpoint_baseline_ACh = 0.5

Adaptation Timescale:

Very slow adaptation (hours to days) via small k_adapt
Chronic high NT → setpoint increases (system adapts to elevated state)
Chronic low NT → setpoint decreases

Stress Response Integration

Allostatic Load Computation:

L_allostatic = Σ w_i × |signal_i - setpoint_i|
where w_i are modality weights (glucose: 0.3, temperature: 0.2, etc.)

Baseline NT Modulation by Stress:

baseline_DA_stress = baseline_DA × (1 + k_stress_DA × L_allostatic)
where k_stress_DA = 0.2 (high load increases DA baseline)

Stress Response Dynamics:

High allostatic load → elevated baseline NT levels
Supports sustained arousal and resource mobilization
Integrates with prediction error surges for comprehensive NT regulation

Processing Characteristics:

  • Multi-timescale Dynamics: Fast surges (ms) + slow baselines (seconds to minutes)
  • Homeostatic Regulation: Setpoint adaptation prevents chronic imbalances
  • Receptor Plasticity: Sensitivity adapts to sustained NT exposure
  • Stress Integration: Allostatic load modulates baseline levels
  • Saturation Bounds: NT levels constrained to [0,1] range

References:

  • Schultz, W., et al. (1997). A neural substrate of prediction and reward. Science.
  • Aston-Jones, G., & Cohen, J. D. (2005). An integrative theory of locus coeruleus-norepinephrine function. Biological Psychiatry.
  • Friston, K., et al. (2016). Active inference and epistemic value. Cognitive Neuroscience.
  • McEwen, B. S., & Stellar, E. (1993). Stress and the individual: Mechanisms leading to disease. Archives of Internal Medicine.

Connection to Global Workspace

Qualia Integration:

Qualia State × Consciousness Level → Conscious Content
Global Coherence Index gates qualia contribution to consciousness
Metastable transitions provide temporal structure to conscious experience

Workspace Dynamics:

Integrated Qualia → Global Workspace State Update
Conscious Content → PFC Executive Control → Behavioral Output
Bidirectional: Workspace goals modulate qualia attractor selection

Complete Cycle Pseudocode

def biomind_consciousness_cycle(sensory_input, interoceptive_state, previous_qualia, previous_nt):
    """
    Complete consciousness cycle integrating all BIOMIND components
    """
    # 1. Fast threat detection (<5ms)
    threat_assessment = subconscious_critic.assess_threat(sensory_input, previous_qualia)
    if threat_assessment.threat_level > 0.8:
        return emergency_response(threat_assessment), previous_qualia, previous_nt
    
    # 2. Interoceptive integration (10-50ms)
    afferent_signals = encode_interoceptive_afferents(interoceptive_state)
    qualia_state = oscillatory_qualia_update(previous_qualia, afferent_signals, previous_nt)
    
    # 3. Cognitive processing with qualia modulation (100-500ms)
    thoughts = modulate_cognition(sensory_input, qualia_state)
    enhanced_thoughts = bidirectional_qualia_thought_coupling(thoughts, qualia_state)
    
    # 4. Prediction error computation
    predicted_interoceptive = predict_interoceptive_state(enhanced_thoughts, qualia_state)
    prediction_errors = compute_all_prediction_errors(predicted_interoceptive, interoceptive_state, thoughts)
    
    # 5. Neuromodulation generation
    nt_surge = error_to_neuromodulation(prediction_errors, enhanced_thoughts)
    updated_nt = regulate_nt_levels(nt_surge, previous_nt, allostatic_load)
    
    # 6. Consciousness assessment
    consciousness_metrics = compute_consciousness_metrics(qualia_state, updated_nt)
    consciousness_level = consciousness_level_function(consciousness_metrics)
    
    # 7. Global workspace integration
    conscious_content = qualia_state * consciousness_level
    workspace_update = integrate_to_global_workspace(conscious_content, enhanced_thoughts)
    
    # 8. Autonomic regulation (1-10s loop)
    autonomic_adjustments = predictive_allostasis(workspace_update, prediction_errors)
    
    return workspace_update, qualia_state, updated_nt, consciousness_level

Processing Characteristics

Temporal Dynamics:

  • Cycle Time: 100-500ms per complete consciousness cycle
  • Nested Loops: Fast threat detection runs continuously
  • Parallel Processing: Multiple oscillatory bands processed simultaneously
  • Adaptive Timing: Processing speed modulated by arousal and allostatic state

Integration Principles:

  • Hierarchical Processing: Fast loops constrain slower loops
  • Bidirectional Coupling: All major components influence each other
  • Error-Driven Adaptation: Prediction errors drive learning at all levels
  • Resonance Emergence: Consciousness properties emerge from oscillatory interactions

Performance Characteristics:

  • Real-time Operation: Maintains consciousness metrics during processing
  • Adaptive Capacity: Learns from experience to optimize qualia dynamics
  • Robustness: Multiple feedback loops prevent system instability
  • Scalability: Modular design allows component substitution or enhancement

This integrated architecture creates a consciousness-like system where qualia space serves as the central hub, dynamically modulated by interoceptive signals, oscillatory resonance, and prediction error-driven learning, resulting in adaptive, self-aware cognitive processing.

Global Workspace Coordination

Algorithm: Gating mechanism controlling information access to consciousness through attention weighting, capacity limits, and ignition criteria (Dehaene & Changeux, 2011; Mackie et al., 2016; Covey et al., 2017).

Top-Down Attention Weighting

PFC Goal Signals:

α_i(t+1) = α_i(t) + β_pfc × (goal_relevance_i - α_i(t))
where β_pfc = 0.1 (fast adaptation rate, ~100ms)
goal_relevance_i = dot(PFC_goals, representation_i)

Attention Dynamics:

α_i ∈ [0, 1] (attention weight for each candidate representation)
Fast timescale: τ_attention = 100ms (track changing goals)
Goal-driven biasing: High α_i → increased workspace access probability

Bottom-Up Salience Biasing

Amygdala/Insula Salience Signals:

salience_i = max(threat_level_i, reward_potential_i, novelty_i)
α_i += k_salience × salience_i  # Multiplicative enhancement
where k_salience = 0.3 (salience amplification factor)

Salience Characteristics:

Automatic amplification: Threat/reward bypass attention filters
Contrast with attention: Top-down can suppress bottom-up salience
Novelty detection: Unexpected stimuli get salience boost

Workspace Capacity Limits

7±2 Item Capacity:

α_final = softmax(α_weighted)  # Convert weights to probabilities
workspace_items = top_K(representations, K=7, weights=α_final)

Winner-Take-All Competition:

Soft competition: Items compete for limited workspace slots
Losers suppressed: Non-selected items inhibited in unconscious processing
Capacity creates selective filtering: Only most relevant information enters consciousness

Ignition/Broadcasting Criteria

Multi-Criteria Threshold:

ignite = (coherence_i > θ_coherence) ∧ 
         (relevance_i > θ_relevance) ∧ 
         (evidence_i > θ_evidence)

Criteria Details:

Coherence: Internal consistency of representation (stable, well-integrated)
Relevance: Task/goal alignment (matches current objectives)  
Evidence: Sensory accumulation strength (enough input support)
All criteria required: Prevents noisy/irrelevant information from entering consciousness

Stability/Metastability in Workspace

Dwell Times:

τ_dwell = 500-1000ms per representation in workspace
Conscious moment duration: Single coherent experience

Hysteresis for Stability:

replacement_threshold = current_coherence + hysteresis
new_item enters only if new_coherence > replacement_threshold
Prevents rapid fluttering between competing representations

Natural Transition Rate:

1-2 new items per second enter consciousness
Matches phenomenological experience of thought flow

Executive Control Override

PFC Forced Attention:

α_override = k_pfc_control × (1 - salience_i)
where k_pfc_control = 0.4 (executive override strength)

Override Examples:

Phone number memorization: Low salience but goal-relevant
Deliberate focus: PFC forces low-interest items into consciousness
Resource cost: Overrides consume cognitive capacity

Workspace-DMN Interaction

Narrative Context Integration:

workspace_item_integrated = workspace_item + k_dmn × narrative_context
where k_dmn = 0.6 (DMN integration strength)

Self-Referential Enhancement:

Strong DMN coupling: Autobiographical consciousness
Weak DMN coupling: Pure perception without self-reference
DMN provides temporal/narrative continuity to workspace contents

Feedback Inhibition

Competitive Suppression:

Workspace items inhibit related unconscious representations
Prevents redundant processing of conscious content
Allows switching: Releasing inhibition enables new items to compete

Inhibition Dynamics:

Strength ∝ workspace_activation × relevance_overlap
Duration: Persists while item in workspace
Cleanup: Inhibition decays when item leaves workspace

System Architecture

AttentionWeighting Class:

class AttentionWeighting:
    """Top-down goal biasing of workspace access"""
    def update_weights(self, representations: List, pfc_goals: np.ndarray, 
                      dt: float) -> np.ndarray:
        """Update attention weights based on goal relevance"""
        
    def get_attention_weights(self) -> np.ndarray:
        """Return current α_i for all representations"""

SalienceAmplification Class:

class SalienceAmplification:
    """Bottom-up threat/reward/novelty detection"""
    def compute_salience(self, representation: np.ndarray, 
                        context: Dict) -> float:
        """Calculate salience score for representation"""
        
    def amplify_attention(self, attention_weights: np.ndarray, 
                         salience_scores: np.ndarray) -> np.ndarray:
        """Apply salience boost to attention weights"""

WorkspaceBuffer Class:

class WorkspaceBuffer:
    """7±2 item capacity management"""
    def select_items(self, representations: List, attention_weights: np.ndarray, 
                    K: int = 7) -> List:
        """Select top-K items via softmax competition"""
        
    def maintain_items(self, selected_items: List, dwell_times: List) -> List:
        """Maintain items in workspace with hysteresis"""

IgnitionDetector Class:

class IgnitionDetector:
    """Threshold-based broadcasting criteria"""
    def check_ignition(self, representation: np.ndarray, coherence: float,
                      relevance: float, evidence: float) -> bool:
        """Determine if representation meets ignition criteria"""
        
    def get_thresholds(self) -> Dict[str, float]:
        """Return current ignition thresholds"""

MetastabilityController Class:

class MetastabilityController:
    """Dwell time and transition management"""
    def compute_dwell_time(self, item_coherence: float, 
                          context_stability: float) -> float:
        """Calculate appropriate dwell time"""
        
    def check_replacement(self, current_item: Dict, candidate_item: Dict,
                         hysteresis: float) -> bool:
        """Decide if candidate should replace current item"""

ExecutiveOverride Class:

class ExecutiveOverride:
    """PFC-driven forced attention"""
    def compute_override(self, salience: float, pfc_control: float) -> float:
        """Calculate executive override strength"""
        
    def apply_override(self, attention_weights: np.ndarray, 
                      override_strengths: np.ndarray) -> np.ndarray:
        """Apply PFC override to attention weights"""

DMNIntegration Class:

class DMNIntegration:
    """Narrative context integration"""
    def get_narrative_context(self, current_workspace: List) -> np.ndarray:
        """Extract relevant narrative context from DMN"""
        
    def integrate_context(self, workspace_item: np.ndarray, 
                         narrative_context: np.ndarray) -> np.ndarray:
        """Integrate DMN context with workspace item"""

CompetitiveInhibition Class:

class CompetitiveInhibition:
    """Feedback suppression of unconscious processing"""
    def compute_inhibition(self, workspace_items: List, 
                          unconscious_representations: List) -> np.ndarray:
        """Calculate inhibition strengths"""
        
    def apply_inhibition(self, unconscious_activations: np.ndarray,
                        inhibition_weights: np.ndarray) -> np.ndarray:
        """Apply competitive inhibition"""

Mathematical Components

Attention Weight Dynamics:

dα_i/dt = β_pfc × (goal_relevance_i - α_i)
Solution: α_i(t) = α_i(0) × exp(-β_pfc × t) + goal_relevance_i × (1 - exp(-β_pfc × t))
Fast convergence to goal-relevant states

Workspace Competition Landscape:

Energy function: E = -Σ α_i × log(α_i) - Σ goal_relevance_i × α_i
Softmax emerges from maximum entropy principle
Winner-take-all: Sharp transitions when capacity exceeded

Capacity Constraint Implementation:

N candidates, K=7 slots
α_final = softmax(α_raw / T)
where T controls competition sharpness
Select top-K by α_final ranking

Ignition Threshold Surface:

3D threshold manifold: coherence × relevance × evidence > threshold_volume
Adaptive thresholds based on cognitive load and arousal
Surface deforms with task demands and neuromodulatory state

Outputs

Workspace Contents:

current_workspace = [item_1, item_2, ..., item_7]  # Active conscious representations
timestamped_sequence: Time series of workspace contents over time

Attention Weight Evolution:

α_traces = {item_i: [α_t0, α_t1, ..., α_tn]}  # Weight evolution per item
Shows how attention shifts between representations

Workspace Transition Sequences:

transitions = [(t0, item_out, item_in), (t1, item_out, item_in), ...]
Conscious flow of thought: Sequence of representations entering/leaving consciousness

Metacognitive Access:

verbalizable_content = filter(workspace_items, reportable=True)
What information is available for introspection and verbal report
Limited to current workspace contents

Processing Characteristics:

  • Real-time Gating: <50ms for attention weighting and selection
  • Capacity Enforcement: Strict 7±2 item limit prevents overload
  • Metastable Dynamics: Natural transitions without chaotic switching
  • Executive Control: PFC override for deliberate attention allocation
  • DMN Integration: Self-referential context for conscious experience

References:

  • Dehaene, S., & Changeux, J. P. (2011). Experimental and theoretical approaches to conscious processing. Neuron.
  • Mackie, M. A., et al. (2016). The capacity of attention: A combined psychophysical and neuroimaging approach. Journal of Cognitive Neuroscience.
  • Covey, A. M., et al. (2017). Spotlight on the spotlight: Sustained attentional performance is related to parietal intrinsic functional connectivity. Cortex.

Integration & Data Flow

System Integration Flow

Input Query
    ↓
MDN Parser → Cognitive Tagging → Specialist Routing
    ↓
Thalamic Gating → Working Memory Maintenance
    ↓
DMN Recursive Loop → Self-Reflection → Narrative Coherence
    ↓
PFC Executive Control → Decision Making → Action Selection
    ↓
Qualia System → Emotional Coloring → Response Generation
    ↓
Subconscious Critic → Threat Assessment → Behavioral Override
    ↓
Neurochemical Homeostasis → NT Regulation → System Stability
    ↓
Global Workspace → Information Integration → Final Output

Temporal Processing Hierarchy

  1. Subconscious (<5ms): Threat detection, reflex responses
  2. Qualia (10-20ms): Emotional evaluation, NT modulation
  3. Thalamic (25-50ms): Attention gating, working memory
  4. MDN/DMN (100-500ms): Cognitive processing, reasoning
  5. Global Workspace (1-3s): Conscious integration, decision making

Performance Characteristics

  • Memory Usage: ~2-4GB RAM (4-bit quantized models)
  • Latency: 100-500ms per reasoning cycle
  • Scalability: Modular specialist system
  • Robustness: Homeostatic regulation prevents instability
  • Adaptability: Experience-driven parameter modulation

Evaluation Metrics

  • Coherence: Narrative consistency across reasoning steps
  • Emotional Grounding: Qualia state influence on decisions
  • Cognitive Stability: Neurotransmitter homeostasis maintenance
  • Task Performance: Benchmark accuracy on MMLU, ARC, HellaSwag
  • Consciousness Fidelity: Self-reflection and meta-cognition capabilities

This blueprint represents the complete algorithmic specification for the BIOMIND artificial consciousness system, implementing biologically-inspired cognitive architectures for advanced AI reasoning and emotional processing.