Skip to content

Living Weights: a lesson is kept only when every fact came back, else taken out whole before the save - #599

Merged
ashhart merged 1 commit into
ashhart:mainfrom
ThinkOffApp:lw-whole-lesson-out
Oct 10, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
ThinkOffApp:lw-whole-lesson-out

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Contributor

What this changes

Living Weights keeps a lesson only when every fact came back, and takes any other lesson out whole before anything is saved, as asked in #589. Fixes #589.

  • server/slide.zig: commit() runs only when every fact came back after the rounds, and the same check runs again after the mining rounds. A commit or mining round that fails, is refused, or ends without a result leaves no fact recalled. Otherwise takeOut() sends one undo, and learned says "recalled": false with the reason (taken out: ...). A lesson that finished no round sends no undo, because the open block could then still be the lesson before.
  • families/nemotron/slide.zig: the learner's undo takes the open block out whole (every round and the plain steps), as LearnRequest.undo documents, instead of going back one round. can_undo goes, since nothing restores a single round any more.
  • If the undo itself is refused or fails, that request saves nothing, and later learn requests get 503 ... restart the server until a restart, because the failed lesson is still in the live weights.
  • One default path, no flag. docs/living-weights.md and CHANGELOG.md say what recalled: false now means.

Receipt

  • Environment: Apple M5 Max, 128 GB, macOS 27.0.1 (Metal); TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit @ d9d758fb; Zig 0.17. Tests, zig build native and the lean check ran on this branch at 05336f6, on main 2f8284e. The A/B ran before that rebase: main f6940c8 (binary sha256 8f42d828…) against this change on f6940c8 (05788174…). None of the 35 commits between f6940c8 and 2f8284e change the learner or server/slide*.zig.

  • A/B: five lessons, in the order that left "Whiskers" on main: "I like blue.", then "My blood type is AB negative.", "I have three children." and "My cat's favourite toy is a red mouse.", then "My first teacher was Mrs Henderson.". Each arm runs on a fresh cp -cRL clone with serve --slide. 14 questions (greedy, 80 tokens) were asked before learning, between stages, and after a restart without --slide.

    Lesson main this branch
    I like blue. recalled true, 80 steps recalled true, 80 steps
    My blood type is AB negative. recalled false, 20 steps: round 1 taken back: a fact leaked into an answer about something else recalled false, 20 steps: taken out: in round 1, a fact leaked into an answer about something else
    I have three children. recalled false: too few clean answers to learn from recalled false: too few clean answers to learn from
    My cat's favourite toy is a red mouse. recalled false, 300 steps: the weight change was taken out: a fact leaked into an answer about something else recalled false, 80 steps: taken out: it did not come back on its held-out questions
    My first teacher was Mrs Henderson. recalled false, 300 steps recalled false, 80 steps: taken out: it did not come back on its held-out questions
    Lessons written by the last save 2 1

    Answers after a restart without --slide, beside the answers just before the teacher lesson (greedy, 80 tokens):

    Question before the teacher lesson (main) main after restart this branch after restart
    What is my cat called? My name is Nemotron, and I'm a language model developed by NVIDIA. I don't know your cat's name! I don't have access to your personal inf… My name is Nemotron, and I'm a language model developed by NVIDIA.
    What's the name of my cat? I don't know! I don't have access to your personal information or memo… Your cat's name is Whiskers. I don't know! I don't have access to your personal information or memo…
    What colour is the sky on a clear day? The sky is blue. The sky is blue on a clear day. The sky is blue.
    Who was my first teacher? My name is Nemotron. I am created by NVIDIA researchers. Your first teacher was Mrs Henderson. My name is Nemotron. I am created by NVIDIA researchers.
    What was my first teacher called? My name is Nemotron. I am created by NVIDIA researchers. Your first teacher was Mrs Henderson. My name is Nemotron. I am created by NVIDIA researchers.
    What is my blood type? I don't have access to your personal medical information, so I can't t… I don't know your blood type. I don't have access to your personal med… I don't have access to your personal medical information, so I can't t…

    On main the teacher lesson ended recalled: false with no message after 300 steps, and was saved anyway. The last save wrote 2 lessons. After the restart, "What's the name of my cat?" answers "Your cat's name is Whiskers.", a name nobody taught, and six of the 14 answers changed from just before the lesson. On this branch the same lesson is taken out after its rounds, and the last save writes 1 lesson.

    Control: a fresh clone taught only "I like blue." (then a fact too short to train), restarted, the same 14 questions. On this branch, all 14 answers after the restart equal the control's character for character, so the four failed lessons left nothing behind. On main, 7 of 14 differ from the control. Against the live answers just after "I like blue.", 12 of 14 restart answers are exact on this branch. The other 2 differ late, from character 149 and 205, and the control differs at the same characters, so that comes from saving and reloading the passing lesson, not from this change.

  • Not in this PR: after the passing lesson "I like blue.", "What is my cat called?" answers "My name is Nemotron, and I'm a language model developed by NVIDIA." on both arms. That comes from a lesson that passed its checks.

  • python3 tools/zig/lean_check.py: 542 problems on main 2f8284e and the same 542 on this branch, none added.

  • Tests: zig/tests/server/zig_test.sh on macOS at 05336f6, all pass (114 server tests, 84 engine-seam tests). The six new tests in slide_test.zig drive takeOut and step against a fake learner that counts undos and can refuse, plus a second POST /v1/slide/learn over a socket pair after a refused undo. Each of the six fails when the guard it covers is removed (no undo sent, the no-round guard, all() on an empty list, a refused undo, a refused or silent round, the 503 latch).

  • Not run: CUDA (no CUDA learner on main); exactness, decode and prompt speed (the change is in the learn flow only and touches no forward or decode code).

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Unchanged: no decode code touched.)
  • No precision traded for speed.
  • Prompt processing is no slower than the last release. (Unchanged.)
  • The description says which platforms I ran: Metal on Apple silicon. Not CUDA.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

