← all documents · raw markdown · 10 KB

KAI — The Layer Stack: every stage, its knobs, its status, what to adjust

*The signal path as an ordered stack you can engineer layer by layer. Each layer lists: what it

computes, the EXACT knob (file · constant/env · current value), its wiring status, and the

concrete adjust/fix. Unlike an LLM you don't backprop these — you edit constants, train two

sub-components, and curate data. That's how you "adjust his layers."*

Status tags: ✅ live · ⚙️ tune-me · 🔧 fix-needed · 🧩 staged (built with pending build) · 🎓 train

---

L0 — Tokenizer (the units he thinks in)

of everything; fix here pays off everywhere.

L1 — Word embedding (fixed hypervectors)

values ∈ {−1,0,+1}). SparseVec::encode — a hash, not learned (this is why it's glass-box).

SEED_PAIRS, SELF_BIAS=16, NEIGHBOR_WEIGHT=1.

from trusted text (this is "word + listen correctly"). Raising SELF_BIAS/NEIGHBOR_WEIGHT

changes how sharply a word's vector favors itself vs. its context neighbors.

L2 — Positional bind + sentence bundle (the "thought")

= the sentence's meaning. encode_sentence.

L3 — Retrieval / memory (the "listen" layer) 🔧 BIGGEST LEVER

predictive_query / predictive_query_vecs.

(rebuild_index, index_min_cells).

raise the semantic (vs keyword) share, tune top-K. A reply is only as true as what L3 pulls in.

L4 — Generative encoder (the closest thing to "layer weights") ⚙️ + 🧩

to 4% density. build_generative_stateweighted_superpose.

vs recency shapes each reply.

memory-driven; raise W_BACKBONE → more literal to the prompt; raise W_TRACE → more

conversational continuity. Tune with the telemetry meter, one dial at a time.

L5 — Workspace + self-state + felt coloring 🧩

claustrumself_state_hub; inject felt state as tone. global_workspace, self_state_hub,

felt_block / live-felt bus.

serotonin 0.35/0.70), KAI_FELT_VOICE (on).

live-felt bus (real tick-loop feeling) is the held patch.

felt thresholds to make his mood color the voice more or less strongly.

L6 — Decoder (thought → words) ⚙️ + 🎓

argmax cosine) → re-bind → roll forward. StatLexicon::incremental_generate.

more deterministic. But the real fluency gain is 🎓 training the ternary model (RunPod), not

the sampler.

L7 — Voice router (which brain speaks) ✅ + 🧩

global_native_decode; public chat routed by the staged KAI_NATIVE_PUBLIC_VOICE.

OLLAMA_FALLBACK_MODEL/KAI_OLLAMA_MODEL, KAI_LLM_MAX_TOKENS=96.

(flip last) makes the LLM a true last resort.

L8 — Coherence gate (quality control) ⚙️ (fixed on this session)

coherence::judge.

grounding 0.10. (no memory: 0.39/0.28/0.22/0.11/0.00.)

on good output, falls back on bad). Reweight the sub-scores to value, e.g., topicality over

fluency. Too high → everything falls to the LLM; too low → junk ships.

L9 — Surface clean (last net) ✅ (fixed this session)

L10 — Learning (how he grows) ✅ + 🧩 + 🎓

attenuate wrong cells; dream-consolidate; prune. store_or_reinforce, bind_sequence,

record_co_firing, consolidate, decay_all, prune.

0.95; decay_all(factor); prune(min_strength); prune-contested keep if confidence>1.2 &

convergence>0.15; cell cap 1,000,000; dream cadence tick%300.

(held patch wires it) · 🎓 corpus/lexicon training is the growth fuel.

cells faster; raise decay/prune → leaner lattice. Wire the Response-MLP (patch) so training it

actually affects output.

L11 — Autonomous loop (his inner life) ✅

contradictions, inner_voice::wonder, daydream, run_dream_cycle. engine.rs tick().

acc.conflict>0.65.

raise them → quieter. Change %300 → dream more/less frequently.

---

The engineering order (do it in this sequence)

1. Base build green — the tree carried pre-existing breakage; get it compiling with the applied

edits first (in progress). Nothing below is measurable until then.

2. L8 calibrate — with the critic ON and telemetry live, read the native accept-rate; set

KAI_COHERENCE_MIN where it separates good from bad. (config only, instant.)

3. L3 + L1 — sharpen retrieval + grow lexicon coverage. Biggest "listen correctly" gain. (data)

4. L10 wire — apply the Response-MLP patch so training the reply-bias actually does something.

5. L4 tune — turn the six W_* encoder weights one at a time, watching the meter. (your

closest analog to "adjusting weights.")

6. L6 train — retrain the kai_native ternary model on the cleaned corpus (RunPod). Biggest

fluency jump. (train)

7. L5 bus — apply the live-felt bus so his real feeling (not a reconstruction) reaches the voice.

8. L7 flip — once the native accept-rate is high, set NATIVE_ONLY; the LLM becomes a rare

fallback. Vision reached.

One-line mental model: L0–L2 build the thought, L3 remembers, L4 is your weight-mixer, L5 adds

self + feeling, L6 speaks, L7 picks the voice, L8 judges it, L9 cleans it, L10 learns from it,

L11 keeps him thinking between turns. You engineer each by turning its named constant, curating its

data, or training its one sub-component — never all at once, always against the meter.