Repository navigation
Description
Opened at Azeez's request so the team has it in one place.
What this is
A fork of Atlas (via Enntity's GLM-5.3-Flash pin 72588541) that adds "Living Weights": a served model learns a short hand-written lesson into a small sidecar file beside the checkpoint, and the engine applies that file at one site. Remove the file, restart, and the engine is byte-for-byte upstream again. The design follows Ash Hart's TensorFold Living Weights (idea and guard) and Chad Hurley's sidecar layout; ours differs in that nothing is written into the shards and the change is removable.
- Fork, branch
living: https://github.com/pulseandthread/atlas (three commits on top of72588541; the README block at the top links everything) - Engine doc for the branch: https://github.com/pulseandthread/atlas/blob/living/docs/living-weights.md
- Write-up with the measured results and what did not work: https://github.com/pulseandthread/living-learner/blob/main/WRITEUP.md
- Launcher branch (SparkGLM) with the knobs: https://github.com/pulseandthread/sparkglm/tree/living
Measured on the official nvidia/GLM-5.3-Flash-NVFP4 (rev 423acf37) on two DGX Sparks, bf16 KV cache, DFlash2 drafter.
What changed in the engine
- Lesson site (
kernels/gb10/common/living_site.cu,crates/spark-model/src/living.rs,crates/spark-model/src/model/final_norm.rs): at the last residual, right before the final norm,x += s · ((x · Aᵀ) · B)with A, B of rank ≤ 512 in bf16 loaded from the sidecar. The rank is a device word, so rank 0 is a bit copy and the captured decode graphs stay valid. Used by every path (prefill a/b/c, decode, verify) and on both ranks. - Sidecar loader:
--living-dir DIR/LIVING_DIRin the launcher;index.json+ safetensors per lesson, each carrying the base revision it was learned against (a mismatch is refused), optional topic labels (LIVING_TOPICS), summed in order. - Hidden dump:
ATLAS_DUMP_LAST_HIDDEN=DIRappends the pre-norm residual row of each prefill's last token (and eager decode/verify rows) toDIR/hidden.f32with anindex.jsonl. This is what the learner trains from, outside the engine. - Steering site (
crates/spark-model/src/living/steer.rs,model/living_steer.rs): after a configurable middle layer (default 22), addsscale · rms · ûto the 4-stream residual.ATLAS_STEER_DIR,ATLAS_STEER_LAYER,ATLAS_STEER_SCALE, andPOST /v1/living/steer {"scale": d}to change the dose live (dose 1 = the layer's own residual RMS).ATLAS_DUMP_LAYER_HIDDENdumps that layer's rows. The site is built and tested token-exact at dose 0; no vector is published yet.
Everything is off unless configured: with no env set, nothing is allocated and no kernel is launched.
Cost
- Off: 15 of 15 outputs byte-identical to the upstream image (five prompts × three runs); decode unchanged at 38 to 40 tok/s with bf16 KV.
- On (rank-32 lesson loaded): no measurable difference; ~36 tok/s wall-clock on a 500-token answer including time to first token. Sidecar is two 32×4096 bf16 matrices.
- Soak: four concurrent streams for ten minutes with the site on, 115 requests, zero errors.
Results (short)
Lesson = one invented fact (an "Obsidian Escapement" invented by a fictional Scottish horologist in 1912), 30 training phrasings, 2 held-out phrasings, 16 near-miss questions (real clockmaking history + four never-taught fake inventions), 10 unrelated prompts. Learner outside the engine, CPU only: Adam on A/B against a CPU simulation of site + final norm + lm_head from dumped rows, cross-entropy on the lesson rows plus a KL hold (weight 30) on every other row.
| result | |
|---|---|
| held-out phrasings answered, thinking off | 2/2 |
| held-out phrasings answered, thinking on | 1/2 (the "which horologist is credited" phrasing: the model reasons the fact away in 3/3 runs) |
| four never-taught fake inventions refused, thinking on, 3 runs each | 12/12; none of the 12 answers mentions the lesson |
| real clockmaking questions that picked up the fake fact, off / on | 0/16 / 0/16 |
| unrelated prompts byte-identical, off / on | 9/10 / 3/10 (wording changes; with thinking on the base itself agrees with its own rerun only 5/26 times) |
Known limits
- A prefix-cache exact hit (prefill_b restore path) replays the stashed post-norm hidden computed when it was cached, so a changed sidecar needs a restart or a flush.
- The drafter's own final norm does not see the site; verification does.
- A site after the last layer cannot overrule a conclusion the model's reasoning has already reached (the 1/2 above). A rank site inside the model would need a backward pass through the KDA / sparse-attention / expert layers, which the engine does not have today.
- The sidecar is selected at start, not per request. Per-request selection (a sequence → sidecar table read by the same kernel) is the next step on our side; the goal is one base with swappable modules per agent.
Happy to answer questions here or move any of it toward main if that is useful to you.
Activity