Skip to content
ResearchAISpecification

A Cortical Column Network for Natural Language Processing

Krrish Choudhary·March 31, 2026

Capabilities

  • 01 / 06
    Linearquadratic

    Layer 2/3 Windowed Hebbian Association

    Content-addressable recall in a local causal window of ww tokens with O(T×w)O(T \times w) cost, using WassocW_{\text{assoc}}, distance weights, anti-Hebbian lateral weights and k-WTA.

  • 02 / 06

    Cortical Column Processing Unit

    Single column with nine sublayers: L4, L1, SST/VIP, L2/3, WM, oscillations, PV/Chandelier, L5, L6, wired in a laminar pipeline.

  • 03 / 06

    Cortical Column Network (CCN)

    Hierarchical stack of N cortical column units replacing transformer self-attention for NLP, with thalamic routing, lateral links and global workspace.

  • 04 / 06

    Layer 5 Output and Prediction Sublayer

    SwiGLU FFN with basal/apical dendritic gates, k-WTA, top-down prediction for the column below, and per-token σ² via softplus.

  • 05 / 06

    k-Winner-Take-All Sparse Coding

    Keeps top k=⌊dh×0.15⌋k = \lfloor d_h \times 0.15 \rfloor activations per head, enforcing sparse distributed coding like cortical population sparseness.

  • 06 / 06

    BCM Homeostatic Plasticity

    Sliding threshold θBCM\theta_{\text{BCM}} tracks EMA of squared postsynaptic activity to prevent runaway Hebbian potentiation.

Abstract

A computer-implemented neural network system and method for natural language processing comprising a plurality of cortical column processing units arranged in a hierarchical stack, wherein each cortical column processing unit implements a biologically-grounded six-layer pipeline modelling the laminar structure of the mammalian neocortex. Each cortical column comprises a thalamic input layer, a top-down modulation layer, interneuron gating circuits, a windowed Hebbian association layer operating in O(T×\timesw) time complexity, working memory subsystems, oscillatory dynamics, and an output prediction layer generating per-token precision estimates. The system further comprises a thalamic routing system with a reticular nucleus for relevance-based gating, lateral column connections for horizontal communication, and a global workspace for surprise-weighted broadcast competition. The architecture replaces quadratic-complexity self-attention mechanisms with linear-complexity local association, supports local learning without global backpropagation, and provides built-in uncertainty quantification through precision-weighted predictive coding.

Status

Open research. This document was first drafted in the form of a patent specification, which is why it speaks of an invention and of claims. No patent application was filed and the lab does not intend to file one: where the text mentions a related or co-pending patent application, it means a companion document in this set, and none of them was filed. The work is published here as open research.

1. Field

The present invention relates generally to neural network architectures for natural language processing, and more particularly to a biologically-grounded cortical column network system that replaces transformer-based self-attention mechanisms with a hierarchical stack of cortical column processing units, each implementing a six-layer pipeline modelled on the laminar structure of the mammalian neocortex, incorporating local Hebbian learning, predictive coding, interneuron gating circuits, multi-timescale working memory, oscillatory dynamics, thalamic routing, lateral column connections, and global workspace broadcast for processing sequential language data.

2. Background

Prior Art: Transformer Neural Networks

The dominant architecture for natural language processing (NLP) since 2017 has been the transformer, introduced by Vaswani et al. in “Attention Is All You Need” (Advances in Neural Information Processing Systems, 2017). The transformer architecture processes input sequences through a stack of identical blocks, each comprising a multi-head self-attention mechanism and a position-wise feedforward network. Self-attention computes, for each token in a sequence, a weighted combination of all other tokens using learned query (QQ), key (KK), and value (VV) projections, with attention weights derived from a scaled dot-product followed by a softmax normalisation:

Attention(Q,K,V)=softmax ⁣(QK⊤dk)V\text{Attention}(Q, K, V) = \text{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right) V

This mechanism has proven effective for capturing long-range dependencies in language, leading to large-scale models such as GPT, BERT, PaLM, LLaMA, and their successors.

Limitations of the Prior Art

Despite their commercial success, transformer architectures suffer from several fundamental limitations that the present invention addresses:

Quadratic Computational Complexity

The self-attention mechanism in transformers has O(T2)O(T^2) time and memory complexity with respect to the sequence length TT, because every token must attend to every other token. This quadratic scaling limits practical deployment to context windows of thousands to hundreds of thousands of tokens, and imposes significant energy and hardware costs for long-document processing. Various linear attention approximations (e.g., Performer, Linformer, Longformer) have been proposed, but these typically sacrifice representational fidelity for efficiency and do not address the other limitations described below.

Absence of Biological Grounding

Transformers bear no structural correspondence to the neural circuits of the mammalian neocortex. The brain processes language through hierarchical cortical columns with six distinct laminar layers, local recurrent circuits, and inhibitory interneuron gating, none of which appear in transformer architectures. This lack of biological grounding means that transformers cannot benefit from the extensive neuroscience literature on cortical computation, and cannot exhibit brain-like properties such as graceful degradation, local learning, or self-monitoring.

Dependence on Global Backpropagation

Transformer training relies exclusively on global backpropagation of error gradients through the entire network. This requires storing all intermediate activations during the forward pass (consuming substantial memory), propagating gradients through potentially hundreds of layers (creating vanishing and exploding gradient problems), and performing a global synchronisation step after each batch. The brain, by contrast, learns primarily through local synaptic modification rules (Hebbian learning, predictive coding) that require no global error signal.

No Intrinsic Working Memory

Transformers have no persistent state between inference steps. All context is captured within the fixed-length attention window, and extending context requires either recomputing attention over the full history (at quadratic cost) or discarding old context. The brain maintains information across multiple timescales through distinct working memory subsystems (NMDA-receptor-mediated persistent activity, activity-silent synaptic traces, and articulatory rehearsal loops), enabling effectively unlimited temporal context.

No Uncertainty Quantification

Standard transformer outputs provide logit scores but no built-in measure of prediction uncertainty. Confidence estimation requires external calibration techniques or ensemble methods. The brain natively computes prediction precision (σ2\sigma^2) at every cortical level through precision-weighted predictive coding (PWPC), enabling context-dependent resource allocation: uncertain predictions trigger additional processing (“thinking harder”), while confident predictions proceed rapidly.

No Temporal Organisation

Transformers rely on position embeddings (sinusoidal or learned) to encode sequential order, but have no mechanism for the nested temporal organisation observed in cortical oscillations. The brain organises information processing through phase-amplitude coupling between oscillatory bands (gamma, theta, alpha, delta), binding items in working memory to distinct temporal phases and coordinating computation across cortical regions at different timescales.

No Self-Monitoring

Transformers have no metacognitive capacity to monitor their own processing quality. The brain employs anterior cingulate cortex (ACC) conflict monitoring, which detects inter-column disagreement and allocates additional computational resources (inference iterations) to difficult inputs. This adaptive computation is absent from uniform-depth transformer processing.

Need for Improvement

There exists a need in the art for a neural network architecture for natural language processing that: (a) achieves linear rather than quadratic computational complexity in sequence length; (b) is grounded in the laminar structure of the neocortex; (c) supports local learning without global backpropagation; (d) incorporates persistent multi-timescale working memory; (e) provides built-in uncertainty quantification; (f) implements oscillatory temporal organisation; and (g) includes metacognitive self-monitoring for adaptive computation. The present invention addresses all of these needs.

3. Summary

The present invention provides a computer-implemented neural network system and method for natural language processing that replaces the transformer self-attention architecture with a biologically-grounded cortical column network (CCN).

In a first aspect, the invention provides a computer-implemented neural network system for natural language processing, comprising: a plurality of NN cortical column processing units arranged in a hierarchical stack from a lowest column (column 0) to a highest column (column N−1N{-}1); a thalamic routing system comprising a plurality of relay groups and a thalamic reticular nucleus, configured to gate information flow between cortical columns; a set of lateral column connections providing horizontal communication between adjacent columns; and a global workspace module implementing surprise-weighted broadcast competition across all columns.

Each cortical column processing unit comprises six functional layers arranged in a biologically-grounded pipeline:

  1. a Layer 4 thalamic input sublayer receiving feedforward input from the thalamic routing system;

  2. a Layer 1 top-down modulation sublayer receiving predictions from a higher column;

  3. an interneuron gating circuit comprising VIP disinhibitory neurons, SST dendritic inhibitory neurons applied before lateral association, and PV/Chandelier output veto neurons applied after oscillatory dynamics;

  4. a Layer 2/3 windowed Hebbian association sublayer performing content-addressable recall within a local causal window of size ww tokens with O(T×w)O(T \times w) time complexity, using learned association weights, anti-Hebbian lateral decorrelation weights, distance-weighted context aggregation, and kk-winner-take-all competitive coding;

  5. a working memory subsystem operating at three distinct timescales: NMDA attractor slots with persistent activity, activity-silent synaptic traces with facilitation and depression dynamics, and a phonological loop with decay, rehearsal, and temporal context tagging;

  6. an oscillatory dynamics module implementing nested theta-gamma phase-amplitude coupling with learnable oscillatory periods;

  7. a Layer 5 output and prediction sublayer computing a feedforward output using SwiGLU activation with dendritic gating (basal and apical), kk-winner-take-all sparsity, a top-down prediction for the column below, and a per-token prediction precision estimate (σ2\sigma^2) via softplus activation; and

  8. a Layer 6 thalamic feedback sublayer generating a corticothalamic feedback signal for modulating the thalamic relay.

The system further comprises: a BCM homeostatic plasticity mechanism per column, maintaining a sliding threshold that prevents runaway Hebbian potentiation; a metaplasticity mechanism per column that adjusts learning rates based on recent plasticity history; a structural plasticity mechanism that prunes weak connections and grows new connections based on prediction error magnitude; and a metacognitive self-assessment module that computes inter-column conflict and dynamically allocates additional predictive coding inference iterations to difficult inputs.

In a second aspect, the invention provides a computer-implemented method for processing natural language input through the cortical column network system, comprising: embedding input tokens into a continuous representation; routing the embedded representation through the thalamic system to a first cortical column; processing the representation through the six-layer pipeline of each cortical column in hierarchical sequence; computing top-down prediction errors between each column’s prediction and the actual input of the column below; iteratively settling column representations through predictive coding inference iterations under adaptive convergence control; computing a global workspace broadcast based on surprise-weighted competition among columns; and producing output logits through a language model head.

In a third aspect, the invention provides a non-transitory computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to implement the cortical column network system and method described above.

The architecture provides the following advantages over the prior art:

  • Linear computational complexity O(T×w)O(T \times w) in sequence length, replacing the O(T2)O(T^2) complexity of self-attention;

  • Biological grounding in the six-layer laminar structure of the neocortex, enabling systematic architecture design guided by neuroscience;

  • Support for local learning without global backpropagation, through predictive coding and Hebbian learning rules;

  • Persistent multi-timescale working memory providing effectively unlimited temporal context;

  • Built-in per-token uncertainty quantification through precision-weighted predictive coding;

  • Oscillatory temporal organisation through nested phase-amplitude coupling;

  • Metacognitive self-monitoring with adaptive computation allocation;

  • identity-at-initialisation design ensuring stable training from random initialisation; and

  • A principled disease-mapping validation methodology wherein removal of any architectural component produces a specific, predictable failure mode corresponding to a known neurological or psychiatric condition.

4. Description of the Figures

The invention will be more fully understood from the following detailed description taken in conjunction with the accompanying drawings, in which:

FIG. 1 is a high-level architectural overview of the cortical column network system, showing the embedding layer, thalamic routing, hierarchical column stack, lateral connections, global workspace, subcortical systems, and language model head.

FIG. 2 is a detailed view of a single cortical column processing unit, illustrating the nine sublayers (L4, L1, SST/VIP, L2/3, WM, Oscillations, PV/Chandelier, L5, L6) and their internal data flow.

FIG. 3 is a diagram of the windowed Hebbian association mechanism in Layer 2/3, contrasting it with standard self-attention and showing the O(T×w)O(T \times w) local causal window computation.

