← all repositories
wyg5208/nct

A Transformer that claims to be conscious, and shows its math

NCT rebuilds Global Workspace Theory, predictive coding, and IIT as Transformer modules — and reports a Φ value like it's a benchmark score.

★508 stars Python Other AI
Collecting fresh signals — velocity needs a few days of history.
star history

What it does

NeuroConscious Transformer (NCT) is a Python/PyTorch research architecture that maps three big theories of consciousness onto Transformer machinery: Global Workspace Theory becomes multi-head attention over competing candidates, Friston’s free energy is equated with the decoder’s training loss, and IIT’s integrated information (Φ) is approximated from attention flow instead of the usual NP-hard partition search. It ships as a package with core modules, experiment scripts, a Streamlit dashboard for watching Φ and attention weights in real time, and an arXiv paper draft.

The interesting bit

The Φ approximation is the clever move: rather than exhaustively searching partitions (O(2^n)), it computes mutual information over the attention matrix and takes the gap above the minimum partition, getting to O(n²). The “free energy ≈ cross-entropy + KL ≈ Transformer loss” unification is either a genuine insight or a very tidy pun on regularization — the README presents it as a proof, and it’s at least formally coherent.

Key highlights

  • Attention-based global workspace with claimed head specialization (salience, emotion, task relevance, novelty) — selection accuracy reported at 92%, up from 75% in v2.2.
  • Hybrid learning rule combining local STDP with attention gradients, gated by simulated dopamine/serotonin/norepinephrine/acetylcholine modulation; convergence reported 5× faster.
  • Real-time Φ computation from attention maps, reported at 0.329 for d=768.
  • Two extensions: MCS reframes consciousness as multi-constraint optimization, and CATS-NCT (under active development) targets concept-level rather than perceptual consciousness.
  • Education-domain research found Φ only becomes a significant cognitive-state marker (p=0.0003) when computed from EEGNet features rather than spectral features — an honest, useful negative-then-positive result.

Caveats

  • All benchmarks are self-reported in the README; the “Paper Section 7” and experiments/results/ JSONs are referenced but not verifiable from here.
  • “Consciousness selection accuracy” and Φ values are metrics of the model’s internal dynamics, not evidence of anything conscious — the README is careful-ish, but the framing invites over-reading.
  • The MCS education result (R²=0.164) is modest even with the claimed 121% improvement; papers are described as submitted, not published.

Verdict

Worth a look if you’re curious about consciousness theories as engineering constraints — the Φ-from-attention trick and the free-energy/loss equivalence are genuinely fun ideas. Skip it if you want a production model; this is a research playground with ambitious typography.

Frequently asked

What is wyg5208/nct?
NCT rebuilds Global Workspace Theory, predictive coding, and IIT as Transformer modules — and reports a Φ value like it's a benchmark score.
Is nct open source?
Yes — wyg5208/nct is open source, released under the MIT license.
What language is nct written in?
wyg5208/nct is primarily written in Python.
How popular is nct?
wyg5208/nct has 508 stars on GitHub.
Where can I find nct?
wyg5208/nct is on GitHub at https://github.com/wyg5208/nct.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.