feat(benchmark): verified-retry orchestrator — production-legal best-of-N with a layered verifier - #504
Draft
eric-liu-nvidia wants to merge 1 commit into
Draft
feat(benchmark): verified-retry orchestrator — production-legal best-of-N with a layered verifier#504eric-liu-nvidia wants to merge 1 commit into
eric-liu-nvidia wants to merge 1 commit into
Conversation
…of-N with layered verifier Layered verification measured out of the TB-2.1 K3-max study: (1) executable checks derived blind from the task statement and run in the workspace, (2) confidence-gated LLM judge (accept >=0.85) as veto/fallback, (3) comparative pick over unverified candidates. Fresh workspace per attempt, early stop at first verified success, fail-closed on unparseable verdicts. Executor and LLM injected; stdlib-only core; 9 unit tests, no docker/network. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
A new standalone module
benchmark/verified_retry/implementing a best-of-N retry harness whose pass/fail decisions come from its own layered verifier — no benchmark answer key anywhere in the loop:checks.py) — an LLM writes a check script from the task statement before any attempt exists (prevents inheriting a solution's misreading of ambiguous requirements), and the script is executed in the attempt's workspace. Execution outranks opinion.judge.py::judge_attempt) — absolute verdict on demonstrated evidence, accepted only at confidence ≥ 0.85; acts as a veto over passing checks and as the sole verifier when nothing is machine-checkable. Unparseable verdicts fail closed.judge.py::judge_compare) — when no attempt verifies within budget, picks the most-likely-correct candidate from archived attempts; result is explicitly flaggedaccepted=False. Skipped when only one candidate exists.The orchestrator (
orchestrator.py) runs up tomax_attemptsexecutor attempts, each in a pristine copy of the task workspace (attempt independence), stops at the first verified success, and archives every attempt.Why (measured motivation)
From a TB-2.1 study with Kimi-K3-Max under the Claude Code harness (4 replicate runs per config):
Design boundaries
ExecutorFn,LlmFn): the core is stdlib-only, no provider SDK, no docker, no network.Testing
uv run pytest benchmark/verified_retry/tests -q— 10 tests, all passing: early stop on first verified success, retry-until-checks-pass, exhausted-budget comparative pick, crash never accepted, low-confidence veto, judge-only fallback when nothing is checkable, workspace-pristineness assertion per attempt, fail-closed on unparseable verdicts, single-candidate compare skip.Follow-ups (not in this PR)
LlmFnadapter (Anthropic-format client) and a container-backedExecutorFnfor real agent runs (needs a docker-capable host).🤖 Generated with Claude Code