feat(lilith): first-divergence preference pairs at export #553
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lilith-first-divergence-pairs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Run 3 (PR #550, hypothesis 3): every sibling-contrast preference pair was refused by the trainer (
pair_prefix), because the pairs carried whole multi-turn trajectories and the trainer accepts one prompt and one response per side with a pure-suffix mask.program.encode.encode_preferencenow renders first-divergence pairs: the prompt is the shared prefix up to the first assistant turn where the sibling and the raw episode differ; each side's response is that single turn. A turn that is a tool call is rendered as the calls plus the tool-stop token (_encode_block(open_calls=True)), so "read before you claim" is the contrast the pair carries. Records keep the full message lists for provenance; the manifest and the on-policy sidecar recordpair_render: first-divergence. The trainer andencode_sftare unchanged.Spot check with the real Gemma tokenizer on run 3's ten refused pairs (8 Green, 2 Brown): 10 of 10 accepted by
train_program._build_preference; prompts 2.5k–27.5k tokens, responses 14–687 tokens; six fit 16k, all fit 32k.Tests:
uv run --no-project --with pytest python -m pytest program/tests -q→ 145 passed, 4 skipped (newtest_first_divergence.py).Run 4 plan:
docs/ai/plans/2026-10-06-lilith-program-r4-siblings-in-context.md(PR #552).