FIG. 4 is a diagram of the thalamic routing system, showing relay groups, TRN relevance gating, and L6 corticothalamic feedback.

FIG. P1-1 is a block diagram showing the overall architecture of the cortical column network system, including the embedding layer, thalamic routing system, hierarchical stack of NN cortical columns, lateral connections, global workspace, and the language model head (Claim 1).

FIG. P1-2 is a flowchart showing the method for processing natural language input, illustrating the nine-step pipeline from embedding through output logit generation with predictive coding settling loops (Claim 2).

FIG. P1-3 is a diagram illustrating the non-transitory computer-readable storage medium claim, showing the six-layer pipeline specification stored on the medium (Claim 3).

FIG. P1-4 is a diagram illustrating the identity-at-initialisation principle, showing the gate parameter initialisation at g=−2.0g = -2.0 yielding sigmoid⁡(−2.0)≈0.12\operatorname{sigmoid}(-2.0) \approx 0.12, zero output weight matrices, and the residual bypass ensuring near-identity at init (Claim 4).

FIG. P1-5 is a diagram illustrating the Layer 2/3 windowed Hebbian association sublayer, showing the direct association path via Wassoc{\mathbf{W}_{\text{assoc}}} and the Hebbian update rule ΔW=η⋅(X⊤X)/N\Delta W = \eta \cdot (\mathbf{X}^\top \mathbf{X}) / N (Claim 5).

FIG. P1-6 is a diagram illustrating the windowed context aggregation mechanism, showing the distance-weighted combination within the causal window using softplus⁡((xt−xj)⋅Wdist)\operatorname{softplus}((\mathbf{x}_t - \mathbf{x}_j) \cdot \mathbf{W}_{\text{dist}}) and its O(T×w)O(T \times w) complexity (Claim 6).

FIG. P1-7 is a diagram illustrating the anti-Hebbian lateral decorrelation matrix, showing the update rule ΔWlateral=η⋅((Y⊤Y)/N−I)\Delta {\mathbf{W}_{\text{lateral}}}= \eta \cdot ((\mathbf{Y}^\top \mathbf{Y}) / N - \mathbf{I}) that drives head outputs toward orthogonality (Claim 7).

FIG. P1-8 is a diagram illustrating the kk-winner-take-all competitive coding mechanism, showing k=⌊dh×ρ⌋k = \lfloor d_h \times \rho \rfloor with sparsity ratio ρ=0.15\rho = 0.15 and the resulting sparse population code (Claim 8).

FIG. P1-9 is a circuit diagram illustrating the VIP disinhibition and SST dendritic inhibition pathway, showing seff=sSST⋅(1−vVIP)\mathbf{s}_{\text{eff}} = \mathbf{s}_{\text{SST}} \cdot (1 - \mathbf{v}_{\text{VIP}}) clamped to a maximum of 0.9 (Claim 9).

FIG. P1-10 is a diagram illustrating the PV/Chandelier output veto gate, showing the pass probability ppassp_{\text{pass}} with bias initialised to 5.0, the hard binary Bernoulli gate in the forward pass, and the straight-through gradient estimator in the backward pass (Claim 10).

FIG. P1-11 is a diagram illustrating the thalamic reticular nucleus (TRN) relevance gate, showing r=sigmoid⁡((Wq⋅x)⊙(Wk⋅δrelay)/dTRN)r = \operatorname{sigmoid}((\mathbf{W}_q \cdot \mathbf{x}) \odot (\mathbf{W}_k \cdot \boldsymbol{\delta}_{\text{relay}}) / \sqrt{d_{\text{TRN}}}) and the bimodality loss mean(r⋅(1−r))\text{mean}(r \cdot (1-r)) (Claim 11).

FIG. P1-12 is a diagram illustrating the Layer 6 thalamic feedback sublayer, showing the cortex-thalamus feedback loop where relay output is modulated as δrelay+0.1⋅fL6\boldsymbol{\delta}_{\text{relay}} + 0.1 \cdot \mathbf{f}_{\text{L6}} (Claim 12).

FIG. P1-13 is a diagram illustrating the lateral column connections, showing the low-rank send projection Wsend∈Rr×dmodel\mathbf{W}_{\text{send}} \in \mathbb{R}^{r \times d_{\text{model}}} and receive projection Wrecv∈Rdmodel×r\mathbf{W}_{\text{recv}} \in \mathbb{R}^{d_{\text{model}} \times r} with r=max⁡(dmodel/8,32)r = \max(d_{\text{model}}/8, 32) between adjacent columns (Claim 13).

FIG. P1-14 is a block diagram illustrating the global workspace broadcast mechanism, showing the surprise computation via mean squared prediction error, the softmax competition with learnable temperature, and the per-column write and read projections (Claim 14).

FIG. P1-15 is a diagram illustrating the oscillatory gamma amplitude modulation equation Aγ(t)=max⁡(0,1+κ1cos⁡(ϕθ)+κ2cos⁡(ϕδ)−κ3(1+cos⁡(ϕα))/2)A_\gamma(t) = \max(0, 1 + \kappa_1 \cos(\phi_\theta) + \kappa_2 \cos(\phi_\delta) - \kappa_3 (1 + \cos(\phi_\alpha))/2) with learnable periods via softplus⁡\operatorname{softplus} (Claim 15).

FIG. P1-16 is a diagram illustrating the phase-content bilinear coupling and oscillatory modulation, showing mosc=Wout⋅tanh⁡(Wcontent⋅h+Wphase⋅p)\mathbf{m}_{\text{osc}} = \mathbf{W}_{\text{out}} \cdot \tanh(\mathbf{W}_{\text{content}} \cdot \mathbf{h} + \mathbf{W}_{\text{phase}} \cdot \mathbf{p}) and the gated application h+sigmoid⁡(gosc)⋅Aγ⋅mosc\mathbf{h} + \operatorname{sigmoid}(g_{\text{osc}}) \cdot A_\gamma \cdot \mathbf{m}_{\text{osc}} (Claim 16).

FIG. P1-17 is a diagram illustrating the BCM homeostatic plasticity mechanism, showing the sliding threshold θBCM{\theta_{\text{BCM}}} updated via exponential moving average of mean squared postsynaptic activity, with potentiation and depression zones (Claim 17).

FIG. P1-18 is a diagram illustrating the metaplasticity module, showing the tracking of recent plasticity magnitude via EMA and the learning rate multiplier 1/(1+plasticity_ema)1 / (1 + \text{plasticity\_ema}) (Claim 18).

FIG. P1-19 is a diagram illustrating the structural plasticity mechanism in the Layer 2/3 Hebbian association sublayer, showing the binary connection mask, below-threshold pruning counter, and error-driven synaptogenesis lifecycle (Claim 19).

FIG. P1-20 is a diagram illustrating the metacognitive self-assessment module with zero learnable parameters, showing the inter-column conflict computed as Var(output1‾,…,outputN‾)\text{Var}(\overline{\text{output}_1}, \ldots, \overline{\text{output}_N}) and the mapping to additional inference iterations (Claim 20).

FIG. P1-21 is a diagram illustrating the Layer 5 dendritic gates, showing the apical dendritic gate modulated by Layer 1 top-down context and the basal dendritic gate modulated by Layer 4 thalamic input, both with bias initialised to 3.0 (sigmoid⁡(3.0)≈0.95\operatorname{sigmoid}(3.0) \approx 0.95) (Claim 21).

FIG. P1-22 is a diagram illustrating the per-token prediction precision σ2{\sigma^2} computation, showing the softplus⁡\operatorname{softplus} activation with depth-dependent initialisation and the developmental gradient from shallow to deep columns (Claim 22).

FIG. P1-23 is a flow diagram illustrating the predictive coding inference iterations performed without gradient computation, showing the convergence monitoring via relative prediction error change and early termination criteria (Claim 23).

FIG. P1-24 is a diagram illustrating the Layer 2/3 recurrent settling dynamics, showing the iterative association computation with re-anchoring to the pre-L2/3 input at each settling step (Claim 24).

FIG. P1-25 is a diagram illustrating the depth-dependent σ2{\sigma^2} temporal smoothing via exponential moving average, showing the time constant αi=1/(1+s⋅i)\alpha_i = 1 / (1 + s \cdot i) from instantaneous tracking at shallow columns to integration over approximately 16 tokens at deep columns (Claim 25).

FIG. P1-26 is a diagram illustrating the three Hebbian learning modes for the association matrix Wassoc{\mathbf{W}_{\text{assoc}}}: basic Hebbian, BCM-modulated Hebbian, and error-modulated BCM Hebbian with blend weight λ\lambda (Claim 26).

FIG. P1-27 is a table diagram illustrating the disease-mapping validation methodology, showing the correspondence between architectural component removal and specific neurological or psychiatric disease analogues (Claim 27).

FIG. P1-28 is a diagram illustrating the multi-scale parameter configurations, showing the proportional scaling of dmodeld_{\text{model}}, NN (number of columns), and dffd_{\text{ff}} across the 106M, 300M, and 1B parameter presets while preserving all biological mechanisms (Claim 28).

5. Figures

FIG. 1, Overall Architecture of the Cortical Column Network System
Figure 1. Overall Architecture of the Cortical Column Network System
FIG. 2, Cortical Column Processing Unit: Nine-Sublayer Pipeline
Figure 2. Cortical Column Processing Unit: Nine-Sublayer Pipeline
FIG. 3, Windowed Hebbian Association vs. Standard Self-Attention
Figure 3. Windowed Hebbian Association vs. Standard Self-Attention
FIG. 4, Thalamic Routing System: Relay Groups, TRN Gate, and L6 Feedback
Figure 4. Thalamic Routing System: Relay Groups, TRN Gate, and L6 Feedback
FIG. P1-1, System: Cortical Column Network Architecture (Claim 1)
Figure P1-1. System: Cortical Column Network Architecture (Claim 1)
FIG. P1-2, Method: Processing Natural Language Input (Claim 2)
Figure P1-2. Method: Processing Natural Language Input (Claim 2)
FIG. P1-3, Non-Transitory Computer-Readable Storage Medium (Claim 3)
Figure P1-3. Non-Transitory Computer-Readable Storage Medium (Claim 3)
FIG. P1-4, identity-at-initialisation Principle (Claim 4)
Figure P1-4. identity-at-initialisation Principle (Claim 4)
FIG. P1-5, L2/3 Hebbian Association: Direct Association Recall (Claim 5)
Figure P1-5. L2/3 Hebbian Association: Direct Association Recall (Claim 5)
FIG. P1-6, Windowed Context Aggregation with Distance Weighting (Claim 6)
Figure P1-6. Windowed Context Aggregation with Distance Weighting (Claim 6)
FIG. P1-7, Anti-Hebbian Lateral Decorrelation (Claim 7)
Figure P1-7. Anti-Hebbian Lateral Decorrelation (Claim 7)
FIG. P1-8, k-Winner-Take-All Competitive Coding (Claim 8)
Figure P1-8. k-Winner-Take-All Competitive Coding (Claim 8)
FIG. P1-9, VIP Disinhibition and SST Dendritic Inhibition (Claim 9)
Figure P1-9. VIP Disinhibition and SST Dendritic Inhibition (Claim 9)
FIG. P1-10, PV/Chandelier Output Veto Gate (Claim 10)
Figure P1-10. PV/Chandelier Output Veto Gate (Claim 10)
FIG. P1-11, Thalamic Reticular Nucleus (TRN) Gate (Claim 11)
Figure P1-11. Thalamic Reticular Nucleus (TRN) Gate (Claim 11)
FIG. P1-12, Layer 6 Thalamic Feedback: Cortex-Thalamus Loop (Claim 12)
Figure P1-12. Layer 6 Thalamic Feedback: Cortex-Thalamus Loop (Claim 12)
FIG. P1-13, Lateral Column Connections: Low-Rank Message Passing (Claim 13)
Figure P1-13. Lateral Column Connections: Low-Rank Message Passing (Claim 13)
FIG. P1-14, Global Workspace: Surprise-Weighted Broadcast (Claim 14)
Figure P1-14. Global Workspace: Surprise-Weighted Broadcast (Claim 14)
FIG. P1-15, Oscillatory Gamma Amplitude Modulation (Claim 15)
Figure P1-15. Oscillatory Gamma Amplitude Modulation (Claim 15)
FIG. P1-16, Phase-Content Bilinear Coupling and Oscillatory Modulation (Claim 16)
Figure P1-16. Phase-Content Bilinear Coupling and Oscillatory Modulation (Claim 16)
FIG. P1-17, BCM Homeostatic Plasticity (Claim 17)
Figure P1-17. BCM Homeostatic Plasticity (Claim 17)
FIG. P1-18, Metaplasticity Module (Claim 18)
Figure P1-18. Metaplasticity Module (Claim 18)
FIG. P1-19, Structural Plasticity in L2/3 Hebbian Association (Claim 19)
Figure P1-19. Structural Plasticity in L2/3 Hebbian Association (Claim 19)
FIG. P1-20, Metacognitive Self-Assessment (Claim 20)
Figure P1-20. Metacognitive Self-Assessment (Claim 20)
FIG. P1-21, Layer 5 Dendritic Gates (Claim 21)
Figure P1-21. Layer 5 Dendritic Gates (Claim 21)
FIG. P1-22, Per-Token Prediction Precision σ^2 Computation (Claim 22)
Figure P1-22. Per-Token Prediction Precision σ2{\sigma^2} Computation (Claim 22)
FIG. P1-23, Predictive Coding Inference (No Gradient) (Claim 23)
Figure P1-23. Predictive Coding Inference (No Gradient) (Claim 23)
FIG. P1-24, L2/3 Recurrent Settling with Re-Anchoring (Claim 24)
Figure P1-24. L2/3 Recurrent Settling with Re-Anchoring (Claim 24)
FIG. P1-25, Depth-Dependent σ^2 Temporal Smoothing (Claim 25)
Figure P1-25. Depth-Dependent σ2{\sigma^2} Temporal Smoothing (Claim 25)
FIG. P1-26, Hebbian Learning Modes for W_assoc (Claim 26)
Figure P1-26. Hebbian Learning Modes for Wassoc{\mathbf{W}_{\text{assoc}}} (Claim 26)
FIG. P1-27, Disease-Mapping Validation Methodology (Claim 27)
Figure P1-27. Disease-Mapping Validation Methodology (Claim 27)
FIG. P1-28, Multi-Scale Parameter Configurations (Claim 28)
Figure P1-28. Multi-Scale Parameter Configurations (Claim 28)

