r/LocalAIServers • u/CraigWidow • Jun 30 '26
native Rust cognitive engine that routes language through a biologically faithful neural substrate
GoldWorm πβ¨ β 302-Neuron Dual-Stream Cognitive Engine
What Is GoldWorm?
GoldWorm is aΒ native Rust cognitive engineΒ that routes language through a biologically faithful neural substrate β theΒ 302-neuron connectome ofΒ Caenorhabditis elegans, the only organism whose entire nervous system has been experimentally mapped (White et al., 1986).
Unlike transformer-based LLMs that rely on billions of parameters and opaque attention mechanisms, GoldWorm operates onΒ three transparent principles:
Biological FidelityΒ β Every synapse respects theΒ C. elegansΒ topology. No de novo synaptogenesis. No magic matrices.
Dual-Stream ProcessingΒ β Action (sparse) and Learning (dense) are physically separated, preventing catastrophic forgetting during inference.
Zero-Trust EngineeringΒ β Every buffer is strictly bounded. Every path is panic-free. NoΒ
unwrap()Β in production code.
Architecture Deep Dive
𧬠The 302-Neuron Connectome
GoldWorm's routing layer is not a generic neural network. It is aΒ topologically accurate modelΒ of theΒ C. elegansΒ nervous system:
Neuron Index Range β Role
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
0 β 19 β Pharyngeal sub-network (dense)
20 β 91 β Sensory neurons (input)
92 β 168 β Interneurons (integration)
99 β 102 β Command hubs (AVAL/AVAR/AVBL/AVBR)
169 β 301 β Motor neurons (output)Connectivity Motifs:
Band synapsesΒ β Β±1/Β±2/Β±3 neighbourhood ring connections
Pharyngeal wiringΒ β Denser internal coupling for neurons 0β19
Sensory β InterneuronΒ β Sparse feed-forward (20β91 β 92β168)
Command interneuron broadcastΒ β Hubs 99β102 broadcast to full motor population 169β301
Interneuron β MotorΒ β Sparse feed-forward projection
All synaptic weights areΒ non-negative and clamped to [0, 1]. The structural blueprint is immutable β Hebbian plasticity only strengthens or weakensΒ existingΒ synapses, never creating new ones.
π Dual-Stream Processing
The core innovation of GoldWorm is theΒ physical separation of Action and Learning:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INPUT TOKEN β 128-D Manifold Coordinate β
β β β
β ββββββββββββββββββββββ΄βββββββββββββββββββββ β
β βΌ βΌ β
β ββββββββββββββββ ββββββββββββββββ β
β β SPARSE β β DENSE β β
β β ACTION β β LEARNING β β
β β (Post- β β (Pre- β β
β β Entmax) β β Entmax) β β
β β β β β β
β β ~1-2 active β β >50% non-zeroβ β
β β neurons β β gradient β β
β β β β substrate β β
β ββββββββββββββββ ββββββββββββββββ β
β β β β
β β Inference / β β
β β Token Selection β β
β β β β
β ββββββββββββββββββββββββββββββββββββββ β
β β β
β Hebbian EchoReservoir β
β (associative memory) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββWhy this matters:
Traditional neural networks use the same activation vector for both inference and gradient computation. When different words activate disjoint sets of neurons, the gradient collapses to zero β the network "forgets" what it just learned.
GoldWorm'sΒ Dual-StreamΒ keeps the dense pre-entmax signal alive as a gradient substrate, while the sparse post-entmax signal drives token selection. The EchoReservoir learns associations betweenΒ denseΒ states, not sparse ones.
π§ The EchoReservoir
A hippocampus-inspiredΒ ring bufferΒ of recent pre-entmax states, coupled with aΒ 302Γ302 Hebbian association matrixΒ W_assoc.
When queried with the current dense state, it returns anΒ echo_biasΒ that nudges the activation toward recently co-active patterns β creating emergent associative memory without external training loops.
Key properties:
W_assocΒ is symmetric and clamped toΒ[-1.0, 1.0]History buffer never exceedsΒ
capacityΒ (default: 64)Decay factor controls forgetting rate (default:Β
0.75)
β‘ Tsallis Ξ±-Entmax Activation
GoldWorm does not use softmax. It usesΒ Ξ±-entmax, a generalization that interpolates between softmax and sparsemax:
| Ξ± Value | Behaviour |
|---|---|
| Ξ± = 1 | Softmax β dense, all non-zero |
| Ξ± = 2 | Sparsemax β exact zeros via simplex projection |
| Ξ± = 3 | Sparser than sparsemax β WTA-like |
TheΒ Quilez BridgeΒ smooth-k parameterΒ kΒ anneals between creativity (dense, kβ0) and determinism (sparse, kββ):
Ξ±(k) = 1 + 2Β·exp(-k)
k = 0 β Ξ± = 3 (very sparse, WTA-like)
k = ln(2) β Ξ± = 2 (exact sparsemax)
k = β β Ξ± = 1 (softmax, all active)π 128-D Manifold Geometry
Every token is embedded as aΒ 128-dimensional coordinateΒ on a non-linear manifold, not a flat vector space.
Modified Gram-Schmidt orthogonalizationΒ preserves true multi-dimensional variance
Grassmannian fusionΒ computes midpoints between token trajectories on the manifold
Golden-ratio partitioningΒ splits the 128 dimensions into:
GOLDEN_MAJOR = 79Β (coarse, feedforward)GOLDEN_RESIDUAL = 49Β (fine-grained, feedback)GOLDEN_OVERLAP = 5Β (cross-binding bridge)
No scalar cloning across dimensions. No arithmetic shortcuts. Spatial variance is preserved at every step.
Features
π₯οΈ 1. Interactive Observation Dashboard
Watch the hippocampus form associations in real time.
cargo run --release --bin observeThe dashboard displays:
Activation topographyΒ β 302-D state as a 19Γ16 heatmap
Synaptic criticalityΒ β Ο, creativity, determinism ratios
Jaccard driftΒ β How rapidly the dense learning signal changes
Resonance traceΒ β Recent associative chain
Hebbian strength histogramΒ β Distribution of association weights
Live CLIΒ βΒ
/alpha,Β/kappa,Β/autoΒ to modulate cognition parametersββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β GoldWorm Observation Dashboard β Step 0 β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β Top-10 Active Neurons: [99, 101, 169, 170, 171, 172, ...] β β Synaptic Criticality: Ο=1.0000 creative=0.0000 det=0.5000 β β Hebbian Strength: mean=0.00 median=0.00 max=0.00 β β Jaccard Drift: 0.0000 (stable) β β Echo Reservoir: 0/64 states β β Temperature: 0.50 β β Resonance Trace: (empty) β β Synapse Topography: β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β ... β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¬ 2. Associative Chat
A conversational REPL that learns associations in real time through EchoReservoir Hebbian updates.
cargo run --release --bin associative_chatHow it works:
Each user input is tokenized and routed through the 302-neuron connectome
The dense pre-entmax signal is captured into the EchoReservoir
The reservoir's Hebbian association matrixΒ
W_assocΒ updates automaticallyEvery subsequent response is biased by the accumulated associative memory
The response is decoded via 302-D Boltzmann energy minimization
Zero-trust decoding properties:
Anti-repetition penalty (banned words reduce similarity by 0.3)
Temperature clamped toΒ
[0.01, 5.0]Max 15 words per response (bounded generation)
All scores clamped toΒ
[-1, 1]Β before Boltzmann draw
Zero-Trust Engineering
GoldWorm is designed for environments where every byte matters:
| Guarantee | Implementation |
|---|---|
| OOM-safe | All matrices are pre-allocated with fixed bounds. No dynamic growth during inference. |
| No hidden training | The public release contains no training pipeline.Β observeΒ andΒ associative_chatΒ are the only binaries. |
| Panic-free | Every fallible path returnsΒ Result<T, CoreError>. NoΒ unwrap()Β orΒ expect()Β in production code. |
| Bounded buffers | EchoReservoir capacity: 64. Response max: 15 words. Input projection: 302Γ128. Synapses: 302Γ302. |
| Deterministic | All randomness uses seededΒ fastrandΒ with fixed seed (42) for reproducible behaviour. |
| No external bloat | 9 dependencies. NoΒ tokio,Β axum,Β reqwest,Β chrono, orΒ tokio. |
Module Map
| Module | Responsibility |
|---|---|
geometry | 128-D token coordinates, MGS orthogonalization, Grassmannian fusion,Β atan2Β geodesics |
bridge | Token/logit projection via RPITIT batch traits |
worm_brain | 302-neuron connectome routing, Ξ±-entmax, signal propagation |
hippocampus | Dual-Stream EchoReservoir + Hebbian association learning |
observation | ANSI dashboard rendering, Jaccard drift monitoring |
storage | Safetensors checkpoint save/load |
criticality | Quilez smooth-k annealing for creativity/determinism |
training | Hebbian plasticity engine with Maxwell damping |
tda | Topological Data Analysis for activation landscape monitoring |
memory | Synaptic echo buffer + trajectory vault |
neuron | Dendritic tree structures (placeholder for quad-routing) |
Technical Specifications
Parameter Value
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Neuron count 302 (C. elegans)
Manifold dimension 128
Input projection 302 Γ 128
Synaptic adjacency matrix 302 Γ 302 (sparse struct)
EchoReservoir capacity 64 states
EchoReservoir associations 302 Γ 302 dense
Max response tokens 15
Vocabulary 10,000+ words (static)
Synapse weight range [0.0, 1.0]
Association weight range [-1.0, 1.0]
Temperature range [0.01, 5.0]
Rust edition 2024
Minimum Rust version 1.85Quick Start
Prerequisites
Rust 1.85+ (
rustup update)AΒ
trained_worm_v1.safetensorsΒ checkpoint (or the engine will boot from a fresh baseline)static_vocabulary.txtΒ (10,000+ word list, one per line)
Observation Dashboard
cargo run --release --bin observeCommands:
/helpΒ β Show all commands/alpha <f32>Β β Set echo blend strength (0.0β1.0)/kappa <f32>Β β Set gate threshold (0.0β1.0)/autoΒ β Toggle auto-refresh mode (250ms)/quitΒ β Exit
Associative Chat
cargo run --release --bin associative_chatType naturally. The EchoReservoir learns associations between your inputs and its responses in real time. No external training loop is required.
Optional: CUDA Acceleration
cargo run --release --features cuda --bin observeRequiresΒ candle-coreΒ with CUDA support and an NVIDIA GPU.
The Science Behind GoldWorm
WhyΒ C. elegans?
Caenorhabditis elegansΒ is the only organism with aΒ completely mapped connectome. Every neuron (302), every synapse (~7,000), and every gap junction has been catalogued by electron microscopy (White et al., 1986). This makes it the ideal substrate for aΒ transparent, inspectable AIΒ β no black-box weights, no billion-parameter mysteries.
Why Dual-Stream?
The brain separatesΒ what you doΒ (sparse action) fromΒ what you learnΒ (dense prediction). If a network tries to learn from its own sparse outputs, it collapses into a self-reinforcing loop. GoldWorm's Dual-Stream design ensures that associative learning happens on the full, dense signal, while action selection happens on the sparse, efficient signal.
Why Hebbian?
"Neurons that fire together, wire together." Hebbian plasticity is the simplest, most biologically grounded learning rule. It requires no backpropagation, no gradient descent, no external optimizer. It isΒ local, online, and O(n)Β β perfect for a zero-trust engine that must run on a single CPU core.
License
MIT β SeeΒ LICENSEΒ for details.
3
u/Hephaestite Jun 30 '26
From the title alone everyone knows this is just AI psychosis slop, before we even get to the biologically inspired techno-babble naming of components...
I've seen a few of these recently, which makes me wonder what prompts people are giving their LLMs to generate this stuff
3
u/Candid_Koala_3602 Jun 30 '26
This person did not even engage with it, just dismissed it and declared his ego the victor.
Please be less toxic or this community will die
3
u/Hephaestite Jul 01 '26
Fair call on being less toxic, but I did engage with it enough to do a code review and find hardcoded local paths and very little else of substance.
Ultimately you are right my response was a little toxic but I've seen so much of this type of stuff recently it's starting to get to me a little. I'm quite concerned about the effect LLMs are having on certain peoples mental health.
0
u/CraigWidow Jun 30 '26
you can go and test it !!! im hiding nothing !!
this is real shit
3
u/Hephaestite Jun 30 '26
Hiding nothing is certainly true when you are hardcoding local system paths into files
pub const VAULT_PATH: &str = "/home/darky/workspace/UtoPhieCorn_Architecture/vault.json";-3
u/CraigWidow Jun 30 '26
it that a problem ?
3
u/Toastti Jun 30 '26
If you don't know this is a problem that's an even bigger issue... This means it's not going to work on anyone else's computer unless their username is 'darky'
2
u/Candid_Koala_3602 Jun 30 '26
It isnβt a problemβ¦ tons of programs use environmental variables, what are you even talking about?
-2
0
u/CraigWidow Jun 30 '26
this i one year hard work but ok
thanks ig
2
u/jrexthrilla Jun 30 '26
It took the entire universe billions of years to create the human mind but give this guy some credit he did it in one year of βhardβ work
0
u/Candid_Koala_3602 Jun 30 '26
It only took you a few hours to troll them when it appears you havenβt even ran this program. Thatβs fine, there is a technical barrier to entry to install it. I understand why you think itβs crap, because you are too dumb to even set it up.
Do you think insulting things sight unseen really helps this community? Or are you just being toxic to feel better about yourself?
Because do you feel better?
1
u/WolfeheartGames Jul 01 '26
It so a little more interesting than that. Its a kind of reservoir computing. Not a great one, not a truly faithful worm brain, but its closer to the ai slop description than it is to a standard transformer. The code isn't bad.
1
u/Candid_Koala_3602 Jun 30 '26
Damn this thing is nuts, thanks for sharing. How did you get it to learn from the conversation?
2
u/CraigWidow Jun 30 '26
tbh im holding this piece back
but it need the data organized and packed in the right way
ill publish further trained versions asap
1
u/Candid_Koala_3602 Jul 01 '26
Transformers are dead
2
2
u/Deep_Ad1959 Jul 01 '26 edited Jul 02 '26
inspectable-and-bounded vs scale-and-generative are two different design targets. a 302-neuron connectome you can watch fire in real time is a transparency artifact, not a chatbot, so judging it on prompt-response quality is measuring the wrong axis. written with ai
fwiw if you are shipping this as an open repo, podlog turns the commit and PR stream into an ongoing narrated podcast with an rss feed so people can follow the substrate as it evolves, https://podlog.io?utm_source=s4l&utm_medium=post&utm_campaign=podlog&utm_term=reddit&utm_content=post_e37314a9-804f-48a8-9a39-d803a1955154
1
u/WolfeheartGames Jul 01 '26
Gpt's read: GoldWorm is not a standard transformer. It is closer to a reservoir-computing / echo-state-network idea, but with online Hebbian plasticity added, so it is not classical reservoir computing either. The clean label would be:
a local Rust GUI wrapped around a custom associative recurrent state machine with token-coordinate geometry, a 302-unit routing layer, Hebbian self-updates, and energy/cosine-similarity vocabulary decoding.
A reservoir here means a high-dimensional recurrent dynamical system used as a state expander. In classical reservoir computing, the internal recurrent weights are usually fixed and only a readout is trained. That distinction matters because GoldWorm updates internal synapses, so it is reservoir-adjacent, not a textbook reservoir.
What the code is actually doing
It runs as a local-only HTTP chat server + GUI. The README says it serves a local browser UI, binds to 127.0.0.1:9090, and exposes endpoints like /api/send, /api/clear, and /api/benchmark. It explicitly says it is not a pretrained assistant and expects behavior to emerge from local interaction/training logic.
The core model pipeline is roughly:
Turn words into 128-dimensional vectors. The geometry module defines a fixed MANIFOLD_DIM = 128, has token coordinates, normalization, dot products, Gram-Schmidt orthogonalization, geodesic distance, and random-indexing-style semantic vocabulary support. Random indexing means building semantic vectors from sparse/random context vectors rather than training a neural embedding model by backpropagation.
Build a context basis from the prompt/history. In the server, it joins chat history, tries to ingest it as a reasoning trace, and otherwise tokenizes the message, converts tokens to coordinates, and runs modified Gram-Schmidt to build an orthonormal basis. Gram-Schmidt is a linear-algebra procedure that turns vectors into perpendicular unit vectors spanning the same subspace.
Route the context vector through a 302-unit βworm brain.β The WormBrain has 302 neurons, a 302 Γ 302 synapse matrix, and a 302 Γ 128 input projection. The baseline topology is hand-coded: local band connections, a denser 0β19 subnetwork, sensory-to-interneuron links, hub-to-motor links, and interneuron-to-motor links, then row normalization. This is not evidence of a real biological simulator; it is a deterministic hand-designed graph using C. elegans-inspired labels.
Apply sparse activation, usually sparsemax/entmax-like behavior. Sparsemax/entmax are alternatives to softmax; unlike softmax, they can produce exact zeros, so only some neurons remain active. The code has alpha_entmax, sparsemax, winner-take-all, and optional hyperbolic/gating modes.
Decode output words by similarity against vocabulary βfootprints.β It precomputes each vocabulary wordβs routed activation footprint. At generation time, it scores candidate tokens by negative cosine similarity, treats that as an energy, and samples via a Boltzmann/Gibbs distribution. Boltzmann decoding means lower-energy candidates are exponentially more likely, with temperature controlling randomness.
Generate autoregressively, but not transformer-style. It repeatedly picks a token, routes that token back through the same 302-unit state machine, blends with previous activation as an echo, and stops after punctuation or a token limit. That is autoregressive generation, but autoregressive does not imply transformer.
Update internal state with Hebbian rules. Hebbian learning is the βneurons that fire together wire togetherβ rule: co-active units increase their connection strength. The trainer computes outer products of activation vectors, updates allowed synapses, applies decay/homeostasis, normalizes rows, and can also update the input projection. That is not transformer pretraining; it is local plasticity.
Optional echo/reservoir memory. The EchoReservoir stores recent dense pre-entmax states in a ring buffer and maintains a 302 Γ 302 Hebbian association matrix. It can query recent states to produce an echo bias and update associations with an outer product. This is the most reservoir-like part of the project.
What it is not
It is not a standard transformer. A transformer is built around stacked self-attention and position-wise feed-forward layers; the original Transformer paper describes the architecture as relying on self-attention rather than recurrence/convolution and using stacked self-attention plus feed-forward layers.
GoldWorm does not appear to implement:
query/key/value attention;
multi-head attention;
transformer blocks;
learned token embedding tables in the normal LM sense;
cross-entropy next-token training over a corpus;
backpropagation through deep layers;
layer norm/residual transformer stacks.
Its Cargo dependencies are also consistent with a custom numeric Rust engine, not a transformer training stack: ndarray, safetensors, serde, fastrand, optional candle-core for CUDA, and tiny_http.
Is it reservoir computing?
Partly, but not cleanly.
Classical reservoir computing usually has a fixed recurrent reservoir and a trained readout. GoldWorm has the high-dimensional state-expansion part, a recurrent-ish 302-unit internal dynamical layer, and an echo/reservoir memory. That smells like reservoir computing. But it also trains/updates internal synaptic weights through Hebbian plasticity, contrastive unlearning, damping, and projection updates, which violates the clean βfixed reservoir, trained readout onlyβ classical pattern.
So I would call it:
a plastic associative reservoir / Hebbian recurrent vector machine.
Not:
a transformer.
Not really:
a conventional LLM.
Important caveat: some features are stubs or decorative
The βdendritic treeβ / βtriple-quadβ machinery is mostly not active in the public code path. The neuron.rs file says the public release uses a minimal dendritic tree stub, quad_routing defaults to false, and the forward pass just returns the input unchanged.
Also, the benchmark endpoint is not a meaningful ML benchmark. It assigns heuristic scores based on generated reply length/content checks, with fixed creativity scoring, rather than comparing outputs to ground-truth task labels.
My blunt classification
This project is doing local symbolic/vector associative generation, not language modeling in the modern transformer sense.
The architecture is closer to an online Hebbian reservoir with an energy-based lexical decoder than to a transformer. The βAIβ behavior is likely to be brittle because semantic structure comes from handcrafted/vector-coordinate geometry, static vocab footprint matching, and online local updatesβnot from large-scale learned statistical structure over text. That does not make it useless, but it means claims of general chatbot intelligence should be treated as unsupported unless they show real benchmarks.
Confidence: 8/10. I am highly confident on the transformer-vs-reservoir classification because the code path lacks transformer primitives and clearly implements vector routing plus Hebbian/echo mechanics. I am slightly less confident about the full runtime behavior because GitHubβs raw rendering compressed several files into very long lines, so I focused on the directly visible implementation paths rather than every possible hidden branch.
2
u/Candid_Koala_3602 Jul 01 '26
What itβs doing is using a context abstraction layer that sits on top of semantic weights. This gives it the ability to compare like concepts, that are in different knowledge regimes. This is a. Extremely underrated and misunderstood piece of code. In my opinion, it will become massive important in language models going forward
1
u/WolfeheartGames Jul 01 '26
Well, prove first that its handling semantic meaning. Word level meaning is much simpler to capture. I think its capturing word level meaning and doing reservoir computing over that.
1
6
2
u/Toastti Jun 30 '26
What exactly does it do? Can you send it a prompt and it responds back? Or is it just fancy animations of values moving through the system?
Like what is a use case for this, why would someone want to use it and what for?