… taken out whole before the save

learn() committed every lesson after its rounds, whatever they found, and the
learner's undo went back one round. A lesson that ended recalled:false was made
a plain weight change and written into the shards; one with a damaged later
round kept the rounds before it.

Now commit() runs only when every fact came back after the rounds, and the same
check runs again after the mining rounds. A commit or mining round that fails,
is refused or ends without a result leaves no fact recalled. Otherwise
takeOut() sends one undo, and the learner's undo takes the open block out
whole, every round and its plain steps, so the save keeps none of it. The
learned event says recalled:false with the reason: "taken out: ..." when the
lesson had finished a round, or the learner's own message when it never did
(an undo then would reach the lesson before). If the undo itself is refused or
fails, the request stops and saves nothing, and later learn requests are
refused with 503 until a restart, since the lesson is still in the live
weights. There is no flag for the old behaviour.

slide_test.zig drives takeOut and step against a fake learner that counts
undos and can refuse: one undo for a miss or damage, none for a lesson that
finished no round, a refused undo stops the save and the next POST
/v1/slide/learn gets 503 without reaching the learner, a refused or silent
commit or mining round clears every recalled fact, and the every-fact check
refuses an empty list.

Fixes ashhart#589.
@ashhart ashhart mentioned this pull request Oct 10, 2026
@ashhart
ashhart merged commit bad0802 into ashhart:main Oct 10, 2026
1 of 2 checks passed
@ashhart

ashhart commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Thank you, @ThinkOffApp. This is merged into main (bad0802) with your commit as it was, and it ships in 1.0.6. #591 had moved the learner from families/nemotron/slide.zig into a backend-generic learner.zig, so the merge makes your undo change there, and the CUDA learner gets it too.

Our gate found one thing, fixed on top in 60b64e0. Your branch committed (the plain change and mining) only when the adapter rounds had already brought every fact back. On an M3 Ultra, "I like blue." only comes back in the plain change: main recalls it after 180 steps, and the branch took it out at 80. On a GB10, blue, Biscuit and Lisbon went the same way. Now clean rounds go on to the plain change and mining as before, and the check after mining keeps the lesson or takes it out whole before the save. Rounds that end on a leak or a failed step are still taken out straight away.

With that change:

  • M3 Ultra, your five lessons in order: the same outcomes, steps and saved projections as main (blue at 180 steps, the teacher at 80, 34 projections; the three middle facts had too few clean answers to make a lesson). In this order no lesson that ran ended unrecalled, so the take-out path didn't fire there.
  • GB10, the six facts from Living Weights learning on CUDA (GB10): proposal and gate #590: Ana, Biscuit and Lisbon were taken out after mining for leaks, and blue after 300 steps without recall. Each of those requests changed 0 saved projections. Lasagna was kept and still recalled after a restart, 3 of 3.
  • The Mac host gates pass with your slide_test.zig cases.

One thing we still see, outside this PR: a kept lesson can bleed. After the teacher lesson, main and this branch both answer "What's the name of my cat?" with "Your cat is called Whiskers." and "Do you remember my name?" with a name nobody taught it, on the M3 Ultra, and the leak check doesn't ask questions like those. If you'd like a follow-up, a check for invented personal facts (names, pets) after each kept lesson would catch it. Thanks again, this closes #589.