6. Detailed Description

The following detailed description discloses the cortical column network (CCN) system and method with sufficient specificity to enable a person skilled in the art of neural network architecture and natural language processing to reproduce the invention. Reference is made throughout to the accompanying drawings. Unless otherwise defined, all technical terms used herein have the meanings commonly understood by one of ordinary skill in the art.

System Overview (FIG. 1, FIG. P1-1)

Referring to FIG. 1 and FIG. P1-1, the cortical column network system comprises the following principal components:

  1. An embedding subsystem that converts discrete input token identifiers into continuous dmodeld_{\text{model}}-dimensional vector representations, with additive grid-cell position encoding;

  2. A thalamic routing system comprising GG relay groups and a thalamic reticular nucleus (TRN), routing information between cortical columns;

  3. A hierarchical stack of NN cortical column processing units (columns 0 through N−1N{-}1), each implementing a six-layer biological pipeline;

  4. A lateral column connection system providing horizontal communication between adjacent columns via low-rank message passing;

  5. A global workspace module implementing surprise-weighted broadcast competition among all columns;

  6. A metacognitive self-assessment module computing inter-column conflict and allocating adaptive computation;

  7. A set of subcortical systems including a brainstem neuromodulation module, a basal ganglia action selection module, a hippocampal episodic memory module, and a cerebellar temporal prediction module; and

  8. A language model head converting the final column output into vocabulary logit scores.

In a preferred embodiment, the system is configured with dmodel=512d_{\text{model}} = 512, N=12N = 12 columns, and a vocabulary size of approximately 14,000 tokens, yielding a model with approximately 106 million parameters. Scaling to 300 million parameters (dmodel=768d_{\text{model}} = 768, N=16N = 16) and 1 billion parameters (dmodel=1,280d_{\text{model}} = 1{,}280, N=20N = 20) is achieved by proportionally increasing dimensions while preserving all architectural features.

Cortical Column Processing Unit (FIG. 2, FIG. P1-2)

Referring to FIG. 2 and FIG. P1-2, each cortical column processing unit ii (where 0≤i<N0 \le i < N) comprises the following functional sublayers, wired in a specific biological pipeline order:

Layer 4: Thalamic Input Sublayer

The Layer 4 (L4) thalamic input sublayer receives feedforward input x∈RB×T×dmodel\mathbf{x} \in \mathbb{R}^{B \times T \times d_{\text{model}}} from the thalamic routing system and projects it into the intra-column processing space:

hL4=RMSNorm⁡(WL4⋅x)\mathbf{h}_{\text{L4}} = \operatorname{RMSNorm}(\mathbf{W}_{\text{L4}} \cdot \mathbf{x})

where WL4∈Rdcol×dmodel\mathbf{W}_{\text{L4}} \in \mathbb{R}^{d_{\text{col}} \times d_{\text{model}}} is a learned projection matrix and RMSNorm⁡\operatorname{RMSNorm} denotes root mean square layer normalisation. When dcol=dmodeld_{\text{col}} = d_{\text{model}}, WL4\mathbf{W}_{\text{L4}} is initialised as an identity matrix (identity-at-init), so the sublayer begins as a pass-through.

This sublayer corresponds to Layer 4 of the mammalian neocortex, which is the primary recipient of thalamic afferents. In visual cortex, L4 contains orientation-selective simple cells; in language cortex, it performs token-level feature extraction.

Layer 1: Top-Down Modulation Sublayer

The Layer 1 (L1) top-down modulation sublayer receives a top-down context signal ctd∈RB×T×dmodel\mathbf{c}_{\text{td}} \in \mathbb{R}^{B \times T \times d_{\text{model}}} from a higher column (or from the global workspace) and produces a modulatory signal:

mL1=sigmoid⁡(gL1)⋅RMSNorm⁡(WL1⋅ctd)\mathbf{m}_{\text{L1}} = \operatorname{sigmoid}(g_{\text{L1}}) \cdot \operatorname{RMSNorm}(\mathbf{W}_{\text{L1}} \cdot \mathbf{c}_{\text{td}})

where gL1g_{\text{L1}} is a learnable scalar gate parameter and WL1∈Rdcol×dmodel\mathbf{W}_{\text{L1}} \in \mathbb{R}^{d_{\text{col}} \times d_{\text{model}}} is a learned projection initialised to zeros. The gate is initialised to gL1=−2.0g_{\text{L1}} = -2.0, yielding sigmoid⁡(−2.0)≈0.12\operatorname{sigmoid}(-2.0) \approx 0.12, so the top-down modulation is nearly suppressed at initialisation and emerges only through learning.

This sublayer corresponds to Layer 1 of the neocortex, which contains apical dendrite tufts receiving feedback from higher cortical areas. The modulatory signal is added to the L4 output: h=hL4+mL1\mathbf{h} = \mathbf{h}_{\text{L4}} + \mathbf{m}_{\text{L1}}.

Interneuron Gating Circuits: Pre-Association Phase (FIG. P1-9)

Before the Layer 2/3 association step, the column state h\mathbf{h} is processed by the SST and VIP interneuron circuits.

VIP Disinhibitory Circuit.

The VIP (vasoactive intestinal peptide) interneuron circuit detects novelty in the top-down signal and produces a disinhibition signal:

vVIP=sigmoid⁡(gVIP)⋅sigmoid⁡(WVIP,out⋅GELU(WVIP,in⋅RMSNorm⁡(ctd)))\mathbf{v}_{\text{VIP}} = \operatorname{sigmoid}(g_{\text{VIP}}) \cdot \operatorname{sigmoid}(\mathbf{W}_{\text{VIP,out}} \cdot \text{GELU}(\mathbf{W}_{\text{VIP,in}} \cdot \operatorname{RMSNorm}(\mathbf{c}_{\text{td}})))

where gVIPg_{\text{VIP}} is a learnable gate parameter initialised to −2.0-2.0, WVIP,in∈Rdi×dcol\mathbf{W}_{\text{VIP,in}} \in \mathbb{R}^{d_i \times d_{\text{col}}} is an input projection, and WVIP,out∈Rdcol×di\mathbf{W}_{\text{VIP,out}} \in \mathbb{R}^{d_{\text{col}} \times d_i} is an output projection initialised to zeros. did_i is the inhibitory interneuron intermediate dimension (128 in the preferred embodiment). The VIP circuit is only active when top-down context is available.

SST Dendritic Inhibition.

The SST (somatostatin) interneuron circuit implements dendritic input gating via tonic inhibition modulated by VIP disinhibition:

sSST=sigmoid⁡(gSST)⋅(τtonic+(1−τtonic)⋅sigmoid⁡(WSST,out⋅GELU(WSST,in⋅RMSNorm⁡(h))))\mathbf{s}_{\text{SST}} = \operatorname{sigmoid}(g_{\text{SST}}) \cdot \left( \tau_{\text{tonic}} + (1 - \tau_{\text{tonic}}) \cdot \operatorname{sigmoid}(\mathbf{W}_{\text{SST,out}} \cdot \text{GELU}(\mathbf{W}_{\text{SST,in}} \cdot \operatorname{RMSNorm}(\mathbf{h}))) \right)

where τtonic=0.10\tau_{\text{tonic}} = 0.10 models the intrinsic sodium current that maintains baseline SST firing. When VIP disinhibition is present, the effective SST inhibition is reduced:

seff=min⁡(sSST⋅(1−vVIP),  0.9)\mathbf{s}_{\text{eff}} = \min(\mathbf{s}_{\text{SST}} \cdot (1 - \mathbf{v}_{\text{VIP}}),\; 0.9)

The column state is then gated: h←h⋅(1−seff)\mathbf{h} \leftarrow \mathbf{h} \cdot (1 - \mathbf{s}_{\text{eff}}). The clamp at 0.9 prevents complete suppression of the column, maintaining a minimum 10% signal pass-through.

This circuit models the canonical interneuron motif: VIP ⊣\dashv SST ⊣\dashv Pyramidal (apical dendrites). VIP cells are activated by top-down novelty and inhibit SST cells, thereby disinhibiting pyramidal cells and opening the column to learning from new contexts.

Layer 2/3: Windowed Hebbian Association (FIG. 3, FIG. P1-5 through P1-8)

The Layer 2/3 (L2/3) windowed Hebbian association sublayer is the central computation of each cortical column. It replaces the transformer’s self-attention mechanism with a biologically-grounded content-addressable recall mechanism operating within a local causal window.

Key Distinction from Self-Attention.

Self-attention computes QQ, KK, VV projections and a global dot-product attention matrix with O(T2)O(T^2) complexity. The present invention uses no Q/K/VQ/K/V projections, no softmax attention weights, no causal mask, and no O(T2)O(T^2) computation. Instead, it employs Hebbian association weights that are updated through local correlation-based learning.

Architecture.

L2/3 comprises HH association heads (8 in the preferred embodiment), each with dimension dh=dcol/Hd_h = d_{\text{col}} / H. Each head maintains the following parameters:

  1. Association matrix Wassoc(h)∈Rdh×dh{\mathbf{W}_{\text{assoc}}}^{(h)} \in \mathbb{R}^{d_h \times d_h}: A content-addressable memory that recalls stored patterns. Initialised as identity (recalls the input itself).

  2. Value projection Wval∈Rdcol×dcol\mathbf{W}_{\text{val}} \in \mathbb{R}^{d_{\text{col}} \times d_{\text{col}}}: Extracts value information from the window context. Initialised as identity.

  3. Distance weighting Wdist(h)∈Rdh\mathbf{W}_{\text{dist}}^{(h)} \in \mathbb{R}^{d_h}: Per-head learned distance weights for the local window context. Initialised to zeros (uniform weighting).

  4. Anti-Hebbian lateral weights Wlateral(h)∈Rdh×dh{\mathbf{W}_{\text{lateral}}}^{(h)} \in \mathbb{R}^{d_h \times d_h}: Decorrelation matrix enforcing orthogonal head representations. Initialised to zeros.

  5. Output projection Wout∈Rdcol×dcol\mathbf{W}_{\text{out}} \in \mathbb{R}^{d_{\text{col}} \times d_{\text{col}}}: Combines heads and projects to column dimension. Initialised to zeros (identity-at-init via residual).

  6. Gate parameter gL23g_{\text{L23}}: Scalar gate initialised to −2.0-2.0.

