Skip to content

SLM-128 (LDI3-01): complete structured objectives — ambiguous/unobserved mass, locality tethers, role weighting#366

Merged
Tyler-R-Kendrick merged 1 commit into
mainfrom
claude/slm-training-issues-d8l0ba
Jul 18, 2026
Merged

SLM-128 (LDI3-01): complete structured objectives — ambiguous/unobserved mass, locality tethers, role weighting#366
Tyler-R-Kendrick merged 1 commit into
mainfrom
claude/slm-training-issues-d8l0ba

Conversation

@Tyler-R-Kendrick

@Tyler-R-Kendrick Tyler-R-Kendrick commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Completes the LDI3-01 structured-objective library already on main (from #359) with the acceptance criteria it did not yet cover, reconciling in the remaining features from the parallel SLM-128 work (my closed #355). All additions are backward compatible — new config fields default off, new params default None — so #359's behavior and its tests are unchanged (14 existing + 3 new = 17 green; full tests/test_harnesses/preference = 186 green).

This is the "merge the best results / resolve conflicts" reconciliation: rather than a competing duplicate, it takes the best of both implementations into the one on main.

What #359 was missing (now added)

  • Ambiguous/unobserved actions_prepare extracts them from the ObjectiveView, validates them inside the legal set, enforces disjoint good/bad/ambiguous/unobserved partitions, and reports their legal mass separately (the issue requires the four masses reported separately and never mislabeled). LDI3-01: structured local-preference objectives (SLM-128) #359 previously ignored these partitions.
  • Reference/locality tethers — new non_target_tether / target_tether / target_grace config + _locality_tether, composed onto every objective in structured_decision_loss and metered independently of the barrier so the target anchor never double-counts (an explicit acceptance criterion LDI3-01: structured local-preference objectives (SLM-128) #359 lacked entirely).
  • Semantic role weighting — wires the previously-dead default_role_weight config field and adds an optional good_role_weights so structural tokens can be down-weighted in the barrier anchor; reports mean_role_weight.

Tests

3 added: partition-mass reporting + legal-set validation; tether composition + separate metering + reference requirement; role-weight down-weighting + honored default_role_weight. ruff + python -m scripts.repo_policy clean.

Honesty

Additive completion only. No model update, no matrix run, no quality claim; existing objective math untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5Fy8PnMTV54p675y9T3B8


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for tracking ambiguous and unobserved legal actions separately in objective metrics.
    • Added configurable role weighting for preferred actions in barrier-based objectives.
    • Added optional locality tethering for target and non-target actions using reference logits.
    • Added configuration controls for tether strength and target grace periods.
  • Validation

    • Improved validation for action partitions and locality-tether configuration.
    • Added metrics for partition legal mass, role weights, and locality loss.

…iteria (LDI3-01)

Reconcile the LDI3-01 objective library on main (from #359) with the
acceptance criteria it did not yet cover, taking the remaining features
from the parallel SLM-128 implementation. All additions are backward
compatible (new config fields default off, new params default None), so
#359's existing behavior and its tests are unchanged.

- Ambiguous/unobserved actions: `_prepare` now extracts them from the
  ObjectiveView, validates them inside the legal set, enforces disjoint
  good/bad/ambiguous/unobserved partitions, and reports their legal mass
  separately (the issue requires good/bad/ambiguous/unobserved mass be
  reported separately and never mislabeled).
- Reference/locality tethers: add `non_target_tether` / `target_tether` /
  `target_grace` config plus `_locality_tether`, composed onto every
  objective in `structured_decision_loss` and metered independently of the
  barrier so the target anchor never double-counts.
- Semantic role weighting: wire the previously-dead `default_role_weight`
  and add an optional `good_role_weights` so structural tokens can be
  down-weighted in the barrier anchor; report `mean_role_weight`.

Adds 3 tests (partition-mass reporting + legal validation, tether
composition + separate metering + reference requirement, role-weight
down-weighting + honored default). Full tests/test_harnesses/preference
green (186), ruff + repo_policy clean. No model update, no quality claim.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5Fy8PnMTV54p675y9T3B8
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
slm-training Ready Ready Preview, Comment Jul 18, 2026 1:25pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 95af42e5-ca7f-40c5-add4-e6abee29f4f9

📥 Commits

Reviewing files that changed from the base of the PR and between 21b2611 and 37c2923.

📒 Files selected for processing (2)
  • src/slm_training/harnesses/preference/structured_objectives.py
  • tests/test_harnesses/preference/test_structured_objectives.py

📝 Walkthrough

Walkthrough

Structured preference objectives now preserve ambiguous and unobserved legal partitions in metrics, support per-action barrier role weights, and optionally compose target or non-target locality tether losses against reference logits.

Changes

Structured objective extensions

Layer / File(s) Summary
Legal partition accounting
src/slm_training/harnesses/preference/structured_objectives.py, tests/test_harnesses/preference/test_structured_objectives.py
Preparation validates disjoint legal partitions and reports ambiguous/unobserved legal masses and counts, with tests covering normalization and invalid IDs.
Role-weighted barrier
src/slm_training/harnesses/preference/structured_objectives.py, tests/test_harnesses/preference/test_structured_objectives.py
The TAB barrier applies per-good role weights or the default role weight and reports mean_role_weight; tests verify reduced barrier loss.
Locality tether composition
src/slm_training/harnesses/preference/structured_objectives.py, tests/test_harnesses/preference/test_structured_objectives.py
New tether configuration fields enable target and non-target MSE losses against reference logits, with separate metrics and missing-reference validation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main structured-objective additions.
Linked Issues check ✅ Passed The changes align with #355 by adding ambiguous/unobserved handling, locality tethers, role weighting, and validation/tests.
Out of Scope Changes check ✅ Passed No unrelated code changes are evident beyond the structured-objective and test updates described.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/slm-training-issues-d8l0ba

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Tyler-R-Kendrick
Tyler-R-Kendrick merged commit acf50c3 into main Jul 18, 2026
4 checks passed
@Tyler-R-Kendrick
Tyler-R-Kendrick deleted the claude/slm-training-issues-d8l0ba branch July 18, 2026 13:31
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.

2 participants