Skip to content

SLM-314: preserve multiple hard-valid AST modes with winner-take-all training - #851

Closed
Tyler-R-Kendrick wants to merge 8 commits into
mainfrom
slm-314-winner-take-all
Closed

SLM-314: preserve multiple hard-valid AST modes with winner-take-all training#851
Tyler-R-Kendrick wants to merge 8 commits into
mainfrom
slm-314-winner-take-all

Conversation

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner

Summary

SLM-314 / LAR2-05: preserve multiple hard-valid AST modes with winner-take-all training.

  • Frozen multi-mode dataset: 8 prompts × 2 verifier-accepted modes; mode identity via alpha-invariant canonical AST fingerprints (never serialization strings); sha256 rows + tamper-evident manifest; prompt count honestly declared below ship-gate scale. (SLM-130's artifacts are wiring reports with no committed multi-mode corpus, so the set was synthesized and frozen in-repo.)
  • WTA/MCL loss: per-mode token/AST/action loss using the existing training terms; backpropagate only the minimum-loss mode per example + preregistered coverage/floor term (ε=0.1) so unused modes are not unconstrained; durable per-example selection telemetry. No set-FTPO machinery reused.
  • Two-mode synthetic proof (all 4 preregistered assertions pass): single-gold CE collapses (p(mode B)=0.00004), WTA retains both modes (p(B)=0.0083 with p(A)=0.826 dominant), duplicated multi-gold spreads 50% mass to invalid hybrids.
  • Matched arms {single_gold, multi_gold, wta}, identical frozen sets/budgets/seeds: coverage 0.750 / 0.500 / 0.500, hard-valid decode 1.0 everywhere, v2 semantic regression 0.000. Verdict: rejected per the preregistered coverage gate (WTA coverage gain −0.25) — at this scale the sibling mode is close enough that single-gold lifts it too, while the ε floor under-weights the loser. Computed, not narrated.

Verification

  • 16 new tests (fingerprint alpha-invariance, dataset integrity/tamper, WTA min-loss + telemetry, floor-term gradient, rng hygiene, synthetic collapse-vs-retain, arm isolation, determinism) + tree-edit suite — pass.
  • verify_version_stamps ok (new harness.experiments.slm314_winner_take_all v1); repo_policy ok; git diff --check clean; ruff clean.

Closes SLM-314.

- coverage_class per frozen row (OBSERVABLE_PROMPT / OBSERVABLE_REQUEST_ONLY
  / UNKNOWN); all 51 rows are OBSERVABLE_REQUEST_ONLY pre-inventory.
- Matched requests differ only by the production ensure_prompt_inventory
  suffix; request-derived, no hidden gold channel.
- X22 deterministic arm: paired v2-strict delta +0.3125 (5/16 vs 0/16,
  Wilson [0.142, 0.556]) exceeds the predeclared 0.10 minimum; no
  regressions on observable rows.
- AR tiny baseline: 6/32 decodes completed (all v2-fail partials), 26
  decode_timeout (600-step checkpoint constrained-forest cost per
  SLM-294 evidence); reported unmeasured, not evidence. Rico rows
  not_run with SLM-294 cost evidence.
- 100-record blind slot-observability audit: raw agreement 97%, kappa 0.0
  (skew caveat); finding: v2 coverage detector misses inline slot
  enumeration -> false prompt_contract_unknown (append-only; no metric
  change).
- 8 harness tests; new component harness.experiments.slm301_prompt_observability v1.
…ints

- decode_outcome.py taxonomy with strict precedence (fallback never
  counts as model success); per-request budget/elapsed/forwards/
  verifier/fallback/stop-reason records.
- eval_runner additive integration: details[] gain decode_outcome,
  stop_reason, fallback_used; suite metrics gain decode_outcome_counts.
- Census: only slm230 committed-SHA verifiable; hash-pinned the two
  remediated nonzero-timeout checkpoints; scoreboard classes separated
  (runtime_timeout/fallback/unmeasured/model_behavior).
- Preregistered 1x vs 10x budget sweep: all 12 cells not_rerunnable
  (v0 checkpoints fail current output-contract check); the 10x-flip
  question is honestly UNANSWERED by re-decode. Recommendation: retrain
  the remediated recipe on contract v2, then re-eval at both budgets.
- 25 new tests; harness.model_build.eval v50; component
  harness.experiments.slm303_decode_budget_audit v1; gates.ship v3
  threshold mirror fixed.
- slm308_distance_oracle.py: bounded reverse-BFS over canonical AST
  fingerprints via the real extended 11-action transitions; EXACT /
  BOUNDED / UNKNOWN labels (budget never conflated with distance);
  cache keyed by action-schema version, grammar sha, inventory, target
  and state hashes.
- tree_edit_diffusion: value_label_mode (bounded_distance default for
  new configs; pre-field checkpoints inject mutation_count for behavior
  parity, format stays 2); normalized oracle cost-to-go with UNKNOWN
  masked out of MSE; pairwise progress margin loss (independently
  tested); decode paths never read gold distance (audit test).
- Matched fixture experiment (mutation_count vs bounded_distance,
  identical budgets, near-gold + seed-trajectory states): rank corr
  0.433->0.505 (+0.072 < 0.10), beam regret 0.889->0.889 (+0.0 < 0.05),
  Brier 0.031->0.004, UNKNOWN coverage 0.175. Preregistered thresholds
  written before results; verdict honestly rejected at this budget.
- 16 new tests; slm308 component v1; slm299 component v3.
- Proposal instrumentation: per enumerated candidate — action, factor
  score, applicability, rejection reason (23 machine-readable codes),
  budget consumption; deterministic order; additive evidence keys.
- Distribution audit: training-target vs decode-demand action
  distributions by source/suite; dead-candidate rate ~0.98,
  applicable-ADD recall 0.10 baseline; preregistered reweighting rule.
- corruption_action_distribution knob (gold corpus untouched; default
  off = historical uniform; parity tested) and stop_slot_accounting
  legacy|corrected arm (STOP consumes an expansion slot only when its
  frozen candidate is retained; deterministic, regression-tested).
- Matched 2x2 (ADD-balanced x STOP arms, isolated levers): ADD target
  share 0.177 -> 0.328 (T1 +0.150 >= 0.10 both STOP arms), recall
  0.10 -> 0.16, corrected STOP budget <= legacy; verdicts adopted per
  preregistered rules; loss reweighting deferred to preserve isolation.
- 10 new tests; slm299 component v4; slm310 component v1.
- State-source harness: gold_only (existing corruption chain), seedward
  (offline oracle-guided walk from the seed toward gold, strictly
  distance-decreasing valid intermediates), on_policy (immutable
  content-addressed beam-trajectory snapshots: wrong states, verifier
  failures, abstentions); explicit provenance + gold-visibility policy
  per row; sha256 rows + tamper-evident manifest; fail-closed leakage
  guards (train vs held-out AST fingerprints).
- Matched {gold_only, seedward, on_policy, mixed} arms with predeclared
  weights/caps, identical model/steps/optimizer/seeds; evaluated on
  held-out seed trajectories. Verdict: rejected per preregistered
  primary gate (beam regret improvement 0.0 < 0.05); secondary signal
  (value rank corr -0.258 -> +0.258 for non-gold arms) recorded as
  wiring evidence only.
- 9 new tests; slm312 component v1.
…training

- Frozen multi-mode dataset (8 prompts x 2 verifier-accepted modes;
  canonical alpha-invariant AST fingerprints, sha256 rows + tamper-evident
  manifest; prompt count declared below ship-gate scale).
- WTA/MCL loss: backpropagate only the min-loss mode per example +
  preregistered floor term (eps=0.1) on losing modes; durable per-example
  selection telemetry. No set-FTPO machinery.
- Two-mode synthetic fixture proves single-gold CE collapses
  (p(mode B)=0.00004) while WTA retains both modes (p(B)=0.0083,
  p(A)=0.826 dominant); multi-gold spreads 50% mass to invalid hybrids.
- Matched arms {single_gold, multi_gold, wta} identical budgets: coverage
  0.750/0.500/0.500, hard-valid decode 1.0, v2 regression 0.000.
  Verdict rejected per preregistered coverage gate (WTA gain -0.25);
  at this scale single-gold lifts the sibling mode too.
- 16 new tests; slm314 component v1.
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
slm-training Error Error Jul 24, 2026 11:52pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Tyler-R-Kendrick, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bb74f9f-cb39-46e7-94a5-749014fb2353

📥 Commits

Reviewing files that changed from the base of the PR and between 34c70de and f6b1731.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (49)
  • README.md
  • docs/design/agentv-evaluation.md
  • docs/design/iter-slm303-decode-budget-audit-20260724.json
  • docs/design/iter-slm303-decode-budget-audit-20260724.md
  • docs/design/iter-slm305-edit-language-20260724.json
  • docs/design/iter-slm305-edit-language-20260724.md
  • docs/design/iter-slm308-distance-value-20260724.json
  • docs/design/iter-slm308-distance-value-20260724.md
  • docs/design/iter-slm310-action-alignment-20260724.json
  • docs/design/iter-slm310-action-alignment-20260724.md
  • docs/design/iter-slm312-state-sources-20260724.json
  • docs/design/iter-slm312-state-sources-20260724.md
  • docs/design/iter-slm314-winner-take-all-20260724.json
  • docs/design/iter-slm314-winner-take-all-20260724.md
  • docs/design/langsmith-telemetry-smoke-20260724.json
  • pyproject.toml
  • scripts/run_agentv_eval.mjs
  • scripts/run_slm299_reachability_audit.py
  • scripts/run_slm303_decode_budget_audit.py
  • scripts/run_slm308_distance_value.py
  • scripts/run_slm310_action_alignment.py
  • scripts/run_slm312_state_sources.py
  • scripts/run_slm314_winner_take_all.py
  • src/slm_training/evals/agentv.py
  • src/slm_training/harnesses/experiments/slm299_edit_reachability.py
  • src/slm_training/harnesses/experiments/slm308_distance_oracle.py
  • src/slm_training/harnesses/experiments/slm310_action_alignment.py
  • src/slm_training/harnesses/experiments/slm312_state_sources.py
  • src/slm_training/harnesses/experiments/slm314_winner_take_all.py
  • src/slm_training/harnesses/model_build/decode_outcome.py
  • src/slm_training/harnesses/model_build/eval_runner.py
  • src/slm_training/harnesses/model_build/ship_gates.py
  • src/slm_training/models/checkpoint_migrate.py
  • src/slm_training/models/tree_edit_diffusion.py
  • src/slm_training/resources/data/slm314_multimode/modes.jsonl
  • src/slm_training/resources/data/slm314_multimode/modes.jsonl.manifest.json
  • src/slm_training/resources/versions.json
  • src/slm_training/runtime/telemetry/trace.py
  • tests/test_evals/test_agentv.py
  • tests/test_harnesses/experiments/test_slm299_edit_reachability.py
  • tests/test_harnesses/experiments/test_slm308_distance_value.py
  • tests/test_harnesses/experiments/test_slm310_action_alignment.py
  • tests/test_harnesses/experiments/test_slm312_state_sources.py
  • tests/test_harnesses/experiments/test_slm314_winner_take_all.py
  • tests/test_harnesses/model_build/test_decode_outcome.py
  • tests/test_harnesses/model_build/test_eval_gates.py
  • tests/test_models/test_tree_edit_diffusion.py
  • tests/test_runtime_trace.py
  • tests/test_scripts/test_run_slm303_decode_budget_audit.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slm-314-winner-take-all

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 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not merging — branch is stale and merge is blocked well beyond versions.json. Findings from review of f6b1731 against current main:

  1. Stale-branch ship-gate regression. The PR changes MEANINGFUL_METRIC_POLICY['threshold_version'] from openui_ship_gates_v2 to v3, but main has been on openui_ship_gates_v4 since #764 ('Make AgentEvals criteria authoritative gates', 5de2958). Merging would revert the gate policy v4→v3 — exactly the gate-weakening the repo laws forbid.

  2. 14 files conflict, including code-semantics files (merge-tree vs main): src/slm_training/harnesses/model_build/eval_runner.py (7 newer main commits since base 528feeb), ship_gates.py, models/tree_edit_diffusion.py (5), models/checkpoint_migrate.py (2), evals/agentv.py, runtime/telemetry/trace.py, harnesses/experiments/slm299_edit_reachability.py (5), scripts/run_slm299_reachability_audit.py (3), tests/test_models/test_tree_edit_diffusion.py, tests/test_runtime_trace.py, docs/design/agentv-evaluation.md, docs/design/iter-slm305-edit-language-20260724.md, docs/design/langsmith-telemetry-smoke-20260724.json, and versions.json. Resolving these requires real code decisions, not a versions.json union.

  3. Partially superseded/duplicated content. This is a 6-ticket stacked PR (SLM-303/305/308/310/312/314). SLM-305 already merged separately as #842 (a3dab82, which also landed scripts/run_slm303_decode_budget_audit.py on main); the SLM-308 (#845), SLM-312 (#848), and SLM-303 (#911) sibling PRs were closed. The SLM-305/303 portions here are now duplicate churn against main.

Positive: the SLM-314-specific code itself looks sound — additive decode-outcome taxonomy (fail-closed: fallback outputs can never classify as model_valid), and the PR's own tests pass at its head (75 passed: test_slm314_winner_take_all, test_decode_outcome, test_tree_edit_diffusion, test_eval_gates), and verify_version_stamps + repo_policy are green.

Recommendation: rebase and split — land only the SLM-314-delta files (harnesses/experiments/slm314_winner_take_all.py, scripts/run_slm314_winner_take_all.py, slm314_multimode data, its docs + tests) on top of current main, keeping main's openui_ship_gates_v4 and the newer eval_runner/tree_edit_diffusion work, then resubmit as a single-ticket PR.

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner Author

Closing to drain the stale queue. Review comments above document the still-unique delta (SLM-310/314 harnesses) — re-open as a focused branch rebased on current main.

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.

1 participant