Forward Computation.

For input x∈RB×T×dcol\mathbf{x} \in \mathbb{R}^{B \times T \times d_{\text{col}}}:

  1. Normalise: xn=RMSNorm⁡(x)\mathbf{x}_n = \operatorname{RMSNorm}(\mathbf{x}).

  2. Multi-head reshape: xh∈RB×H×T×dh\mathbf{x}_h \in \mathbb{R}^{B \times H \times T \times d_h}.

  3. Direct association: For each head hh, compute at(h)=Wassoc(h)⋅xh,t\mathbf{a}_t^{(h)} = {\mathbf{W}_{\text{assoc}}}^{(h)} \cdot \mathbf{x}_{h,t} for all positions tt. This is content-addressable recall: the association matrix maps each input pattern to its stored association.

  4. Windowed context: For each position tt, gather the local causal window [t−w,t][t-w, t] where ww is the window size (16 tokens in the preferred embodiment, corresponding to approximately two theta oscillation cycles). Compute distance-weighted context:

    st,j(h)=softplus⁡ ⁣(Wdist(h)⋅(xh,t−xh,j)),j∈[t−w,t]s_{t,j}^{(h)} = \operatorname{softplus}\!\left( \mathbf{W}_{\text{dist}}^{(h)} \cdot (\mathbf{x}_{h,t} - \mathbf{x}_{h,j}) \right), \quad j \in [t-w, t]
    αt,j(h)=st,j(h)∑k=t−wtst,k(h)+ϵ\alpha_{t,j}^{(h)} = \frac{s_{t,j}^{(h)}}{\sum_{k=t-w}^{t} s_{t,k}^{(h)} + \epsilon}
    ct(h)=∑j=t−wtαt,j(h)⋅vh,j\mathbf{c}_t^{(h)} = \sum_{j=t-w}^{t} \alpha_{t,j}^{(h)} \cdot \mathbf{v}_{h,j}

    where v=Wval(xn)\mathbf{v} = \mathbf{W}_{\text{val}}(\mathbf{x}_n) reshaped to heads, and ϵ=10−8\epsilon = 10^{-8} prevents division by zero.

  5. Combine: r(h)=a(h)+c(h)\mathbf{r}^{(h)} = \mathbf{a}^{(h)} + \mathbf{c}^{(h)}.

  6. Anti-Hebbian decorrelation: r(h)←r(h)−Wlateral(h)⋅r(h)\mathbf{r}^{(h)} \leftarrow \mathbf{r}^{(h)} - {\mathbf{W}_{\text{lateral}}}^{(h)} \cdot \mathbf{r}^{(h)}. This subtraction of the lateral projection enforces that different heads encode distinct features, preventing representational collapse.

  7. k-WTA\text{k-WTA} competitive coding: For each head, retain only the top k=⌊dh×ρkWTA⌋k = \lfloor d_h \times \rho_{\text{kWTA}} \rfloor activations (where ρkWTA=0.15\rho_{\text{kWTA}} = 0.15 in the preferred embodiment), setting all others to zero. This enforces sparse distributed coding.

  8. Output: Reshape heads back to RB×T×dcol\mathbb{R}^{B \times T \times d_{\text{col}}}, apply Wout\mathbf{W}_{\text{out}}, and gate: yL23=sigmoid⁡(gL23)⋅Wout(r)\mathbf{y}_{\text{L23}} = \operatorname{sigmoid}(g_{\text{L23}}) \cdot \mathbf{W}_{\text{out}}(\mathbf{r}).

Settling Dynamics (FIG. P1-24).

The L2/3 computation may be iterated for nsettlen_{\text{settle}} steps (1 in the preferred embodiment), with re-anchoring to the input at each step:

hL23(k+1)=hpre+L23(hL23(k))\mathbf{h}_{\text{L23}}^{(k+1)} = \mathbf{h}_{\text{pre}} + \text{L23}(\mathbf{h}_{\text{L23}}^{(k)})

where hpre\mathbf{h}_{\text{pre}} is the post-SST/VIP state. This recurrent settling allows competitive dynamics to reach equilibrium when nsettle>1n_{\text{settle}} > 1.

Complexity.

The windowed context computation operates in O(T×w×dh)O(T \times w \times d_h) time and memory, where ww is the fixed window size. Since w≪Tw \ll T (typically w=16w = 16 while TT may be 512 or 1024), this is effectively O(T)O(T), linear in sequence length, in contrast to the O(T2)O(T^2) complexity of self-attention.

Hebbian Learning Rules (FIG. P1-26).

The association weights Wassoc{\mathbf{W}_{\text{assoc}}} and lateral weights Wlateral{\mathbf{W}_{\text{lateral}}} are updated through local Hebbian learning rules (not through backpropagation). Three update modes are provided:

  1. Basic Hebbian: ΔWassoc(h)=η⋅(X⊤X)/N\Delta {\mathbf{W}_{\text{assoc}}}^{(h)} = \eta \cdot (\mathbf{X}^\top \mathbf{X}) / N where X\mathbf{X} is the batch of head activations and N=B×TN = B \times T.

  2. BCM-modulated Hebbian: ΔWassoc(h)∝y(y−θBCM)⋅x⊤\Delta {\mathbf{W}_{\text{assoc}}}^{(h)} \propto \mathbf{y}(\mathbf{y} - \sqrt{{\theta_{\text{BCM}}}}) \cdot \mathbf{x}^\top where θBCM{\theta_{\text{BCM}}} is the BCM sliding threshold (see Section 5.6).

  3. Error-modulated BCM Hebbian: The BCM update is further modulated by prediction error magnitude, blending blind correlation learning with error-driven learning:

    ΔWassoc(h)∝[(1−λ)+λ⋅∥ϵ∥∥ϵ∥‾]⋅y(y−θBCM)⋅x⊤\Delta {\mathbf{W}_{\text{assoc}}}^{(h)} \propto \left[ (1 - \lambda) + \lambda \cdot \frac{\|\boldsymbol{\epsilon}\|}{\overline{\|\boldsymbol{\epsilon}\|}} \right] \cdot \mathbf{y}(\mathbf{y} - \sqrt{{\theta_{\text{BCM}}}}) \cdot \mathbf{x}^\top

    where λ∈[0,1]\lambda \in [0, 1] is the error-Hebbian blend weight (0.5 in the preferred embodiment).

Anti-Hebbian update for lateral weights: ΔWlateral(h)=η⋅((Y⊤Y)/N−I)\Delta {\mathbf{W}_{\text{lateral}}}^{(h)} = \eta \cdot ((\mathbf{Y}^\top \mathbf{Y}) / N - \mathbf{I}), which drives outputs toward orthogonality.

All Hebbian updates are performed with torch.no_grad()\texttt{torch.no\_grad()} (no gradient computation), consistent with the biological principle that synaptic modification occurs locally without a global error signal.

Working Memory Subsystem

After L2/3, the column state passes through the working memory (WM) subsystem, which maintains persistent information at three distinct timescales. The WM state persists across sequential forward calls (like biological working memory) and resets when the batch size changes or when explicitly cleared. A detailed description of the working memory subsystem is provided in a related patent application; the present description covers its integration within the cortical column pipeline.

NMDA Attractor Slots.

KK competitive attractor slots (4 in the preferred embodiment) with NMDA-receptor-mediated persistent activity. Each slot has dimension dslot=64d_{\text{slot}} = 64, a learned decay rate initialised so that sigmoid⁡(6.0)≈0.9975\operatorname{sigmoid}(6.0) \approx 0.9975 (half-life ≈277\approx 277 tokens), and competitive write/read via softmax scoring.

Activity-Silent Trace.

Tsodyks-Markram facilitation/depression dynamics with dimension dtrace=64d_{\text{trace}} = 64. Maintains a hidden memory trace through short-term synaptic weight changes, retrievable by probe stimuli even when neural activity has ceased.

Phonological Loop.

A ring buffer of Kp=8K_p = 8 slots with passive decay, active rehearsal, and temporal context tagging for serial order. Implements the articulatory rehearsal system of Baddeley’s working memory model.

Each WM system is gated by its own learnable parameter initialised to −2.0-2.0 and has read weights initialised to zeros, ensuring identity-at-init behaviour.

Oscillatory Dynamics Module (FIG. P1-15, P1-16)

The oscillatory dynamics module implements nested theta-gamma phase-amplitude coupling (PAC), organising information processing across temporal scales.

Oscillatory Bands.

Four oscillatory bands are modelled, with learnable periods constrained to be positive via softplus⁡\operatorname{softplus}:

  • Gamma (∼\sim30–80 Hz): Implicit at 1 token per cycle, each token IS one gamma cycle. Not parameterised separately.

  • Theta (∼\sim4–8 Hz): Pθ=softplus⁡(P^θ)P_\theta = \operatorname{softplus}(\hat{P}_\theta), initialised to 8 tokens. Corresponds to working memory binding cycles.

  • Alpha (∼\sim8–12 Hz): Pα=softplus⁡(P^α)P_\alpha = \operatorname{softplus}(\hat{P}_\alpha), initialised to 20 tokens. Corresponds to inhibitory gating.

  • Delta (∼\sim1–4 Hz): Pδ=softplus⁡(P^δ)P_\delta = \operatorname{softplus}(\hat{P}_\delta), initialised to 64 tokens. Corresponds to cross-regional coordination.

All periods are clamped to a minimum of 1.0 to prevent degenerate phase computations.

Phase-Amplitude Coupling.

The gamma amplitude modulation at position tt is:

Aγ(t)=max⁡ ⁣(0,  1+κ1cos⁡(ϕθ(t))+κ2cos⁡(ϕδ(t))−κ31+cos⁡(ϕα(t))2)A_\gamma(t) = \max\!\left(0,\; 1 + \kappa_1 \cos(\phi_\theta(t)) + \kappa_2 \cos(\phi_\delta(t)) - \kappa_3 \frac{1 + \cos(\phi_\alpha(t))}{2}\right)
(12)

where ϕb(t)=2πt/Pb\phi_b(t) = 2\pi t / P_b for each band bb, and κ1,κ2,κ3\kappa_1, \kappa_2, \kappa_3 are learnable coupling strengths constrained via tanh⁡\tanh to [−1,1][-1, 1]. At initialisation, κ1=0.3\kappa_1 = 0.3 (resting theta-gamma PAC), κ2=κ3=0\kappa_2 = \kappa_3 = 0.

Phase-Content Interaction.

A low-rank bilinear interaction between phase features and column content:

p=[sin⁡(ϕθ),cos⁡(ϕθ),sin⁡(ϕα),cos⁡(ϕα),sin⁡(ϕδ),cos⁡(ϕδ)]∈RT×6\mathbf{p} = [\sin(\phi_\theta), \cos(\phi_\theta), \sin(\phi_\alpha), \cos(\phi_\alpha), \sin(\phi_\delta), \cos(\phi_\delta)] \in \mathbb{R}^{T \times 6}
mosc=Wosc,out⋅tanh⁡(Wcontent⋅h+Wphase⋅p)\mathbf{m}_{\text{osc}} = \mathbf{W}_{\text{osc,out}} \cdot \tanh(\mathbf{W}_{\text{content}} \cdot \mathbf{h} + \mathbf{W}_{\text{phase}} \cdot \mathbf{p})

