Skip to content
Part 5 of 20

V11 Configuration

Krrish Choudhary·March 23, 2026

Source: nct_v2/v11_config.py Lines: 219

Design Philosophy

The V11Config dataclass is the single source of truth for every hyperparameter in NCT. It serves three purposes: (1) complete specification, every parameter needed to instantiate, train, and evaluate NCT is contained in this single dataclass; (2) neuroscience documentation, every parameter has an inline comment explaining its biological rationale, creating a living record of design decisions; (3) reproducibility, given a V11Config instance, the model is fully deterministic (up to random initialization).

The dataclass contains 50+ parameters organized into 15 categories matching the brain systems they configure: core dimensions, L2/3 lateral association, predictive coding, interneurons, working memory, neuromodulation, oscillatory dynamics, thalamic routing, hippocampal memory, basal ganglia, wake-sleep cycling, structural plasticity, L5 dendritic computation, learning mode, BCM/metaplasticity, and training regularization.

The critical design constraint: all default values must produce a working model that fits in 6GB VRAM (NVIDIA RTX 4050 Laptop GPU). This means the default preset (106M parameters, 12 columns, d=512d=512) must complete a full forward pass including PC inference iterations (up to 5 re-settlings), Hebbian updates to all L2/3 association matrices, working memory state persistence, oscillatory modulation, and wake-sleep consolidation, all within 6GB of GPU memory using bfloat16 mixed precision.

Two computed properties derive from the config: d_head (=dcol/H= d_{\text{col}} / H, the per-head dimension) and columns_per_relay (=max⁡(1,N/G)= \max(1, N / G), how many columns share each thalamic relay group).

Complete Parameter Specification

Table 4. Complete V11Config parameter specification. Every parameter needed to recreate NCT.
ParameterTypeDefaultNeuroscience Rationale
Core Dimensions
d_modelint512Inter-column representation dimension
d_columnint512Intra-column processing dimension
n_columnsint12Number of hierarchical columns (like transformer layers)
d_ffint2048L5 feedforward expansion (4×d4\times d)
vocab_sizeint14000NCT morphological tokenizer (V≈13,817V \approx 13{,}817)
max_seq_lenint1024Maximum sequence length
L2/3 Lateral Association (Theorem B)
n_assoc_headsint8Association heads (analogous to attention heads)
n_settle_stepsint1Competitive settling iterations (>1>1 = recurrent)
k_wta_ratiofloat0.15k-WTA sparsity: top 15% active
hebbian_lrfloat10−410^{-4}Hebbian learning rate for WassocW_{\text{assoc}}
assoc_dropoutfloat0.1Dropout on association weights
assoc_window_sizeint16Causal window: 16 tokens = 2 theta cycles
Predictive Coding (Theorem A)
pc_min_stepsint2Minimum PC inference iterations
pc_max_stepsint5Maximum PC inference iterations
pc_convergence_thresholdfloat0.01Relative error change threshold for early stop
sigma2_initfloat1.0Initial prediction precision (σ2\sigma^2)
pc_learning_lrfloat3×10−43 \times 10^{-4}PC weight update learning rate
Interneurons
d_inhibitoryint128Inhibitory interneuron dimension
vip_enabledboolTrueVIP disinhibition gate
sst_enabledboolTrueSST dendritic inhibition
pv_enabledboolTruePV/Chandelier output veto
Working Memory
nmda_slotsint4NMDA attractor slots (Luck & Vogel: ∼\sim4)
nmda_d_slotint64Per-slot dimension
nmda_decay_initfloat6.0σ(6)≈0.9975\sigma(6) \approx 0.9975, half-life ≈277\approx 277 tokens
silent_d_traceint64Activity-silent trace dimension
phono_capacityint8Phonological loop slots (Miller’s 7±27\pm2)
Neuromodulation (Theorem C)
da_enabledboolTrueDopamine: reward prediction error
ne_enabledboolTrueNorepinephrine: arousal/exploration
serotonin_enabledboolTrueSerotonin: time horizon/patience
ach_enabledboolTrueAcetylcholine: attention/plasticity gate
tonic_da_emafloat0.999EMA decay for tonic DA baseline
Oscillatory Dynamics
gamma_periodint1Gamma cycle (1 token)
theta_periodint8Theta cycle (8 tokens)
alpha_periodint20Alpha cycle (20 tokens)
delta_periodint64Delta cycle (64 tokens)
Thalamus
n_relay_groupsint4Relay groups (∼\sim1 per 3 columns)
d_relayint256Relay intermediate dimension
d_trnint24TRN gating dimension
Hippocampus
hpc_memory_sizeint2048Max episodic memories in buffer
hpc_d_sparseint2048DG sparse expansion dimension (4d4d)
hpc_surprise_thresholdfloat0.5Surprise threshold for tagging
Basal Ganglia
d1_ec50 / d1_slopefloat0.65 / 8.0D1 receptor threshold / steepness
d2_ec50 / d2_slopefloat0.25 / 8.0D2 receptor threshold / steepness
Wake-Sleep (Theorem D)
sleep_intervalint100Wake steps between sleep phases
sleep_replay_stepsint50Replay steps per sleep phase
synaptic_downscalefloat0.99Sleep downscaling (1% per phase)
Structural Plasticity (Theorem E)
growth_thresholdfloat2.0PE threshold for synaptogenesis
prune_thresholdfloat0.01Weight magnitude for pruning
prune_intervalint1000Steps between pruning passes
Training
base_lrfloat3×10−43 \times 10^{-4}Base learning rate
gate_initfloat−2.0-2.0σ(−2)≈0.12\sigma(-2) \approx 0.12: identity at init
gate_lr_multfloat20.0Gates learn 20×20\times faster
dropoutfloat0.1Standard dropout
max_grad_normfloat1.0Gradient clipping

