Repository navigation
Check the multi-turn scaffold before generation and keep every turn - #489
Merged
Merged
Conversation
Follow-ups from #476 (MT-Bench): - Tasks declare `required_scaffold`; the runner refuses a task whose harness lacks it while preparing tasks. Without the scaffold, Multi-IF and MT-Bench reported Success with a score of 0.0. - The multi_turn_chat scaffold stores one record per turn under `turns` (text, finish reason, token counts) in place of the parallel `replies` and `turn_finish_reasons` lists, and the predictions file keeps it. Before, only the last turn's text reached the predictions. - The conversation's own token counts add up every turn, and its finish reason is "length" if any turn hit the limit. Run-level cap-hit counts, token totals and the dashboard's truncation stats saw only the last turn. - unclosed_think counts a conversation if any turn's reasoning never closed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review follow-ups: - A conversation that outgrew the context before its last turn now reports finish_reason "length", so run-level cap-hit and the dashboard's truncation count include it, as MT-Bench's truncation_rate already did. - Document that a conversation's prompt_tokens sums every turn's prompt, which repeats the earlier turns: it is compute spent, not the longest prompt. - Check the required scaffold before prepare_task_items loads the data. - Test MT-Bench's truncation_rate on conversations produced by the scaffold. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 17, 2026
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.
Summary
Implements the follow-ups listed in #476 (MT-Bench). Each one was reproduced on
main(f886f53f) before it was changed. Three of the four needed fixing. The fourth, the sharedJudgePrompttype, is left for #474. Scores and task hashes don't change.maincap_hitandunclosed_thinksee only the final turnJudgePrompttype for MT-Bench and Arena-HardWhat was wrong
A missing scaffold produced a passing 0.0 score. #476 said Multi-IF and MT-Bench "fail at scoring time". In fact the runner's
_record_scoring_failureturns the scoring exception into a 0.0 per scorer, and the task finishes as Success:mt_benchbehaves the same (score:mt_bench_judge 0.0000, Success).Only the last turn reached the run's records. For an output from the
multi_turn_chatscaffold:The predictions file had only the last reply's
text. Earlier replies, which both tasks score, were not saved anywhere:build_predictionsnever copiedreplies.completion_tokenswas the last turn's. A two-turn conversation that generated 500 + 7 tokens reported 7.prompt_tokenswas the last call's prompt, which leaves out the tokens spent on earlier calls. Neither was marked unknown, so the runner's task totals and the dashboard's token stats were silently low.finish_reasonwas the last turn's. The run-levelcap_hitcount and the dashboard's truncation count, which readsfinish_reason == "length"per row, missed a turn that hit the limit before the final one. They also missed a conversation that outgrew the context before its last turn.unclosed_thinkread only the final text:Changes
Task.required_scaffold. It is a class attribute, so it is outsideTaskConfigand no task hash moves.AsyncEvalRunnerchecks it while it prepares tasks, before it loads the task's data, starts workers, or loads a model.MTBenchandMultiIFset it tomulti_turn_chat. The scoring-timemissing_replies_errorstays as a backstop.turnsin place ofrepliesandturn_finish_reasons. The scaffold stores one record per turn:text,finish_reason, andprompt_tokens/completion_tokenswhen the provider reports them.build_predictionssaves it, so every turn's reply reaches the predictions file.turn_repliesreads it, and Multi-IF and MT-Bench are otherwise unchanged.prompt_tokensandcompletion_tokensare the sums over turns. They are left out if any turn did not report them, so a total is unknown rather than low. Each turn's prompt repeats the conversation so far, so the prompt total is the compute spent, not the length of the longest prompt: a final prompt of 520 tokens after a first prompt of 10 gives 530. The scaffold andrunners/common/usage.pydocument this.finish_reasonis"length"if any turn hit the limit or the conversation outgrew the context before its last turn, and otherwise the last turn's. The runner's usage totals,cap_hit, saved predictions, and the upload client therefore need no multi-turn special cases.judge.is_truncatedgoes back to readingfinish_reasonalone.count_generationscounts a conversation asunclosed_thinkif any turn's reasoning never closed. It still counts the conversation once.Not changed
JudgePrompttype. Arena-Hard (Add Arena-Hard v2.0 with pairwise judging and style control #474) is still a draft. Until it merges, MT-Bench would be the type's only user, and AGENTS.md asks for hooks to land with their first consumer. Arena-Hard also has a different shape: one user template, with a system prompt per category. Add Arena-Hard v2.0 with pairwise judging and style control #474 can moveJudgePromptfrommt_bench.pyintocommon/judge.pywhen it rebases._record_scoring_failure(runners/asynq/results.py) still turns any exception other thanScoringIncompleteErrorinto a score of 0.0 for every task. The scaffold check removes the case Add MT-Bench with FastChat's single-answer judging #476 hit, but the general behavior conflicts with "failures aren't scores" and deserves its own PR.Compatibility
truncation_ratekeeps the same meaning (any turn hit the limit, or the conversation was cut short).turnsfield. The oldrepliesandturn_finish_reasonsmetadata keys never reached saved predictions, so no stored file loses anything.prompt_tokens/completion_tokens/finish_reasonin the predictions now describe the whole conversation, not the last turn. A per-instanceprompt_tokensis therefore larger than the longest prompt the model saw.Testing
count_generationswith an unclosed earlier turnbuild_predictionskeepingturnsAsyncEvalRunner._prepare_tasksrefusingmt_benchwithout the scaffold, or under another scaffold, before the data loads; and accepting it undermulti_turn_chat. The refusal and ordering tests fail onmain. The acceptance test is a positive control and passes on both.truncation_rateis tested on conversations produced by the scaffold: one that hit the token limit on turn 1 only, one that outgrew the context on turn 2, and one that finished.uv run ruff check src/ tests/,uv run ruff format --check src/ tests/,uv run ty check src/, anduv run pytest tests/ --ignore=tests/integration(3,887 passed, 35 skipped) all pass.olmo-eval run -m mock -t mt_bench -o limit=2 --no-uploadnow fails during task preparation.olmo-eval run -m mock --harness multi_turn_chat -t multi_if -o limit=2 --no-uploadcompletes, and its predictions keep both turns.Beaker check with real vLLM output
The mock provider reports no token counts or finish reasons, so one small run checked the new fields against real vLLM output: Qwen3-8B (thinking),
multi_ifunder--harness multi_turn_chat,-o limit=20 -o max_tokens=512, commit4a891cbe, 1× B300 onai2/holmes,ai2/oe-olmo3p5-eval. The low token budget makes turns stop inside<think>, which exercises the counts. The accuracy (0.42) is not a meaningful score at this budget. The run predates the review commit03766e93, which changes the finish reason only for conversations that outgrew the context. None did here: the largest prompt was 1,399 tokens. So the figures below hold for the current head.text,finish_reason,prompt_tokens,completion_tokensprompt_tokens/completion_tokensequal the sums over turnsfinish_reasonis"length"exactly when some turn hit the limitmetrics.jsonprompt_tokens_total/completion_tokens_totalequal the sums over predictionscap_hitonmaincap-hit 16/20)<think>never closed, missed onmainunclosed-think 10)Experiment: 01M53T20. An earlier attempt, 01M53SSS, failed while installing packages (
No space left on devicewith--uv-cache-dir /tmp/uv-cache), before any eval code ran.🤖 Generated with Claude Code