where Wcontent∈Rr×dcol\mathbf{W}_{\text{content}} \in \mathbb{R}^{r \times d_{\text{col}}}, Wphase∈Rr×6\mathbf{W}_{\text{phase}} \in \mathbb{R}^{r \times 6}, and Wosc,out∈Rdcol×r\mathbf{W}_{\text{osc,out}} \in \mathbb{R}^{d_{\text{col}} \times r} with rank r=32r = 32.

Output.

h←h+sigmoid⁡(gosc)⋅Aγ⋅mosc\mathbf{h} \leftarrow \mathbf{h} + \operatorname{sigmoid}(g_{\text{osc}}) \cdot A_\gamma \cdot \mathbf{m}_{\text{osc}}.

Interneuron Gating Circuits: Post-Computation Phase (FIG. P1-10)

After working memory and oscillatory processing, the PV/Chandelier interneuron circuit applies an output veto.

PV/Chandelier Output Veto.

The PV (parvalbumin) interneuron circuit models the chandelier cell axon initial segment gate, a binary go/no-go decision on whether the pyramidal cell fires:

ppass=sigmoid⁡(WPV,score⋅GELU(WPV,in⋅RMSNorm⁡(h)))p_{\text{pass}} = \operatorname{sigmoid}(\mathbf{W}_{\text{PV,score}} \cdot \text{GELU}(\mathbf{W}_{\text{PV,in}} \cdot \operatorname{RMSNorm}(\mathbf{h})))

where WPV,in∈Rdi×dcol\mathbf{W}_{\text{PV,in}} \in \mathbb{R}^{d_i \times d_{\text{col}}} and WPV,score∈R1×di\mathbf{W}_{\text{PV,score}} \in \mathbb{R}^{1 \times d_i} with bias initialised to 5.0, so ppass≈0.99p_{\text{pass}} \approx 0.99 at initialisation (nearly always passes).

A straight-through gradient estimator is used: the forward pass applies a hard binary gate (ppass>0.5p_{\text{pass}} > 0.5), while the backward pass uses the soft sigmoid gradient:

p^=⌊ppass>0.5⌋−sg(ppass)+ppass\hat{p} = \lfloor p_{\text{pass}} > 0.5 \rfloor - \text{sg}(p_{\text{pass}}) + p_{\text{pass}}

where sg(⋅)\text{sg}(\cdot) denotes the stop-gradient operation. The column state is then gated:

h←h⋅((1−sigmoid⁡(gPV))+sigmoid⁡(gPV)⋅p^)\mathbf{h} \leftarrow \mathbf{h} \cdot \left( (1 - \operatorname{sigmoid}(g_{\text{PV}})) + \operatorname{sigmoid}(g_{\text{PV}}) \cdot \hat{p} \right)

This preserves identity-at-init: at initialisation, gPV=−2.0g_{\text{PV}} = -2.0 contributes only ∼\sim12% gating influence, and the bias of 5.0 ensures the gate is nearly open.

Layer 5: Output and Prediction Sublayer (FIG. P1-21, P1-22)

Layer 5 (L5) is the primary output layer of the cortical column, with three distinct functions: feedforward output computation, top-down prediction generation, and per-token prediction precision estimation.

SwiGLU Feedforward Network.

The core computation uses SwiGLU activation (SiLU-gated linear unit, biologically analogous to the frequency-current curve of pyramidal neurons):

f=SiLU(Wgate⋅RMSNorm⁡(h))⊙(Wup⋅RMSNorm⁡(h))\mathbf{f} = \text{SiLU}(\mathbf{W}_{\text{gate}} \cdot \operatorname{RMSNorm}(\mathbf{h})) \odot (\mathbf{W}_{\text{up}} \cdot \operatorname{RMSNorm}(\mathbf{h}))

where Wgate,Wup∈Rdff×dcol\mathbf{W}_{\text{gate}}, \mathbf{W}_{\text{up}} \in \mathbb{R}^{d_{\text{ff}} \times d_{\text{col}}} and dff=4×dcold_{\text{ff}} = 4 \times d_{\text{col}} in the preferred embodiment.

Dendritic Gating.

Two dendritic gates modulate the feedforward computation:

  • Basal dendritic gate: Gated by bottom-up L4 input, optionally modulated by the previous column’s σ2{\sigma^2}:

    f←f⊙sigmoid⁡(Wdend⋅hL4+Wσ-adapt⋅σ2prev)\mathbf{f} \leftarrow \mathbf{f} \odot \operatorname{sigmoid}(\mathbf{W}_{\text{dend}} \cdot \mathbf{h}_{\text{L4}} + \mathbf{W}_{\sigma\text{-adapt}} \cdot {\sigma^2}_{\text{prev}})

    Bias initialised to 3.0 (sigmoid⁡(3.0)≈0.95\operatorname{sigmoid}(3.0) \approx 0.95), so the gate is nearly open at initialisation.

  • Apical dendritic gate: Gated by top-down L1 context:

    f←f⊙sigmoid⁡(Wapical⋅mL1)\mathbf{f} \leftarrow \mathbf{f} \odot \operatorname{sigmoid}(\mathbf{W}_{\text{apical}} \cdot \mathbf{m}_{\text{L1}})

    Also bias-initialised to 3.0 for identity-at-init.

k-WTA\text{k-WTA} Sparsity.

After dendritic gating, k-WTA\text{k-WTA} sparsity is applied: only the top k=⌊dff×ρkWTA⌋k = \lfloor d_{\text{ff}} \times \rho_{\text{kWTA}} \rfloor activations are retained, setting all others to zero. This models cortical sparse coding: approximately 15% of neurons are active at any time.

Output.

oi=Wdown⋅Dropout(f)\mathbf{o}_i = \mathbf{W}_{\text{down}} \cdot \text{Dropout}(\mathbf{f})

where Wdown∈Rdmodel×dff\mathbf{W}_{\text{down}} \in \mathbb{R}^{d_{\text{model}} \times d_{\text{ff}}} is initialised to zeros (identity-at-init via the residual connection). The column output is:

outputi=xinput+oi\text{output}_i = \mathbf{x}_{\text{input}} + \mathbf{o}_i

implementing a residual connection that bypasses the entire column computation.

Top-Down Prediction.

A separate linear projection generates a prediction of the input to the column below:

x^i→i−1=Wpredict⋅RMSNorm⁡(h)\hat{\mathbf{x}}_{i \to i-1} = \mathbf{W}_{\text{predict}} \cdot \operatorname{RMSNorm}(\mathbf{h})

where Wpredict∈Rdmodel×dcol{\mathbf{W}_{\text{predict}}}\in \mathbb{R}^{d_{\text{model}} \times d_{\text{col}}} is initialised to zeros. At initialisation, all predictions are zero, yielding maximum prediction error and maximum learning signal, the system begins in a state of maximum uncertainty and learns to make progressively better predictions.

Prediction Precision σ2{\sigma^2} (FIG. P1-22).

A precision head estimates the column’s confidence in its prediction:

σ2i=softplus⁡(Wσ⋅RMSNorm⁡(h))+ϵ{\sigma^2}_i = \operatorname{softplus}({\mathbf{W}_{\sigma}}\cdot \operatorname{RMSNorm}(\mathbf{h})) + \epsilon

where Wσ∈R1×dcol{\mathbf{W}_{\sigma}}\in \mathbb{R}^{1 \times d_{\text{col}}} has weight initialised with small random values (std =0.01= 0.01) to enable content-dependent precision from step 0, and bias initialised so that softplus⁡(bias)=σ2init,col\operatorname{softplus}(\text{bias}) = {\sigma^2}_{\text{init,col}} where σ2init,col{\sigma^2}_{\text{init,col}} is depth-scaled:

σ2init,col=σ2init⋅(1+sdepth⋅iN−1){\sigma^2}_{\text{init,col}} = {\sigma^2}_{\text{init}} \cdot \left(1 + s_{\text{depth}} \cdot \frac{i}{N-1}\right)

Deeper columns start with higher uncertainty (more uncertain predictions), modelling the developmental gradient observed by Huttenlocher (1990) in which deeper cortical areas mature later.

The bare softplus⁡\operatorname{softplus} activation (no hard clamps, no soft clamps) guarantees σ2>0{\sigma^2}> 0 while preserving gradient flow. ϵ=10−6\epsilon = 10^{-6} prevents exact zero.

σ2{\sigma^2} Temporal Smoothing (FIG. P1-25).

The raw σ2{\sigma^2} is further temporally smoothed via an exponential moving average (EMA) whose time constant depends on column depth:

αi=11+sEMA⋅i\alpha_i = \frac{1}{1 + s_{\text{EMA}} \cdot i}

Shallow columns (i=0i = 0): α≈1.0\alpha \approx 1.0 (instantaneous tracking). Deep columns (i=N−1i = N{-}1): α≈0.06\alpha \approx 0.06 (integrates over ∼\sim16 tokens). This models the temporal receptive field hierarchy observed by Hasson et al. (2008), where early sensory cortex responds at sub-second timescales and prefrontal cortex integrates over seconds.

Layer 6: Thalamic Feedback Sublayer

The Layer 6 (L6) thalamic feedback sublayer generates a corticothalamic feedback signal:

fL6=sigmoid⁡(gL6)⋅WL6⋅h\mathbf{f}_{\text{L6}} = \operatorname{sigmoid}(g_{\text{L6}}) \cdot \mathbf{W}_{\text{L6}} \cdot \mathbf{h}

where WL6∈Rdmodel×dcol\mathbf{W}_{\text{L6}} \in \mathbb{R}^{d_{\text{model}} \times d_{\text{col}}} is initialised to zeros and gL6=−2.0g_{\text{L6}} = -2.0. This feedback modulates the thalamic relay for the column’s next input processing cycle (see Section 5.3).

Thalamic Routing System (FIG. 4, FIG. P1-11, P1-12)

The thalamic routing system comprises GG relay groups (4 in the preferred embodiment) and a thalamic reticular nucleus (TRN). Columns are assigned to relay groups: columns [j⋅Cr,(j+1)⋅Cr)[j \cdot C_r, (j+1) \cdot C_r) share relay group jj, where Cr=N/GC_r = N / G is the columns-per-relay ratio.

Thalamic Relay

Each relay group contains a single relay unit that gates and routes information:

δrelay=Wrelay,out⋅GELU(Wrelay,in⋅RMSNorm⁡(x))\boldsymbol{\delta}_{\text{relay}} = \mathbf{W}_{\text{relay,out}} \cdot \text{GELU}(\mathbf{W}_{\text{relay,in}} \cdot \operatorname{RMSNorm}(\mathbf{x}))

where Wrelay,in∈Rdrelay×dmodel\mathbf{W}_{\text{relay,in}} \in \mathbb{R}^{d_{\text{relay}} \times d_{\text{model}}} and Wrelay,out∈Rdmodel×drelay\mathbf{W}_{\text{relay,out}} \in \mathbb{R}^{d_{\text{model}} \times d_{\text{relay}}} is initialised to zeros. When L6 feedback fL6\mathbf{f}_{\text{L6}} is available, it modulates the relay: δrelay←δrelay+0.1⋅fL6\boldsymbol{\delta}_{\text{relay}} \leftarrow \boldsymbol{\delta}_{\text{relay}} + 0.1 \cdot \mathbf{f}_{\text{L6}}.

Thalamic Reticular Nucleus (TRN)

The TRN computes a per-token relevance gate between pre-relay and post-relay signals:

r=sigmoid⁡ ⁣((Wq⋅x)⊙(Wk⋅δrelay)dTRN1/2)∈[0,1]r = \operatorname{sigmoid}\!\left( \frac{(\mathbf{W}_q \cdot \mathbf{x}) \odot (\mathbf{W}_k \cdot \boldsymbol{\delta}_{\text{relay}})}{d_{\text{TRN}}^{1/2}} \right) \in [0, 1]

where Wq,Wk∈RdTRN×dmodel\mathbf{W}_q, \mathbf{W}_k \in \mathbb{R}^{d_{\text{TRN}} \times d_{\text{model}}} are learned projections and dTRN=24d_{\text{TRN}} = 24 in the preferred embodiment.