Presets

Three presets scale the architecture for different hardware:

Theorem 3 (Preset Scaling). All presets maintain the following invariants:

  • dff=4×dmodeld_{\text{ff}} = 4 \times d_{\text{model}} (standard FFN ratio)

  • dh=dmodel/Hd_h = d_{\text{model}} / H (head dimension)

  • drelay≈dmodel/2d_{\text{relay}} \approx d_{\text{model}} / 2 (thalamic bottleneck)

  • dsparse≈4×dmodeld_{\text{sparse}} \approx 4 \times d_{\text{model}} (DG expansion ratio)

  • WM slot dimensions scale with dmodeld_{\text{model}}

Model presets with parameter counts.
PresetddNNdffd_{\text{ff}}HHdrd_rParamsVRAM
default5121220488256106M∼\sim2 GB
v11_laptop76816307212384300M∼\sim5 GB
v11_1b1280205120206401,008M∼\sim10 GB

Source Code

Python
219 lines
# ===========================================================================
# Configuration
# Source: nct_v2/v11_config.py
# ===========================================================================

"""
NCT V11: Cortical Column Network — Configuration
=================================================

Architecture: N cortical columns (6-layer each) replacing transformer blocks.
Learning: Local predictive coding + Hebbian, no global backprop.
Operation: Continuous wake-sleep cycle, self-improving.

Theorems:
  A: Predictive Coding Replaces Backprop (Whittington & Bogacz 2017)
  B: Hebbian + Anti-Hebbian = Self-Organizing Representations (Pehlevan & Chklovskii 2019)
  C: Neuromodulatory Reward = RL Without Backprop (Schultz 1997, Dayan & Yu 2006)
  D: Wake-Sleep Cycle = Autonomous Self-Improvement (Tononi 2006)
  E: Structural Plasticity = Growing Architecture
"""



