Repository navigation
Decision-model judge for the answer guard and fact merges; training keeps the yes/no habit - #12
Merged
Merged
Conversation
…vs 40/96 retrieval Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…he current guard bench/jev/make_cases.py: 120 answers models really gave (GPU runs, 1.5B/4B/24B), half right and half wrong, strictly labelled. memagent/tests/jev_guard.lpr runs Mem.Guard.Licensed and a Jev-style readout (JevBan's prompt and letter-logit readout, one forward pass) on each. Mem.Llama binds llama_get_logits_ith. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…or the current guard On 120 answers models really gave (half right, half wrong), a Jev readout over the two-hop retrieved facts kept 47/60 right answers and blocked 55/60 wrong ones at p>=0.9 (AUC 0.93); the current reranker + rules guard kept 28/60 and blocked 37/60. Bridge answers: 40/40 judged right. The same readout with the 1.5B chat model: 0.56-0.68. 11.5 s per judgement on 4 CPU cores. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…oes unsure fact merges [judge] model=off | openjev-flash-9b | path. TJudge loads a GGUF beside the chat model and reads the option letters' logits (JevBan's readout, one forward pass). - Guard: P(the turn's retrieved facts back the answer) >= guard_min (0.9) or the answer is withheld. 0.85 vs 0.54 for the rule guard on 120 real answers. - Merges: the rules still propose; the judge must agree that the new fact replaces the old (same person, same attribute), else both are kept. An unsure judge never overwrites (cf. Hightouch's over-merge lesson: a duplicate costs a line, a wrong merge lost 14 of 112 facts). - Launchers turn it on for GPU presets with a CUDA llama.cpp and 16 GB+; off on CPU (~11 s per decision there). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…'s name is Ana."); judge write-up with Hightouch's lessons Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…ool scoring the rules and the judge on it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…es; rescue merges reworded slots (0 wrong, 0 missed)
- [judge] merge_min stays 0.9: right merges scored 0.92-1.00, wrong ones 0.00-0.04
- new: when the rules find no match, the judge may merge the closest fact
(subject cosine >= rescue_cos 0.4, not DistinctSubjects) at p >= rescue_min
0.97. It catches the reworded slots the rules miss ("dog's name is Rex" ->
"dog is called Max"); same-name different people scored up to 0.95, below
the bar, and DistinctSubjects blocks them anyway. Tuned on the same set:
noted as a caveat.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…s, varied examples for every profile Training on question -> fact sentence alone taught models to answer "Is my friend the one whose city is Porto? Answer yes or no." with "Your friend's city is Porto." (verify 0/24 at 1.5B, 5/24 at 24B after deep sleep). - varied examples (Mem.Examples / memlib.varied_qas), kinds 3 and 4 on even rounds: "Is Ana's city Lisbon? Answer yes or no." -> "Yes.", and "No." for another fact's value, of the same attribute when there is one - six yes/no anchor prompts first in ANCHOR_PROMPTS (both trainers), so every profile rehearses answering yes or no; the held-out drift prompts (the last eight) are unchanged - small, medium and large use [train] examples = varied (tiny already did) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
…o do Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a decision-model judge (
Mem.Decide) that decides the answer guard and fact merges in place of rules, plus the benchmarks behind it. It also changes training so models keep answering yes/no questions with yes or no. These are the commits that came after #11 was merged; v0.4.0 does not include them.The judge (
memagent/Mem.Decide.pas,[judge]in the config)A decision model, OpenJev-Flash-9B, runs beside the chat model. memagent reads it the way JevBan does: one forward pass, then the logits of the option letters give a calibrated probability, with no generated text. Questions, answers and facts go into its state as quoted JSON, never into the question it is asked.
guard_min(0.9). Statements skip the guard; there is no answer to check.merge_min0.9); otherwise both facts are kept. When the rules find nothing, the judge may also merge the closest similar fact, at P ≥ 0.97 (rescue_min) and never acrossDistinctSubjects.Results (
bench/README.md)Answer guard, on 120 answers the models really gave, 60 right and 60 wrong (
bench/jev/):The judge got all 40 two-fact answers right. It is also well calibrated: every answer it scored below 0.1 was wrong, and every one it scored 0.97 or above was right. Routing the uncertain middle band to the rules did worse (0.80), so the guard withholds those answers.
Fact merges, on 75 labelled pairs. The 39 that must not merge are look-alikes, following Hightouch's write-up on LLM judges for identity resolution:
Caveat:
rescue_minandrescue_coswere tuned on the same 75 pairs.Training keeps the yes/no habit
Deep sleep taught models to answer "Is my friend the one whose city is Porto? Answer yes or no." with "Your friend's city is Porto." After training, verify scored 0/24 at 1.5B and 5/24 at 24B. The fix, in both trainers:
This fix is not measured yet. It needs a GPU rerun of deep sleep and the integration benchmark at 1.5B, 4B and 24B.
bench/README.mdsays so.Testing
make test: extraction 710/710, priors 39/39, retrieval, HTTPS, and the Python unit tests pass.memagent/tests/jev_guard.lprandmemagent/tests/merge_judge.lprreproduce the two tables.Mem.Llamanow bindsllama_get_logits_ith.Generated by Claude Code