The TRN gate is blended with a bypass via the TRN gate parameter:

reff=(1−sigmoid⁡(gTRN))⋅1+sigmoid⁡(gTRN)⋅rr_{\text{eff}} = (1 - \operatorname{sigmoid}(g_{\text{TRN}})) \cdot 1 + \operatorname{sigmoid}(g_{\text{TRN}}) \cdot r

At initialisation (gTRN=−2.0g_{\text{TRN}} = -2.0), the effective gate is ≈0.88+0.12r≈1\approx 0.88 + 0.12r \approx 1, passing nearly everything.

Bimodality Loss

To encourage the TRN to make binary gating decisions (fully pass or fully block), a bimodality loss is accumulated:

LTRN=1N∑imean(ri⋅(1−ri))\mathcal{L}_{\text{TRN}} = \frac{1}{N} \sum_{i} \text{mean}(r_i \cdot (1 - r_i))

This loss is minimised when r→0r \to 0 or r→1r \to 1, encouraging sharp gating decisions.

Routed Output

The final thalamic output for column ii is:

xthal=x+sigmoid⁡(grelay)⋅reff⋅δrelay\mathbf{x}_{\text{thal}} = \mathbf{x} + \operatorname{sigmoid}(g_{\text{relay}}) \cdot r_{\text{eff}} \cdot \boldsymbol{\delta}_{\text{relay}}

Lateral Column Connections (FIG. P1-13)

The lateral column connection system implements horizontal communication between adjacent columns via low-rank message passing.

Each column ii has a send projection Wsend,i∈Rrlat×dmodel\mathbf{W}_{\text{send},i} \in \mathbb{R}^{r_{\text{lat}} \times d_{\text{model}}} and a receive projection Wrecv,i∈Rdmodel×rlat\mathbf{W}_{\text{recv},i} \in \mathbb{R}^{d_{\text{model}} \times r_{\text{lat}}}, where rlat=max⁡(dmodel/8,32)r_{\text{lat}} = \max(d_{\text{model}} / 8, 32) is a low-rank bottleneck.

Column ii receives the average of messages from its immediate neighbours (i−1i{-}1 and i+1i{+}1):

li=sigmoid⁡(glat,i)⋅Wrecv,i⋅1∣Ni∣∑j∈NiWsend,j⋅outputj\mathbf{l}_i = \operatorname{sigmoid}(g_{\text{lat},i}) \cdot \mathbf{W}_{\text{recv},i} \cdot \frac{1}{|\mathcal{N}_i|} \sum_{j \in \mathcal{N}_i} \mathbf{W}_{\text{send},j} \cdot \text{output}_j

where Ni={i−1,i+1}∩{0,…,N−1}\mathcal{N}_i = \{i-1, i+1\} \cap \{0, \ldots, N{-}1\} is the set of neighbours. Edge columns have a single neighbour.

Send projections are initialised with small random weights (std =0.01= 0.01) to provide a learning signal for analytical updates. Gate parameters are initialised to −2.0-2.0.

Global Workspace Broadcast (FIG. P1-14)

The global workspace module implements the Global Workspace Theory (Baars 1988) and Global Neuronal Workspace (Dehaene & Naccache 2001), enabling columns to communicate beyond local lateral connections.

Write Projections

Each column ii writes a candidate broadcast via Wwrite,i∈Rdws×dmodel\mathbf{W}_{\text{write},i} \in \mathbb{R}^{d_{\text{ws}} \times d_{\text{model}}}:

bi=Wwrite,i⋅outputi\mathbf{b}_i = \mathbf{W}_{\text{write},i} \cdot \text{output}_i

where dws=max⁡(dmodel/4,64)d_{\text{ws}} = \max(d_{\text{model}} / 4, 64) is the workspace bottleneck dimension.

Surprise-Weighted Competition

Columns compete for broadcast access based on their prediction surprise:

si=mean(ϵi2),ω=softmax ⁣([s0,…,sN−1]softplus⁡(τ))s_i = \text{mean}(\boldsymbol{\epsilon}_i^2), \quad \boldsymbol{\omega} = \text{softmax}\!\left(\frac{[s_0, \ldots, s_{N-1}]}{\operatorname{softplus}(\tau)}\right)

where ϵi\boldsymbol{\epsilon}_i is the prediction error for column ii and τ\tau is a learnable temperature parameter (initialised to 1.0). High-surprise columns, those whose predictions are most wrong, win broadcast access. This implements the “ignition” mechanism of Global Workspace Theory.

Broadcast and Read

The workspace broadcast is the surprise-weighted combination:

w=∑i=0N−1ωi⋅bi\mathbf{w} = \sum_{i=0}^{N-1} \omega_i \cdot \mathbf{b}_i

Each column reads the broadcast via its own read projection:

mws,i=sigmoid⁡(gws)⋅Wread,i⋅w\mathbf{m}_{\text{ws},i} = \operatorname{sigmoid}(g_{\text{ws}}) \cdot \mathbf{W}_{\text{read},i} \cdot \mathbf{w}

where Wread,i∈Rdmodel×dws\mathbf{W}_{\text{read},i} \in \mathbb{R}^{d_{\text{model}} \times d_{\text{ws}}} and gws=−2.0g_{\text{ws}} = -2.0 at initialisation.

BCM Homeostasis (FIG. P1-17)

Each cortical column contains a BCM (Bienenstock-Cooper-Munro) homeostatic plasticity module that prevents runaway Hebbian potentiation.

The BCM sliding threshold tracks mean squared postsynaptic activity via EMA:

θBCM←(1−αBCM)⋅θBCM+αBCM⋅y2‾{\theta_{\text{BCM}}}\leftarrow (1 - \alpha_{\text{BCM}}) \cdot {\theta_{\text{BCM}}}+ \alpha_{\text{BCM}} \cdot \overline{y^2}

where αBCM=1/τBCM\alpha_{\text{BCM}} = 1 / \tau_{\text{BCM}} with τBCM=1000\tau_{\text{BCM}} = 1000 in the preferred embodiment.

The BCM rule modulates Hebbian learning: synapses driving activity above θBCM{\theta_{\text{BCM}}} are potentiated; those driving activity below θBCM{\theta_{\text{BCM}}} are depressed. This maintains selectivity and prevents the seizure-like instability that would result from unchecked positive-feedback Hebbian learning.

Metaplasticity (FIG. P1-18)

Each column also contains a metaplasticity module that adjusts learning rates based on recent plasticity history:

plasticity_ema←(1−1/τmeta)⋅plasticity_ema+(1/τmeta)⋅∣ΔW∣\text{plasticity\_ema} \leftarrow (1 - 1/\tau_{\text{meta}}) \cdot \text{plasticity\_ema} + (1/\tau_{\text{meta}}) \cdot |\Delta W|
lr_mult=11+plasticity_ema\text{lr\_mult} = \frac{1}{1 + \text{plasticity\_ema}}

where τmeta=500\tau_{\text{meta}} = 500. High recent plasticity (large recent weight changes) results in a lower learning rate multiplier, preventing instability after rapid learning. Low recent plasticity results in a higher multiplier, promoting exploration when learning has stagnated. This models the metaplastic threshold shift mechanism described by Abraham & Bear (1996).

Structural Plasticity (FIG. P1-19)

The L2/3 association layer supports structural plasticity: the ability to prune weak connections and grow new ones based on prediction error.

Connection Mask

A binary mask M(h)∈{0,1}dh×dh\mathbf{M}^{(h)} \in \{0, 1\}^{d_h \times d_h} tracks which connections in Wassoc(h){\mathbf{W}_{\text{assoc}}}^{(h)} are active. Initialised to all ones (fully connected).

Pruning

A counter C(h)\mathbf{C}^{(h)} tracks the number of consecutive steps each connection has been below the pruning threshold θprune=0.01\theta_{\text{prune}} = 0.01:

