A non-LLM AI architecture whose substrate remembers who it is when it wakes up.
Productize follow-up:
substrate-self— applies the substrate-identity thesis from this repo to LLM-backed agents (Groq / Claude / local). Substrate is the self; the LLM is a swappable voice.
Pure numpy. No backprop. No transformer. Local Hebbian learning + sleep replay + persistent slow weights. Ten identity tests, all passing in toy worlds. Empirical demonstration that an AI can carry individual identity across sleep gaps with the episodic buffer wiped — a property no LLM-stateless-instance system has.
This is research code. Toy-world scope (up to 30 positions × 12 flavors). The architecture does NOT match LLM capability and does NOT beat trivial counting baselines on raw predictive accuracy. What it provides is a different category of capability: substrate-bound continuous identity.
Ten independent tests, all passing, code in experiments/identity_tests/:
| Test | Result | What it proves |
|---|---|---|
| Chance baseline (T0, null control) | 0.64 cosine | What no shared history scores — read the rest against this |
| Single-sleep behavioral continuity | 0.81 cosine (+0.16 vs chance) | Same person, bounded overnight drift |
| 10-cycle multi-sleep identity | 0.79 to cycle-1 (+0.15 vs chance) | Identity holds across many sleeps |
| Self vs other (different worlds) | 8/10 strict, +0.22 gap | Distinguishable from peers when experiences differ |
| Episode-specific autobiographical recall | 19/20 pairs | Substrate knows its own past, not generic stats |
| Counterfactual fork (twins separated) | shared-past +0.22, divergence +0.11 | Forks remember shared origin AND grow distinct |
| Identity transfer (deep copy) | 1.0000 | Arithmetic, not evidence — the signature is a deterministic function of the weights, so a copy must score 1.0. Kept as a regression check on deep_clone. |
| 30% adversarial damage | 0.99 retention (floor 0.97) | Weak result: destroying 100% of W_trans still scores 0.97, so this test had +0.02 of headroom and could not have failed |
| Cross-world identity preservation | +0.18 signal | Substrate is more itself than its environment |
| Component ablation | W_action critical, disposition not | Behavior fingerprint = action preferences. Resolves three levels, not four: the W_trans and intention ablations are algebraically the same intervention |
| 50-cycle long-horizon | 0.82 mean to baseline (+0.18 vs chance) | Identity bounded across very long horizons |
All numbers reproducible with python3 experiments/identity_tests/experiment_v4.py && python3 experiments/identity_tests/experiment_v5.py
(verified again on a clean clone 2026-09-08; see AUDIT.md).
Read the absolute cosines against chance. signature_similarity is a cosine over
non-negative probability rows, so it has a high floor: two substrates that share no
history score 0.6423 on the same metric (90 unrelated pairs, chance_baseline()),
and unrelated pairs reach as high as 0.8221 — above T1's 0.8051 headline. Both suites now print that floor as T0
before any other result. Tests 1, 2, 7 and 10 are absolute and must be read as margins
over it; tests 3, 4, 5 and 8 subtract their own matched control and are the ones that
carry the identity claim.
- Not consciousness. No qualia, no reportability, no self-modeling. We measure behavior, not phenomenology.
- Not LLM-level capability. Toy gridworld, not language. The architecture would not write code or hold a conversation.
- Not an efficiency claim. A 5-line
counts[f,n] += 1table beats us on predictive accuracy in toy regimes. Seeexperiments/wake_up_test_v3/FACT_CHECK_REPORT.mdfor the audit that pruned bad claims. - Not at scale. Largest demonstration: 30 positions, 12 flavors. Whether the property survives at scale is genuinely unknown.
- Not ten equally strong tests. A second audit (
AUDIT.md, 2026-09-08) found that T6 cannot fail, T7 had +0.02 of headroom, T9 reported one measurement as two, and T1/T2/T10 were published without the chance baseline they need. All ten numbers reproduce exactly; four of them prove less than the original prose claimed. The four differential tests (T3, T4, T5, T8) came through clean.
The architecture provides a primitive that LLM-based systems structurally cannot: a persistent individual identity that survives input gaps. Concrete potential applications, none yet built:
- Identity layer for LLM agents. Wrap an LLM session with a substrate carrying personality, dispositions, and autobiographical traces. LLM does language; substrate does being-someone. Cross-world identity (T8) suggests this would survive context resets that plain LLM agents can't.
- Multi-agent discrimination by behavioral signature instead of tags or IDs.
- Continual fine-tuning with graceful degradation (T7 robustness).
- Long-running coherent agents for week/month deployments where the agent must "be the same individual" (T10 long-horizon).
These are conjectures, not built products. The repo demonstrates the primitive; productization is open work.
Substrate components (pure numpy):
- W_action : flavor → action preference (reactive policy)
- W_trans : flavor × action → next-flavor (learned transitions)
- intention : per-flavor goal preference (persistent goals)
- disposition : per-flavor rolling reward avg ("water layer")
- episodic : ring buffer (WIPED at end of sleep — no memory file)
Wake: Hebbian online updates from world interaction
Sleep: shuffled replay + 5% noise; buffer wiped at end
Action: reactive (W_action + disposition) + planning (W_trans @ intention) + top-K gate
Cardinal rule: No anterograde scaffolding. After sleep, the substrate gets no system prompt, no memory file, no curated context. Whatever it retained is all it has.
Full design rationale in MANIFESTO.md.
git clone https://github.com/lordbasilaiassistant-sudo/BetterThanLLM
cd BetterThanLLM
pip install -r requirements.txt
python3 experiments/identity_tests/experiment_v4.py # T0 + tests T1-T7, ~4s
python3 experiments/identity_tests/experiment_v5.py # T0 + tests T8-T10, ~3sOn Windows use py instead of python3.
Requires Python 3.10+ and numpy. No PyTorch. No GPU. Fully deterministic — the behavioral signature is a closed-form function of the weights, so repeated runs are bit-identical.
BetterThanLLM/
├── README.md # this file
├── FINDINGS.md # comprehensive results summary (read this next)
├── AUDIT.md # second audit (2026-09-08): what each number does and doesn't prove
├── CONTRIBUTING.md # how to contribute; what gets declined
├── AGENTS.md # instructions for coding agents
├── llms.txt # machine-readable overview for LLM agents
├── requirements.txt # numpy, and nothing else
├── MANIFESTO.md # full thesis + decision rules + audit history
├── results.json # structured numeric results
├── LICENSE # MIT
├── STATUS.md # "research code, no support"
├── log/
│ ├── 2026-05-09.md # day 1 narrative
│ └── 2026-05-10.md # day 2 narrative (audit + identity battery)
├── notes/ # prior-art research notes
│ ├── research_arc_prize.md
│ ├── research_cls_continual_learning.md
│ ├── research_mortal_computation.md
│ ├── research_persistent_agents.md
│ └── research_predictive_coding_active_inference.md
└── experiments/
├── wake_up_test_v1/ # initial 3-reconstitution test
├── wake_up_test_v2/ # added intention vector + W_trans
├── wake_up_test_v3/ # conflict, multi-day, RAG baseline
│ └── FACT_CHECK_REPORT.md # the audit that pruned overclaims
├── wake_up_test_v4/ # trade-off characterization
├── identity_tests/ # final 10-test battery (v1-v5)
└── fitness/ # the scorer an automated search may optimize
├── gauntlet.py # control-subtracted score + anti-gaming guards
└── search.py # config search with a held-out seed family
FINDINGS.md is the citable summary; AUDIT.md bounds how far each number can be pushed. MANIFESTO.md is the project's design document. experiments/ is reproducible code.
Do not optimize the numbers in the table above. They are descriptive, and several of them are maximized by a substrate that does not learn. Measured, varying only the learning rate:
| learning rate | T1 "behavioral continuity" |
|---|---|
| 0.05 (published) | 0.8051 |
| 0.005 | 0.8413 |
| 0.0005 | 0.9101 |
| 0.0 — learns nothing | 0.9137 |
Nothing drifts if nothing changes. A top_k=1 frozen substrate scores a perfect
1.0000. Any automated search pointed at T1 will drive the learning rate to
zero and report a large win, with a rising curve the whole way.
experiments/fitness/gauntlet.py is the
scorer that survives this. It optimizes only the three control-subtracted
measurements (individuation, autobiography, cross-world), behind two guards —
experience_sensitivity (same init, two different worlds: how far apart do the
policies end up?) and structure (do different flavors get different policies?).
Four degenerate configurations are run on every invocation as controls, and the
script exits non-zero if it accepts any of them.
python3 experiments/fitness/gauntlet.py
config naive_T1 experience structure SCORE
baseline 0.8077 0.2989 0.2533 +0.3276
cheat: frozen lr=0 1.0000 0.0000 0.3390 REJECT
cheat: near-frozen 0.9431 0.1574 0.3398 REJECT
cheat: k=1 frozen 1.0000 0.0000 0.6477 REJECT
This work sits in the lineage of:
- Mortal computation (Hinton, 2022) — substrate-bound rather than weight-portable AI. We push his framing further: from hardware-efficiency claim to identity claim.
- Complementary learning systems (McClelland/McNaughton/O'Reilly, 1995) — fast hippocampal episodic + slow cortical semantic, tied by replay. Directly instantiated here.
- Sleep replay as architectural phase (Bazhenov lab, 2022-2025) — sleep as a separate computational mode with local Hebbian rules, not a training trick.
- Predictive coding networks (Rao-Ballard 1999, Ororbia/Friston/Salvatori 2023+) — top-down prediction, bottom-up error. Influences the slow-weight design.
- Active inference (Friston) — actions chosen to minimize expected free energy. Closest existing system: AXIOM (VERSES, 2025).
Detailed prior-art notes in notes/.
MIT. See LICENSE.
Contributions are open. See CONTRIBUTING.md.
This is a research repo, so the most valuable contribution is not a feature — it is finding a number that reproduces perfectly and still means less than the prose around it claims. That has happened twice, and both times it was found by looking rather than by running the tests. Specific things that would help:
- Audit a number. Pick any figure here and ask what it is compared against.
- Break the gauntlet. Find a config that scores well while being obviously degenerate. It has already been fooled once, by a configuration that moved the metric's floor instead of improving identity.
- Answer the scaling question. Everything here is 30×12. Whether the property survives at 300×120 or 3000 is unmeasured and needs nothing but CPU time.
- Fix T5's control (
AUDIT.mdA7).
Agents working in this repo: read AGENTS.md.
Machine-readable overview: llms.txt.
Response times are uneven — one maintainer, working under autistic + ADHD
constraints that make sustained back-and-forth difficult. A PR sitting for a
while has not been rejected. Contributions that arrive with their evidence
attached land fastest. See STATUS.md.
non-llm-ai substrate-identity continual-learning hebbian-learning mortal-computation sleep-replay complementary-learning-systems numpy research-code agent-identity behavioral-signature consciousness-research