@dataclass
class V11Config:
    """Configuration for the Cortical Column Network."""

    # ── Core Dimensions ──────────────────────────────────────────────
    d_model: int = 512            # Inter-column dimension
    d_column: int = 512           # Intra-column processing dimension
    n_columns: int = 12           # Hierarchical column count (like layers)
    d_ff: int = 2048              # L5 feedforward expansion
    vocab_size: int = 14000       # NCT morphological tokenizer (~13,817 tokens)
    max_seq_len: int = 1024       # Maximum sequence length

    # ── L2/3 Lateral Association (Theorem B) ─────────────────────────
    n_assoc_heads: int = 8        # Association heads (like attention heads)
    n_settle_steps: int = 1       # Competitive settling iterations in L2/3 (>1 = recurrent settling)
    k_wta_ratio: float = 0.15    # k-WTA sparsity (top 15% active)
    hebbian_lr: float = 1e-4     # Hebbian learning rate for W_assoc
    assoc_dropout: float = 0.1   # Dropout on association weights
    assoc_window_size: int = 16   # Local causal window — O(T×w) not O(T²). 16 tokens = 2 theta cycles.

    # ── Predictive Coding (Theorem A) ────────────────────────────────
    n_inference_steps: int = 5    # PC inference iterations per input (legacy, see pc_max_steps)
    pc_min_steps: int = 2         # Minimum PC inference iterations
    pc_max_steps: int = 5         # Maximum PC inference iterations (reduced for memory efficiency)
    pc_convergence_threshold: float = 0.01  # Early-stop when error delta < this
    sigma2_init: float = 1.0     # Initial prediction precision (σ²)
    pc_learning_lr: float = 3e-4 # Weight update learning rate for PC

    # ── Interneurons ─────────────────────────────────────────────────
    d_inhibitory: int = 128       # Inhibitory interneuron dimension
    vip_enabled: bool = True      # VIP disinhibition (Thm 38)
    sst_enabled: bool = True      # SST dendritic inhibition (Thm 46)
    pv_enabled: bool = True       # PV/Chandelier output veto (Thm 41)

    # ── Working Memory ───────────────────────────────────────────────
    wm_enabled: bool = True
    nmda_slots: int = 4           # NMDA attractor slots (Luck & Vogel: ~4)
    nmda_d_slot: int = 64         # Per-slot dimension
    nmda_decay_init: float = 6.0  # sigmoid(6)≈0.9975, half-life ~277 tokens
    silent_d_trace: int = 64      # Activity-silent trace dimension
    silent_facil_init: float = 4.6  # sigmoid(4.6)≈0.990
    silent_depress_init: float = 2.5  # sigmoid(2.5)≈0.924
    phono_capacity: int = 8       # Phonological loop slots (Miller's 7±2)
    phono_d_slot: int = 64        # Per-slot dimension

    # ── Neuromodulation (Theorem C) ──────────────────────────────────
    da_enabled: bool = True       # Dopamine — prediction error / reward
    ne_enabled: bool = True       # Norepinephrine — arousal / exploration
    serotonin_enabled: bool = True  # Serotonin — time horizon / patience
    ach_enabled: bool = True      # Acetylcholine — attention / plasticity gate
    tonic_da_ema: float = 0.999   # EMA decay for tonic DA

    # ── Oscillatory ──────────────────────────────────────────────────
    oscillations_enabled: bool = True
    gamma_period: int = 1         # Gamma cycle (tokens)
    theta_period: int = 8         # Theta cycle
    alpha_period: int = 20        # Alpha cycle
    delta_period: int = 64        # Delta cycle

    # ── Thalamus ─────────────────────────────────────────────────────
    thalamic_enabled: bool = True
    n_relay_groups: int = 4       # Relay groups (1 per 3 columns)
    d_relay: int = 256            # Relay intermediate dimension
    d_trn: int = 24               # TRN dimension (small, efficient)

    # ── Hippocampus ──────────────────────────────────────────────────
    hpc_enabled: bool = True
    hpc_memory_size: int = 2048   # Max episodic memories
    hpc_d_sparse: int = 2048      # Dentate gyrus sparse expansion
    hpc_surprise_threshold: float = 0.1  # Tag threshold (lowered from 0.5 — was starving HPC at 2 memories)
    hpc_decay_init: float = 4.95  # sigmoid(4.95)≈0.993, ultra-slow

    # ── Cerebellum ───────────────────────────────────────────────────
    cerebellum_enabled: bool = True
    d_cerebellar: int = 256       # Cerebellar intermediate dimension

    # ── Basal Ganglia ────────────────────────────────────────────────
    bg_enabled: bool = True
    d_bg: int = 128               # BG intermediate dimension
    d1_ec50: float = 0.65         # D1 receptor threshold (high)
    d1_slope: float = 8.0         # D1 receptor steepness
    d2_ec50: float = 0.25         # D2 receptor threshold (low)
    d2_slope: float = 8.0         # D2 receptor steepness

    # ── Wake-Sleep Cycle (Theorem D) ─────────────────────────────────
    wake_sleep_enabled: bool = True
    sleep_interval: int = 100     # Wake steps between sleep phases
    sleep_replay_steps: int = 50  # Replay steps per sleep phase
    synaptic_downscale: float = 0.99   # Sleep downscaling (Tononi 2006) — 1% per sleep phase
    replay_priority: str = 'surprise'  # 'surprise', 'recency', 'uniform'
    sleep_contrastive_noise: float = 0.1  # Noise for contrastive consolidation

    # ── Structural Plasticity (Theorem E) — brain continuously prunes/grows
    structural_plasticity: bool = True
    growth_threshold: float = 2.0   # PE threshold for synaptogenesis
    prune_threshold: float = 0.01   # Weight magnitude for pruning
    prune_interval: int = 1000      # Steps between pruning passes

    # ── L5 Dendritic Computation ──────────────────────────────────────
    l5_dendritic: bool = True     # Enable basal/apical dendritic gating in L5
    l5_kwta: bool = True          # Enable k-WTA sparsity in L5 FFN

    # ── Learning Mode ────────────────────────────────────────────────
    learning_mode: str = 'hybrid'  # 'backprop', 'predictive_coding', 'hebbian', 'hybrid'
    # hybrid = PC for vertical + Hebbian for L2/3 + neuromod gating
    error_hebbian_weight: float = 0.5  # Blend: 0=blind Hebbian, 1=fully error-driven
    ntp_output_only: bool = True  # Restrict NTP backprop to output pathway (LM head + final L5)
    autonomous_training: bool = True  # Use AutonomousLoop in hybrid/PC/hebbian modes

    # ── BCM / Metaplasticity ─────────────────────────────────────────
    bcm_enabled: bool = True
    bcm_tau: float = 1000.0       # BCM threshold time constant
    metaplasticity_enabled: bool = True

    # ── Regularization ───────────────────────────────────────────────
    dropout: float = 0.1
    weight_decay: float = 0.01
    max_grad_norm: float = 1.0

    # ── Training ─────────────────────────────────────────────────────
    base_lr: float = 3e-4
    batch_size: int = 4
    seq_len: int = 512

    # ── Gate Initialization ──────────────────────────────────────────
    gate_init: float = -2.0       # sigmoid(-2)≈0.12, identity at init
    gate_lr_mult: float = 20.0    # Gates learn 20x faster

    # ── Precision ────────────────────────────────────────────────────
    use_bf16: bool = False        # bfloat16 mixed precision

    @property
    def d_head(self) -> int:
        """Per-head dimension for L2/3 association."""
        return self.d_column // self.n_assoc_heads

    @property
    def columns_per_relay(self) -> int:
        """How many columns share a thalamic relay group."""
        return max(1, self.n_columns // self.n_relay_groups)

    @classmethod
    def v11_laptop(cls, **overrides) -> 'V11Config':
        """~300M preset for 6GB laptop GPUs (RTX 4050/3060 etc).

        Scaling: d=768, 16 columns, 4× FFN ratio.
        Memory budget: ~600MB weights (bf16) + ~2.4GB optimizer + ~2GB activations = ~5GB.
        """
        defaults = dict(
            d_model=768,
            d_column=768,
            n_columns=16,
            d_ff=3072,
            vocab_size=14000,
            max_seq_len=1024,
            n_assoc_heads=12,         # 768/12 = 64 per head
            d_inhibitory=192,
            nmda_d_slot=80,
            silent_d_trace=80,
            phono_d_slot=80,
            d_relay=384,
            d_trn=28,
            n_relay_groups=4,
            hpc_d_sparse=3072,
            hpc_memory_size=4096,
            d_cerebellar=384,
            d_bg=192,
        )
        defaults.update(overrides)
        return cls(**defaults)

    @classmethod
    def v11_1b(cls, **overrides) -> 'V11Config':
        """1B parameter preset: d=1280, 20 columns, ~1006M params."""
        defaults = dict(
            d_model=1280,
            d_column=1280,
            n_columns=20,
            d_ff=5120,
            vocab_size=14000,
            max_seq_len=2048,
            n_assoc_heads=20,
            d_inhibitory=320,
            nmda_d_slot=128,
            silent_d_trace=128,
            phono_d_slot=128,
            d_relay=640,
            d_trn=40,
            n_relay_groups=5,
            hpc_d_sparse=5120,
            hpc_memory_size=8192,
            d_cerebellar=640,
            d_bg=320,
        )
        defaults.update(overrides)
        return cls(**defaults)