Cjk(h)←{Cjk(h)+1if ∣Wjk(h)∣<θprune and Mjk(h)=10otherwiseC_{jk}^{(h)} \leftarrow \begin{cases} C_{jk}^{(h)} + 1 & \text{if } |W_{jk}^{(h)}| < \theta_{\text{prune}} \text{ and } M_{jk}^{(h)} = 1 \\ 0 & \text{otherwise} \end{cases}

When Cjk(h)≥TpruneC_{jk}^{(h)} \geq T_{\text{prune}} (Tprune=1000T_{\text{prune}} = 1000 steps), the connection is permanently pruned: Mjk(h)←0M_{jk}^{(h)} \leftarrow 0, Wjk(h)←0W_{jk}^{(h)} \leftarrow 0.

Synaptogenesis

When the mean prediction error exceeds θgrow=2.0\theta_{\text{grow}} = 2.0, a fraction (5%) of pruned connections are restored with small random weights (std =0.01= 0.01). This models the brain’s ability to grow new synapses in response to persistent prediction failure.

Metacognitive Self-Assessment (FIG. P1-20)

The self-assessment module implements ACC-like (anterior cingulate cortex) conflict monitoring with zero learnable parameters.

Conflict Detection

Inter-column conflict is computed as the variance of column output means:

conflict=Var ⁣({outputi‾}i=0N−1)\text{conflict} = \text{Var}\!\left( \left\{ \overline{\text{output}_i} \right\}_{i=0}^{N-1} \right)

where outputi‾\overline{\text{output}_i} is the mean of column ii’s output across batch and sequence dimensions.

Adaptive Computation

When conflict exceeds a threshold (θconflict=0.5\theta_{\text{conflict}} = 0.5), additional predictive coding inference iterations are allocated:

nextra=min⁡ ⁣(nmax_extra,  ⌊conflict−θconflictθconflict⋅nmax_extra⌋)n_{\text{extra}} = \min\!\left(n_{\text{max\_extra}},\; \left\lfloor \frac{\text{conflict} - \theta_{\text{conflict}}}{\theta_{\text{conflict}}} \cdot n_{\text{max\_extra}} \right\rfloor\right)

where nmax_extra=2n_{\text{max\_extra}} = 2. This maps the brain’s mechanism of “thinking harder” on difficult inputs: high inter-column disagreement triggers additional settling iterations to resolve the conflict.

Health Monitoring

The module also tracks per-column health via EMA of σ2{\sigma^2} and PC convergence rate:

  • σ2{\sigma^2} divergence (>100> 100): triggers emergency down-scaling of L5 output weights.

  • σ2{\sigma^2} collapse (<0.001< 0.001): nudges Wσ{\mathbf{W}_{\sigma}} bias upward.

  • PC non-convergence (consistently hitting pc_max_steps\text{pc\_max\_steps}): flagged for monitoring.

Identity-at-Initialisation Design Principle (FIG. P1-4)

A critical design principle of the present invention is that every cortical column processing unit produces near-identity output at initialisation. This is achieved through:

  1. All gate parameters initialised to g=−2.0g = -2.0, yielding sigmoid⁡(g)≈0.12\operatorname{sigmoid}(g) \approx 0.12;

  2. All output weight matrices (Wout\mathbf{W}_{\text{out}}, Wdown\mathbf{W}_{\text{down}}, Wpredict{\mathbf{W}_{\text{predict}}}, L1 projection, L6 projection) initialised to zeros;

  3. Residual connections bypassing each column: output=input+column_delta\text{output} = \text{input} + \text{column\_delta};

  4. PV/Chandelier veto bias initialised to 5.0 (sigmoid⁡(5.0)≈0.99\operatorname{sigmoid}(5.0) \approx 0.99, nearly always passes);

  5. Dendritic gate biases initialised to 3.0 (sigmoid⁡(3.0)≈0.95\operatorname{sigmoid}(3.0) \approx 0.95, nearly open).

This ensures that a freshly constructed network with NN columns produces output ≈\approx input (through the chain of residual connections), enabling stable training from random initialisation without warmup or careful learning rate tuning. All functional behaviour emerges through learning.

Forward Pass Through the Complete System (FIG. P1-2, P1-23)

The complete forward pass proceeds as follows:

  1. Embedding: Input token IDs ∈NB×T\in \mathbb{N}^{B \times T} are embedded into RB×T×dmodel\mathbb{R}^{B \times T \times d_{\text{model}}} via a learned embedding table. Grid-cell position encoding is added with a small scaling factor (0.1).

  2. Bottom-up pass: The embedded representation is processed sequentially through columns 0 to N−1N{-}1:

    1. Route through the thalamic relay for column ii (with L6 feedback if available).

    2. Process through the six-layer pipeline of column ii.

    3. Pass the column output as feedforward input to column i+1i{+}1.

    4. Pass the column’s σ2{\sigma^2} as input to column i+1i{+}1’s L5 dendritic gate.

  3. Prediction error computation: For each column ii, compute:

    ϵi=targeti−predictioni\boldsymbol{\epsilon}_i = \text{target}_i - \text{prediction}_i

    where target0=embedding\text{target}_0 = \text{embedding} and targeti=outputi−1\text{target}_i = \text{output}_{i-1} for i>0i > 0.

  4. Lateral communication: Compute lateral signals between adjacent columns (Section 5.4).

  5. Global workspace broadcast: Compute surprise-weighted broadcast (Section 5.5).

  6. Metacognitive assessment: Compute inter-column conflict and determine additional PC iterations (Section 5.9).

  7. Predictive coding inference: Under torch.no_grad(), iterate up to pc_max_steps+nextra\text{pc\_max\_steps} + n_{\text{extra}} times:

    1. Process all columns with top-down context from the workspace + lateral + higher column predictions.

    2. Recompute predictions and errors.

    3. Recompute lateral and workspace communications.

    4. Check for convergence: stop early if relative error change <θconv< \theta_{\text{conv}}.

  8. Output: Apply RMSNorm⁡\operatorname{RMSNorm} to the final column output and produce logits via the language model head: logits=LMHead(RMSNorm⁡(outputN−1))\text{logits} = \text{LMHead}(\operatorname{RMSNorm}(\text{output}_{N-1})).

Disease-Mapping Validation Methodology (FIG. P1-27)

A distinguishing feature of the present invention is its use of neuroscience-grounded disease mapping as a systematic validation methodology. Because each architectural component models a specific brain mechanism, removing that component should produce a specific, predictable failure mode corresponding to a known neurological or psychiatric disease. This provides both:

  • A design tool: For every proposed component, the question “what disease would result if this were removed?” must have a specific answer. If no disease analogue exists, the component may be unnecessary.

  • A validation tool: If removing a component produces the expected failure mode, the component is correctly implemented. If it produces a different failure mode, there is a bug.

Table [?] in FIG. P1-27 provides the complete disease-mapping reference. Selected entries include:

Component RemovedDisease AnalogueExpected Failure Mode
Global workspaceVegetative stateNo global broadcast; unconscious-only processing
VIP interneuronsAutism (ASD)No disinhibitory gate; failure to integrate context
SST interneuronsHallucination-likeUnregulated top-down; false perceptions
PV/ChandelierEpilepsyNo output veto; uncontrolled cortical output
NMDA WM slotsSchizophreniaNMDA hypofunction; thought fragmentation
Thalamic relayComaNo routing; cortex isolated from input
TRN gatingFatal familial insomniaNo relevance filtering; unfiltered input
L1 top-downBroca’s aphasiaNo re-entrant processing
L2/3 lateral weightsCortical dedifferentiationRepresentational collapse (all heads same)
BCM homeostasisEpilepsy (E/I imbalance)Runaway Hebbian potentiation
MetaplasticityFragile X syndromePermanently shifted plasticity threshold
OscillationsSchizophrenia (gamma)Disrupted temporal binding
Self-assessmentAnosognosiaNo self-awareness of processing deficits

This methodology extends beyond simple ablation studies: it provides a theory-driven prediction of failure modes that can be empirically verified, establishing a rigorous link between the architecture and its biological foundations.

Implementation Considerations

Mixed Precision Training

The system supports bfloat16 mixed precision (bf16) for reduced memory consumption. All Hebbian and predictive coding updates operate on .data\texttt{.data} attributes under torch.no_grad()\texttt{torch.no\_grad()}, eliminating the unused gradient graph and saving approximately 3 GiB VRAM.

Custom CUDA Kernels

The preferred embodiment includes fused CUDA kernels for the windowed Hebbian context computation, Hebbian weight update, NMDA parallel scan, silent trace scan, and oscillatory PAC modulation, providing approximately 2–10×\times speedup over pure PyTorch implementations.

Torch Compilation

The architecture is compatible with torch.compile\texttt{torch.compile} (mode=’reduce-overhead’\texttt{mode='reduce-overhead'}), with specific methods decorated with @torch.compiler.disable\texttt{@torch.compiler.disable} where dynamic Python control flow (variable-length lists, ring buffer pointer arithmetic) is incompatible with graph tracing.

Scalability (FIG. P1-28)

The architecture scales from 106M parameters (default preset) through 300M and 1B parameters by proportionally increasing dmodeld_{\text{model}}, NN, and dffd_{\text{ff}} while preserving all biological mechanisms. All components scale with O(dmodel2)O(d_{\text{model}}^2) parameters (same scaling as transformer blocks), with the additional advantage of O(T×w)O(T \times w) rather than O(T2)O(T^2) sequence-length complexity.

7. Claims

We claim:

Claim 1

A computer-implemented neural network system for natural language processing, comprising:

  1. a plurality of NN cortical column processing units arranged in a hierarchical stack from a lowest column to a highest column, wherein each cortical column processing unit comprises:

    1. a Layer 4 thalamic input sublayer configured to receive feedforward input from a thalamic routing system and to project said input into an intra-column processing space via a learned linear projection followed by root mean square normalisation;

    2. a Layer 1 top-down modulation sublayer configured to receive a top-down context signal from a higher column in the hierarchy and to produce a gated modulatory signal via a learned linear projection with a learnable scalar gate parameter;

    3. a pre-association interneuron gating circuit comprising an SST dendritic inhibition unit configured to gate apical dendritic input via tonic inhibition modulated by a VIP disinhibitory unit, wherein said VIP disinhibitory unit is configured to detect novelty in the top-down context signal and to release said SST suppression;

    4. a Layer 2/3 windowed Hebbian association sublayer configured to perform content-addressable recall within a local causal window of ww tokens using a plurality of HH association heads, each comprising a learned association matrix Wassoc{\mathbf{W}_{\text{assoc}}}, a learned distance weighting vector, an anti-Hebbian lateral decorrelation matrix Wlateral{\mathbf{W}_{\text{lateral}}}, and a kk-winner-take-all competitive coding mechanism, wherein said sublayer operates with O(T×w)O(T \times w) time complexity where TT is the sequence length and ww is the window size;

    5. a working memory subsystem comprising at least one of: NMDA attractor slots with persistent activity and learned decay rates, an activity-silent trace mechanism with facilitation and depression dynamics, and a phonological loop with decay, rehearsal, and temporal context tagging;

    6. an oscillatory dynamics module configured to apply nested theta-gamma phase-amplitude coupling with learnable oscillatory periods constrained to positive values via a softplus activation function, and a phase-content interaction computed via low-rank bilinear coupling;

    7. a post-computation interneuron gating circuit comprising a PV/Chandelier output veto unit configured to apply a binary go/no-go gate at the axon initial segment using a straight-through gradient estimator;

    8. a Layer 5 output and prediction sublayer configured to compute a feedforward output via a SwiGLU activation function with dendritic gating, to generate a top-down prediction for the column below via a learned linear projection, and to estimate a per-token prediction precision σ2{\sigma^2} via a softplus activation function producing a strictly positive value; and

    9. a Layer 6 thalamic feedback sublayer configured to generate a corticothalamic feedback signal for modulating the thalamic routing system;

  2. a thalamic routing system comprising a plurality of GG relay groups and a thalamic reticular nucleus configured to compute a per-token relevance gate between pre-relay and post-relay signals, wherein said thalamic reticular nucleus is trained with a bimodality loss r(1−r)r(1{-}r) to encourage binary gating decisions, and wherein said relay groups are further modulated by Layer 6 thalamic feedback signals from the cortical columns;

  3. a lateral column connection system comprising, for each cortical column, a low-rank send projection and a low-rank receive projection configured to exchange messages with immediately adjacent columns in the hierarchy;

  4. a global workspace module configured to receive outputs from all cortical columns, to compute surprise-weighted competition among said columns based on their prediction error magnitudes, and to broadcast a weighted combination of column representations to all columns via per-column read projections; and

  5. a language model head configured to convert the output of the highest cortical column into vocabulary logit scores.

Claim 2

A computer-implemented method for processing natural language input, comprising:

  1. embedding a sequence of input tokens into continuous vector representations and adding a position encoding thereto;

  2. routing said vector representations through a thalamic routing system comprising relay groups gated by a thalamic reticular nucleus with bimodality-encouraging loss;

  3. processing said routed representations sequentially through a hierarchical stack of NN cortical column processing units, wherein each cortical column processing unit applies a six-layer pipeline comprising: a Layer 4 thalamic input projection, a Layer 1 top-down modulation, SST and VIP interneuron gating before lateral association, a Layer 2/3 windowed Hebbian association operating with O(T×w)O(T \times w) time complexity within a local causal window of ww tokens using learned association weights and kk-winner-take-all competitive coding, working memory processing at multiple timescales, oscillatory modulation via nested theta-gamma phase-amplitude coupling, PV/Chandelier output veto after oscillatory processing, a Layer 5 output computation with SwiGLU activation and dendritic gating that generates a top-down prediction and per-token prediction precision estimate, and a Layer 6 thalamic feedback signal;

  4. computing top-down prediction errors between each column’s prediction and the actual input of the column below;

  5. computing lateral signals between adjacent columns via low-rank message passing;

  6. computing a global workspace broadcast via surprise-weighted softmax competition among columns;

  7. computing a metacognitive conflict score from inter-column output variance and allocating additional inference iterations when said conflict exceeds a threshold;

  8. iteratively settling column representations through predictive coding inference iterations under adaptive convergence control until prediction errors converge below a threshold or a maximum number of iterations is reached; and

  9. producing output logits from the highest column output through a language model head.

Claim 3

A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to implement a neural network system for natural language processing, said system comprising a plurality of NN cortical column processing units arranged in a hierarchical stack, a thalamic routing system with a reticular nucleus, a lateral column connection system, and a global workspace module, wherein each cortical column processing unit implements a six-layer pipeline comprising a Layer 4 thalamic input sublayer, a Layer 1 top-down modulation sublayer, pre-association SST and VIP interneuron gating, a Layer 2/3 windowed Hebbian association sublayer operating with O(T×w)O(T \times w) time complexity, a working memory subsystem, an oscillatory dynamics module with nested theta-gamma phase-amplitude coupling, a post-computation PV/Chandelier output veto, a Layer 5 output and prediction sublayer computing per-token prediction precision via softplus activation, and a Layer 6 thalamic feedback sublayer.

Claim 4

The system of Claim 1, wherein all gate parameters in the cortical column processing units are initialised to a value of approximately −2.0-2.0 such that sigmoid⁡(−2.0)≈0.12\operatorname{sigmoid}(-2.0) \approx 0.12, all output weight matrices are initialised to zeros, and residual connections bypass each cortical column processing unit, so that a freshly initialised network produces output approximately equal to its input (identity-at-initialisation principle).

Claim 5

The system of Claim 1, wherein the Layer 2/3 windowed Hebbian association sublayer performs content-addressable recall by computing, for each position tt and each head hh, a direct association at(h)=Wassoc(h)⋅xt(h)\mathbf{a}_t^{(h)} = {\mathbf{W}_{\text{assoc}}}^{(h)} \cdot \mathbf{x}_t^{(h)} where Wassoc(h){\mathbf{W}_{\text{assoc}}}^{(h)} is a per-head association matrix initialised as an identity matrix and updated through Hebbian learning without backpropagation.

Claim 6

The system of Claim 5, wherein the windowed context aggregation computes, for each position tt, a distance-weighted combination of value vectors within the causal window [t−w,t][t-w, t] using learned distance weights Wdist(h)\mathbf{W}_{\text{dist}}^{(h)}, wherein attention-like scores are computed as softplus⁡((xt−xj)⋅Wdist(h))\operatorname{softplus}((\mathbf{x}_t - \mathbf{x}_j) \cdot \mathbf{W}_{\text{dist}}^{(h)}) and normalised by division, rather than through a dot-product query-key mechanism followed by softmax.

Claim 7

The system of Claim 5, wherein the anti-Hebbian lateral decorrelation matrix Wlateral(h){\mathbf{W}_{\text{lateral}}}^{(h)} is applied by subtracting Wlateral(h)⋅r(h){\mathbf{W}_{\text{lateral}}}^{(h)} \cdot \mathbf{r}^{(h)} from the combined association-plus-context representation, and is updated via an anti-Hebbian rule ΔWlateral(h)=η⋅((Y⊤Y)/N−I)\Delta {\mathbf{W}_{\text{lateral}}}^{(h)} = \eta \cdot ((\mathbf{Y}^\top \mathbf{Y}) / N - \mathbf{I}) that drives head outputs toward orthogonality, preventing representational collapse.

Claim 8

The system of Claim 5, wherein the kk-winner-take-all competitive coding mechanism retains only the top k=⌊dh×ρ⌋k = \lfloor d_h \times \rho \rfloor activations in each head (where ρ\rho is a sparsity ratio, preferably 0.15), setting all other activations to zero, thereby enforcing sparse distributed coding analogous to cortical population sparseness.

Claim 9

The system of Claim 1, wherein the VIP disinhibitory unit computes a disinhibition signal vVIP=sigmoid⁡(gVIP)⋅sigmoid⁡(WVIP,out⋅GELU(WVIP,in⋅RMSNorm⁡(ctd)))\mathbf{v}_{\text{VIP}} = \operatorname{sigmoid}(g_{\text{VIP}}) \cdot \operatorname{sigmoid}(\mathbf{W}_{\text{VIP,out}} \cdot \text{GELU}(\mathbf{W}_{\text{VIP,in}} \cdot \operatorname{RMSNorm}(\mathbf{c}_{\text{td}}))) from the top-down context signal, and the SST dendritic inhibition unit computes effective inhibition as seff=sSST⋅(1−vVIP)\mathbf{s}_{\text{eff}} = \mathbf{s}_{\text{SST}} \cdot (1 - \mathbf{v}_{\text{VIP}}), clamped to a maximum of 0.9 to maintain a minimum 10% signal pass-through, and applies said inhibition multiplicatively to the column state before the Layer 2/3 association step.

Claim 10

The system of Claim 1, wherein the PV/Chandelier output veto unit computes a pass probability ppass=sigmoid⁡(WPV,score⋅GELU(WPV,in⋅RMSNorm⁡(h)))p_{\text{pass}} = \operatorname{sigmoid}(\mathbf{W}_{\text{PV,score}} \cdot \text{GELU}(\mathbf{W}_{\text{PV,in}} \cdot \operatorname{RMSNorm}(\mathbf{h}))) with a bias initialised to 5.0 such that ppass≈0.99p_{\text{pass}} \approx 0.99 at initialisation, and applies a hard binary gate in the forward pass with a straight-through gradient estimator in the backward pass, wherein the gate is blended with a bypass via a learnable gate parameter.

Claim 11

The system of Claim 1, wherein the thalamic reticular nucleus computes a per-token relevance gate r=sigmoid⁡((Wq⋅x)⊙(Wk⋅δrelay)/dTRN)r = \operatorname{sigmoid}((\mathbf{W}_q \cdot \mathbf{x}) \odot (\mathbf{W}_k \cdot \boldsymbol{\delta}_{\text{relay}}) / \sqrt{d_{\text{TRN}}}), blended with a bypass via a learnable gate parameter so that at initialisation the effective gate passes substantially all information, and wherein the bimodality loss LTRN=mean(r⋅(1−r))\mathcal{L}_{\text{TRN}} = \text{mean}(r \cdot (1-r)) is minimised during training to encourage binary gating decisions.

Claim 12

The system of Claim 1, wherein the thalamic relay groups are modulated by Layer 6 thalamic feedback signals from the cortical columns, such that the output of each relay group is δrelay+0.1⋅fL6\boldsymbol{\delta}_{\text{relay}} + 0.1 \cdot \mathbf{f}_{\text{L6}}, forming a cortex-thalamus feedback loop.

Claim 13

The system of Claim 1, wherein each lateral column connection comprises a low-rank send projection Wsend∈Rr×dmodel\mathbf{W}_{\text{send}} \in \mathbb{R}^{r \times d_{\text{model}}} and a low-rank receive projection Wrecv∈Rdmodel×r\mathbf{W}_{\text{recv}} \in \mathbb{R}^{d_{\text{model}} \times r} with r=max⁡(dmodel/8,32)r = \max(d_{\text{model}} / 8, 32), and wherein each column receives the average of messages from its immediately adjacent neighbours gated by a per-column learnable gate parameter.

Claim 14

The system of Claim 1, wherein the global workspace module computes surprise for each column as the mean squared prediction error, applies a softmax with a learnable temperature parameter to determine broadcast weights, combines column candidates via said broadcast weights, and distributes the combined broadcast to all columns via per-column read projections gated by a global gate parameter.

Claim 15

The system of Claim 1, wherein the oscillatory dynamics module computes a gamma amplitude modulation at each position tt as:

Aγ(t)=max⁡(0,  1+κ1cos⁡(ϕθ(t))+κ2cos⁡(ϕδ(t))−κ3(1+cos⁡(ϕα(t)))/2)A_\gamma(t) = \max(0,\; 1 + \kappa_1 \cos(\phi_\theta(t)) + \kappa_2 \cos(\phi_\delta(t)) - \kappa_3 (1 + \cos(\phi_\alpha(t)))/2)

where ϕb(t)=2πt/Pb\phi_b(t) = 2\pi t / P_b for oscillatory band bb, periods PbP_b are learnable via softplus⁡\operatorname{softplus} to ensure positivity, and coupling strengths κ1,κ2,κ3\kappa_1, \kappa_2, \kappa_3 are learnable via tanh⁡\tanh to constrain them to [−1,1][-1, 1].

Claim 16

The system of Claim 16, wherein the oscillatory dynamics module further computes a phase-content interaction via a low-rank bilinear coupling: mosc=Wout⋅tanh⁡(Wcontent⋅h+Wphase⋅p)\mathbf{m}_{\text{osc}} = \mathbf{W}_{\text{out}} \cdot \tanh(\mathbf{W}_{\text{content}} \cdot \mathbf{h} + \mathbf{W}_{\text{phase}} \cdot \mathbf{p}), where p\mathbf{p} is a concatenation of sine and cosine of the theta, alpha, and delta phase angles, and the oscillatory modulation is applied as h+sigmoid⁡(gosc)⋅Aγ⋅mosc\mathbf{h} + \operatorname{sigmoid}(g_{\text{osc}}) \cdot A_\gamma \cdot \mathbf{m}_{\text{osc}}.

Claim 17

The system of Claim 1, further comprising a BCM homeostatic plasticity module within each cortical column, said module maintaining a sliding threshold θBCM{\theta_{\text{BCM}}} updated via exponential moving average of mean squared postsynaptic activity, wherein said threshold modulates Hebbian learning such that synapses driving activity above θBCM{\theta_{\text{BCM}}} are potentiated and synapses driving activity below θBCM{\theta_{\text{BCM}}} are depressed.

Claim 18

The system of Claim 1, further comprising a metaplasticity module within each cortical column, said module tracking recent plasticity magnitude via exponential moving average and computing a learning rate multiplier as 1/(1+plasticity_ema)1 / (1 + \text{plasticity\_ema}), such that high recent plasticity yields a lower learning rate and low recent plasticity yields a higher learning rate.

Claim 19

The system of Claim 1, further comprising a structural plasticity mechanism in the Layer 2/3 windowed Hebbian association sublayer, said mechanism maintaining a binary connection mask and a below-threshold counter for each connection in the association matrix, pruning connections that remain below a weight magnitude threshold for a predetermined number of consecutive steps, and growing new connections with small random weights when mean prediction error exceeds a synaptogenesis threshold.

Claim 20

The system of Claim 1, further comprising a metacognitive self-assessment module with zero learnable parameters, configured to compute inter-column conflict as the variance of column output means across the plurality of cortical columns, and to allocate additional predictive coding inference iterations when said conflict exceeds a predetermined threshold.

Claim 21

The system of Claim 1, wherein the Layer 5 output and prediction sublayer comprises a basal dendritic gate modulated by the Layer 4 thalamic input and optionally by the previous column’s prediction precision σ2prev{\sigma^2}_{\text{prev}}, and an apical dendritic gate modulated by the Layer 1 top-down context signal, wherein both dendritic gates are implemented as sigmoid-activated learned linear projections with biases initialised to 3.0 such that sigmoid⁡(3.0)≈0.95\operatorname{sigmoid}(3.0) \approx 0.95 and the gates are nearly open at initialisation.

Claim 22

The system of Claim 1, wherein the per-token prediction precision σ2{\sigma^2} is computed as σ2=softplus⁡(Wσ⋅RMSNorm⁡(h))+ϵ{\sigma^2}= \operatorname{softplus}({\mathbf{W}_{\sigma}}\cdot \operatorname{RMSNorm}(\mathbf{h})) + \epsilon with depth-dependent initialisation such that deeper columns in the hierarchy have higher initial precision values, modelling the developmental gradient of cortical maturation, and wherein said precision is temporally smoothed via an exponential moving average with a depth-dependent time constant.

Claim 23

The method of Claim 2, wherein the predictive coding inference iterations of step (h) are performed without gradient computation, and wherein convergence is determined by monitoring the relative change in total prediction error across all columns, with early termination when said relative change falls below a convergence threshold after a minimum number of iterations.

Claim 24

The system of Claim 1, wherein the Layer 2/3 windowed Hebbian association sublayer supports recurrent settling dynamics by iterating the association computation for nsettlen_{\text{settle}} steps with re-anchoring to the pre-L2/3 input at each step.

Claim 25

The system of Claim 23, wherein the depth-dependent time constant for σ2{\sigma^2} temporal smoothing is computed as αi=1/(1+s⋅i)\alpha_i = 1 / (1 + s \cdot i) where ii is the column index and ss is a configurable scale factor, such that the shallowest column tracks σ2{\sigma^2} instantaneously and the deepest column integrates σ2{\sigma^2} over approximately 16 tokens.

Claim 26

The system of Claim 5, wherein the association matrix Wassoc{\mathbf{W}_{\text{assoc}}} is updated through one of: a basic Hebbian rule computing ΔWassoc=η⋅(X⊤X)/N\Delta {\mathbf{W}_{\text{assoc}}}= \eta \cdot (\mathbf{X}^\top \mathbf{X}) / N, a BCM-modulated Hebbian rule computing ΔWassoc∝y(y−θBCM)⋅x⊤\Delta {\mathbf{W}_{\text{assoc}}}\propto \mathbf{y}(\mathbf{y} - \sqrt{{\theta_{\text{BCM}}}}) \cdot \mathbf{x}^\top, or an error-modulated BCM Hebbian rule that further modulates said update by prediction error magnitude with a configurable blend weight λ\lambda.

Claim 27

The system of Claim 1, wherein the system is designed according to a disease-mapping validation methodology in which each architectural component models a specific brain mechanism, and removal of said component produces a specific, predictable failure mode corresponding to a known neurological or psychiatric disease, wherein said correspondence serves as a systematic design and validation tool for the architecture.

Claim 28

The system of Claim 1, wherein the system is configurable at a plurality of parameter scales by proportionally adjusting the model dimension dmodeld_{\text{model}}, the number of columns NN, and the feedforward dimension dffd_{\text{ff}} while preserving all biological mechanisms, including configurations of approximately 106 million parameters, 300 million parameters, and 1 billion parameters.

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.