Repository navigation
Living Weights: a lesson is kept only when every fact came back, else taken out whole before the save - #599
Conversation
… 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.
|
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 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:
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. |
…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.
|
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. |
…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.
…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".
… 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.
…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.
…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.
…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".
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. OtherwisetakeOut()sends one undo, andlearnedsays"recalled": falsewith 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'sundotakes the open block out whole (every round and the plain steps), asLearnRequest.undodocuments, instead of going back one round.can_undogoes, since nothing restores a single round any more.503 ... restart the serveruntil a restart, because the failed lesson is still in the live weights.docs/living-weights.mdandCHANGELOG.mdsay whatrecalled: falsenow 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 nativeand the lean check ran on this branch at 05336f6, onmain2f8284e. The A/B ran before that rebase:mainf6940c8 (binary sha2568f42d828…) against this change on f6940c8 (05788174…). None of the 35 commits between f6940c8 and 2f8284e change the learner orserver/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 freshcp -cRLclone withserve --slide. 14 questions (greedy, 80 tokens) were asked before learning, between stages, and after a restart without--slide.mainAnswers after a restart without
--slide, beside the answers just before the teacher lesson (greedy, 80 tokens):main)mainafter restartOn
mainthe teacher lesson endedrecalled: falsewith 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 onmain2f8284e and the same 542 on this branch, none added.Tests:
zig/tests/server/zig_test.shon macOS at 05336f6, all pass (114 server tests, 84 engine-seam tests). The six new tests inslide_test.zigdrivetakeOutandstepagainst a fake learner that counts undos and can refuse, plus a secondPOST /v1/slide/learnover 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
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Unchanged: no decode code touched.)