SLM-128 (LDI3-01): structured local-preference objectives (Legal-Set FTPO, TAB-PO barrier, TBPO ratio control)#355
Conversation
New shared, architecture-neutral objective library extending the local preference objectives with three OpenUI-native structured objectives over the exact grammar-legal action sets, consumed identically by causal and TwoTower trainers (the trainer extracts the logit row; this module owns the math -- nothing duplicated in architecture-specific files): - Legal-Set FTPO (two variants): explicitly pair-weighted G x B set margin normalized per state, and a legal probability-mass margin softplus(margin + log P_B - log P_G) reporting good/bad/ambiguous/ unobserved mass separately. - TAB-PO-inspired barrier: additive, separately-metered SFT anchor -log p_legal(g) for verifier-critical, under-confident good actions; zero for confident ones; structural roles default low; plus a token erosion-rate metric. - TBPO-inspired ratio control: bounded good-vs-bad log-ratio control against a same-state reference, advantage-centered or centered by a serializable StateBaseline fit only from train states; disabled and reported when there is no reference. Typed/versioned StructuredObjectiveConfig with fail-closed validation and a deterministic content-hash fingerprint; per-state-normalized batch loss so large action sets cannot dominate; separately-metered tether composition; and a no-model-update fixture report generator. Existing ce_margin/unlikelihood/ftpo_* are untouched (new names), so historical behavior and the 68 existing preference tests are unchanged. 16 new tests (hand-computed values, finite-difference gradients, config round-trip/fingerprint, barrier selectivity, erosion, architecture neutrality, numeric stability) plus a design memo and deterministic fixture artifact. Adapted, not reproduced: no matrix run, no checkpoint, no quality claim, no hidden eval gold. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5Fy8PnMTV54p675y9T3B8
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #359, merged as the canonical LDI3-01 structured-objectives implementation for SLM-128. #359 lands the same three objectives (Legal-Set FTPO / tab_barrier / tbpo_inspired) as a clean, gradcheck-verified 5-file additive change on current Closing as a duplicate to keep one canonical implementation per issue. If this branch's larger Generated by Claude Code |
Implements SLM-128 / LDI3-01 — a shared, architecture-neutral objective library adding three OpenUI-native structured local-preference objectives over the exact grammar-legal action sets. One implementation (pure functions of a 1-D logit row + materialized action sets) that both the causal and TwoTower trainers call — the trainer extracts the row, this module owns the math, nothing duplicated in architecture-specific files. Builds on the SLM-116/117 materializers + objective-support admission now on
main.What landed
src/slm_training/harnesses/preference/structured_objectives.py:StructuredObjectiveConfig— typed, versioned, fail-closed-on-unknown-fields config with a deterministiccontent_shafingerprint (part of run/adapter identity).StructuredObjectiveInput— logits + legal/good/bad/ambiguous/unobserved sets + per-action evidence weights, roles, criticality, optional same-state reference; rejects empty good/bad, out-of-legal ids, overlapping partitions.G × Bset margin normalized per state, and a legal probability-mass marginsoftplus(margin + log P_B − log P_G)reporting good/bad/ambiguous/unobserved mass separately.−log p_legal(g)for verifier-critical, under-confident good actions (zero for confident; structural roles default low) + atoken_erosion_ratemetric.StateBaselinefit only from train states; disabled + reported without a reference.Existing
ce_margin/unlikelihood/ftpo_*are untouched (new names) — historical behavior and the 68 existing preference tests are unchanged.Tests
tests/test_harnesses/preference/test_structured_objectives.py(16, green): both Legal-Set FTPO variants match hand-computed values, state normalization prevents large-set dominance, legal mass sums over only the legal set, barrier selectivity + structural-role weighting, erosion detection, ambiguous/unobserved normalized-but-never-targets, ratio control compares at identical states and disables without a reference, state-baseline fit + round-trip, mass-margin gradients match finite differences, tiny-probability numeric stability, config round-trip/fingerprint/fail-closed validation, architecture-neutral call over "causal"/"TwoTower" mock logits, and input validation.ruff,python -m scripts.repo_policy,git diff --checkclean.Evidence artifact
docs/design/iter-ldi3-01-structured-objectives-20260718.md+ a deterministic fixture report. The four objectives are genuinely distinct on the same corpus (batch loss ≈ mass-margin 1.26 / pairwise 2.73 / barrier 2.36 / ratio 1.26); raw-vs-legal good mass differs (0.39 full-vocab vs 0.59 legal-space); the barrier activates only for the low-prob critical state.Honesty
Adapted, not reproduced (names carry
tab_po_inspired/tbpo_inspired). No matrix run, no checkpoint, no quality claim, no new event mining, no hidden eval gold; criticality comes from compiler/AST role + verified action evidence, never gold programs. Wiring the objectives into the trainer entry points behind a config switch is documented as deferred follow-on.🤖 Generated with Claude Code
https://claude.ai/code/session_01U5Fy8PnMTV54p675y9T3B8
Generated by Claude Code