Skip to content

Living Weights on Atlas: removable lesson sidecar before the final norm + steering site (GLM-5.3-Flash on two GB10s) #170

Open

Description

@pulseandthread

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.

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

  1. 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.
  2. Sidecar loader: --living-dir DIR / LIVING_DIR in 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.
  3. Hidden dump: ATLAS_DUMP_LAST_HIDDEN=DIR appends the pre-norm residual row of each prefill's last token (and eager decode/verify rows) to DIR/hidden.f32 with an index.jsonl. This is what the learner trains from, outside the engine.
  4. Steering site (crates/spark-model/src/living/steer.rs, model/living_steer.rs): after a configurable middle layer (default 22), adds scale · rms · û to the 4-stream residual. ATLAS_STEER_DIR, ATLAS_STEER_LAYER, ATLAS_STEER_SCALE, and POST /v1/living/steer {"scale": d} to change the dose live (dose 1 = the layer's own residual RMS). ATLAS_DUMP_LAYER_HIDDEN dumps 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions