Skip to content
ResearchAI

NeuroCortex Transformer: Complete Technical Reference

Krrish Choudhary·March 23, 2026

Abstract

This document is the complete technical reference for the NeuroCortex Transformer (NCT), a cortical column network that replaces transformer blocks with biologically-grounded six-layer cortical columns trained through local predictive coding and Hebbian plasticity. It contains the full annotated source code (12,272 lines of Python), mathematical derivations for every module, TikZ architecture diagrams, initialization protocols, and all hyperparameters, everything needed to reproduce the system from this document alone. The accompanying standalone file (nct_v11_standalone.py) can train NCT from scratch on any machine with PyTorch. On WikiText-2 with a 300M-parameter model trained for 5,000 steps using zero backpropagation through its column hierarchy, NCT achieves validation perplexity 54.0 (256×\times improvement over random baseline), with self-calibrating prediction precision (σ2\sigma^2: 1.0→\rightarrow1.88) and 150 autonomous dream-phase consolidation cycles.

Status

This reference prints the full source code of the model beside its equations and diagrams. The text, the figures and the code are published together under the site licence.

Contents

20 parts
  1. Architecture Overview
  2. Annotated Source Code
  3. Morphological Decomposition EngineNeuroscience Motivation · Formal Definition · Decomposition Algorithm · Morphophonemic Normalization · False Decomposition Guard · Architecture Diagram · and 2 more
  4. NCT Morphological TokenizerNeuroscience Motivation · Vocabulary Architecture · Encoding Process · Special Token Design · Comparison with BPE · Vocabulary Construction Process · and 1 more
  5. V11 ConfigurationDesign Philosophy · Complete Parameter Specification · Presets · Source Code
  6. Legacy V10.2 ConfigurationPurpose · Source Code
  7. Brain Embeddings (Theorems 56–58)Neuroscience Foundation · Stage 1: Base Embedding (0ms) · Stage 2: Morphological Composition (170ms): Theorem 58 · Stage 3: Hub-and-Spoke Semantic Integration (250ms): Theorem 56 · Stage 4: Sparse Distributed Activation (300ms): Theorem 57 · Source Code
  8. Grid Cell Position Encoding (Theorems 59, 61, 62)Neuroscience Foundation · Why Not RoPE? · Mathematical Formulation · Implementation Details · Disease Mapping · Source Code
  9. Brain LM Head (Theorem 63)Neuroscience Foundation · Three-Component Architecture · Weight Tying · Disease Mapping · Initialization Protocol · Source Code
  10. Brain Decoding (Drift-Diffusion Sampler)Neuroscience Foundation · Drift-Diffusion Sampler · Inhibition of Return · σ2\sigma^2-Adaptive Temperature · BrainDecoder Orchestrator · Source Code
  11. Cortical Column: The Fundamental Compute UnitNeuroscience Foundation · Data Flow · Layer 4: Thalamic Input · Layer 2/3: Windowed Hebbian Association (Theorem B) · Working Memory: Three Timescales (NMDA, Silent, Phonological) · Oscillatory Dynamics: Nested PAC · and 6 more
  12. Subcortical SystemsNeuroscience Foundation · Thalamus + TRN · Hippocampus · Basal Ganglia · Cerebellum · Brainstem: Neuromodulation (Theorem C) · and 3 more
  13. Local Learning FrameworkOverview · Predictive Coding Optimizer (Theorem A) · Hebbian Optimizer (Theorem B) · Neuromodulated Plasticity (Theorem C) · Wake-Sleep Scheduler (Theorem D) · Developmental Program (Critical Periods) · and 2 more
  14. Full Model (CorticalColumnNetwork)Overview · V11BrainEmbedding · Forward Pass: 11 Stages · Loss Function · Self-Repair Mechanism · Key Methods · and 1 more
  15. Autonomous OperationNeuroscience Foundation · Always-On Learning (AlwaysOnLearning) · Imagination Engine (ImaginationEngine) · Curiosity Drive (CuriosityDrive) · Self-Play (SelfPlay) · Continual Learning Guard (ContinualLearningGuard) · and 4 more
  16. Scaling FrameworkThe Fundamental Insight: Local Learning Enables Modular Scaling · Operation 1: Progressive Column Growth (grow_columns) · Operation 2: Net2Net Column Splitting (split_column) · Operation 3: Overload Detection (find_overloaded_columns) · Operation 4: μ\muP Hyperparameter Transfer (extract_mu_p) · Operation 5: Scaling Cost Report (scaling_report) · and 3 more
  17. Production InterfaceOverview · Quantization (σ2\sigma^2-Guided Precision Mapping) · Distributed Training (FSDP2) · Alignment: SFT with σ2\sigma^2-Aware Weighting · Alignment: DPO with σ2\sigma^2-Adaptive β\beta · Tool Use (V11ToolAdapter) · and 4 more
  18. Training ScriptTraining Modes · Local Output Correction · Data Loading · Training Loop · Prenatal Phase · Smoke Test Suite (12 Tests) · and 3 more
  19. Theorem Index
  20. Results and AnalysisTraining Results (5,000 Steps, 300M Parameters) · Parameter Distribution

License

PolyForm Noncommercial License 1.0.0

This work is open research. Free for any noncommercial use: research, education, personal projects, evaluation, and nonprofit or public-sector use. Commercial use requires a separate license, available by contacting krrish@verace.in.