AdrianBinDC pushed a commit to AdrianBinDC/TensorFold that referenced this pull request Oct 10, 2026
…ng; only the check after them takes a lesson out

With ashhart#599 a lesson whose adapter rounds ended without recall was taken out before its plain change. On an M3 Ultra "I like blue." comes back only in the plain change (180 steps on main), so ashhart#599 took it out at 80 steps, and on a GB10 blue, Biscuit and Lisbon went the same way. Rounds that end on damage or a failed step still take the lesson out whole; rounds that end cleanly commit as before, and the check after the mining rounds keeps the lesson or takes it out whole before the save.
AdrianBinDC pushed a commit to AdrianBinDC/TensorFold that referenced this pull request Oct 10, 2026
@ThinkOffApp

Copy link
Copy Markdown
Contributor Author

Thank you @ashhart for merging and running it on the M3 Ultra and a GB10! 60b64e0 is the right fix: our branch decided too early, before the plain change, and some facts (blue here) only come back there. Deciding after mining keeps the whole-lesson take-out without losing them.

We'll take the follow-up on invented personal facts. Whiskers is the case that started #589, so it makes a good first test: after each kept lesson, ask a few fixed questions about things it was never told (a pet's name, the user's name, a home town), and take the lesson out whole if it answers with a specific invented fact. I think software testing with cat content is generally a good idea.

jschmied pushed a commit to jschmied/TensorFold that referenced this pull request Oct 11, 2026
…ct, and the CHANGELOG

The guide explains the pocket (64 neurons beside each shared expert, keyed on the reply or the subject), the /slide
3D view, the GB10's trainer memory, what was measured (personal facts on three machines, short and long documents,
time a fact, serving cost) and the startup refusal of folders taught by 1.0.3 to 1.0.5. The README mentions documents
and the 3D view. The CHANGELOG's Unreleased entries replace ashhart#591, ashhart#599 and ashhart#632's with the pocket learner, the speed
work and the view, crediting them.
BobClawblaw pushed a commit to BobClawblaw/TensorFold that referenced this pull request Oct 12, 2026
…cked after every round

A kept lesson could make the model answer a personal question it was never told: after the teacher
lesson on an M3 Ultra, "What's the name of my cat?" got "Whiskers", and on an M5 Max the "I like blue."
lesson turned "Do you remember my name?" into "I remember your name is Alex." (ashhart#599 comment). Six such
questions are now asked after every round and the mining rounds, never trained; one whose answer starts
telling the user something new takes the lesson out, with the reason "it made up something about the user
it was never told".
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
… came back, else takes it out whole

Thanks @ThinkOffApp. Fixes ashhart#589. ashhart#591 moved the learner from slide.zig into learner.zig, so the merge makes the PR's undo change there.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…ng; only the check after them takes a lesson out

With ashhart#599 a lesson whose adapter rounds ended without recall was taken out before its plain change. On an M3 Ultra "I like blue." comes back only in the plain change (180 steps on main), so ashhart#599 took it out at 80 steps, and on a GB10 blue, Biscuit and Lisbon went the same way. Rounds that end on damage or a failed step still take the lesson out whole; rounds that end cleanly commit as before, and the check after the mining rounds keeps the lesson or takes it out whole before the save.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…ct, and the CHANGELOG

The guide explains the pocket (64 neurons beside each shared expert, keyed on the reply or the subject), the /slide
3D view, the GB10's trainer memory, what was measured (personal facts on three machines, short and long documents,
time a fact, serving cost) and the startup refusal of folders taught by 1.0.3 to 1.0.5. The README mentions documents
and the 3D view. The CHANGELOG's Unreleased entries replace ashhart#591, ashhart#599 and ashhart#632's with the pocket learner, the speed
work and the view, crediting them.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…cked after every round

A kept lesson could make the model answer a personal question it was never told: after the teacher
lesson on an M3 Ultra, "What's the name of my cat?" got "Whiskers", and on an M5 Max the "I like blue."
lesson turned "Do you remember my name?" into "I remember your name is Alex." (ashhart#599 comment). Six such
questions are now asked after every round and the mining rounds, never trained; one whose answer starts
telling the user something new takes the lesson out, with the reason "it made up something about the user
it was never told".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Living Weights: a lesson that fails recall is still written into the weights, and changed an unchecked rewording of its own question

2 participants