Skip to content

Check the multi-turn scaffold before generation and keep every turn - #489

Merged
gregorybchris merged 2 commits into
mainfrom
chrisg/mt-bench-followups
Oct 17, 2026
Merged

gregorybchris merged 2 commits into
mainfrom
chrisg/mt-bench-followups

Conversation

@gregorybchris

@gregorybchris gregorybchris commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

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 shared JudgePrompt type, is left for #474. Scores and task hashes don't change.

Follow-up from #476 Reproduced on main In this PR
Check the required scaffold before generation Yes, and worse than described: the task does not fail at all Yes
One record per turn in place of parallel lists Yes: earlier turns' text and token counts are lost Yes
Run-level cap_hit and unclosed_think see only the final turn Yes Yes
Shared JudgePrompt type for MT-Bench and Arena-Hard n/a No, see below

What 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_failure turns the scoring exception into a 0.0 per scorer, and the task finishes as Success:

$ uv run olmo-eval run -m mock -t multi_if -o limit=3 --no-upload
WARNING Failed to score multi_if[0]: A Multi-IF output has no per-turn replies. ...
│ multi_if │ Success │ 3/3 │ ... │ accuracy:multi_if │ 0.0000 │

mt_bench behaves 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_chat scaffold:

  • The predictions file had only the last reply's text. Earlier replies, which both tasks score, were not saved anywhere: build_predictions never copied replies.

  • completion_tokens was the last turn's. A two-turn conversation that generated 500 + 7 tokens reported 7. prompt_tokens was 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_reason was the last turn's. The run-level cap_hit count and the dashboard's truncation count, which reads finish_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_think read only the final text:

    # Turn 1 hit the limit inside <think>; turn 2 stopped cleanly.
    count_generations(...) -> {'generations': 1, 'cap_hit': 0, 'unclosed_think': 0, ...}
    

Changes

  • Task.required_scaffold. It is a class attribute, so it is outside TaskConfig and no task hash moves. AsyncEvalRunner checks it while it prepares tasks, before it loads the task's data, starts workers, or loads a model. MTBench and MultiIF set it to multi_turn_chat. The scoring-time missing_replies_error stays as a backstop.
    RuntimeError: Failed to prepare 1 task(s):
      - mt_bench: mt_bench has to run under a harness with scaffold=multi_turn_chat, for example
        `--harness multi_turn_chat`; harness 'default' has no scaffold.
    
  • turns in place of replies and turn_finish_reasons. The scaffold stores one record per turn: text, finish_reason, and prompt_tokens / completion_tokens when the provider reports them. build_predictions saves it, so every turn's reply reaches the predictions file. turn_replies reads it, and Multi-IF and MT-Bench are otherwise unchanged.
  • The conversation's own fields describe the whole conversation. The final output's prompt_tokens and completion_tokens are 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 and runners/common/usage.py document this. finish_reason is "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_truncated goes back to reading finish_reason alone.
  • count_generations counts a conversation as unclosed_think if any turn's reasoning never closed. It still counts the conversation once.

Not changed

Compatibility

  • No change to prompts, data, extraction, metrics or sampling, and no task hash moves. MT-Bench's truncation_rate keeps the same meaning (any turn hit the limit, or the conversation was cut short).
  • Multi-turn prediction records gain a turns field. The old replies and turn_finish_reasons metadata keys never reached saved predictions, so no stored file loses anything.
  • For multi-turn outputs, prompt_tokens / completion_tokens / finish_reason in the predictions now describe the whole conversation, not the last turn. A per-instance prompt_tokens is therefore larger than the longest prompt the model saw.

Testing

  • Scaffold tests: per-turn records, token totals, an unknown total when a turn lacks counts, and the conversation finish reason, including after a context overflow on the first or a later turn.
  • New tests for:
    • count_generations with an unclosed earlier turn
    • build_predictions keeping turns
    • AsyncEvalRunner._prepare_tasks refusing mt_bench without the scaffold, or under another scaffold, before the data loads; and accepting it under multi_turn_chat. The refusal and ordering tests fail on main. The acceptance test is a positive control and passes on both.
  • MT-Bench's truncation_rate is 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/, and uv run pytest tests/ --ignore=tests/integration (3,887 passed, 35 skipped) all pass.
  • Mock runs: olmo-eval run -m mock -t mt_bench -o limit=2 --no-upload now fails during task preparation. olmo-eval run -m mock --harness multi_turn_chat -t multi_if -o limit=2 --no-upload completes, 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_if under --harness multi_turn_chat, -o limit=20 -o max_tokens=512, commit 4a891cbe, 1× B300 on ai2/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 commit 03766e93, 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.

Check Result
Every saved turn record has text, finish_reason, prompt_tokens, completion_tokens 20/20 conversations (2–3 turns each)
Conversation prompt_tokens / completion_tokens equal the sums over turns 20/20
Conversation finish_reason is "length" exactly when some turn hit the limit 20/20
metrics.json prompt_tokens_total / completion_tokens_total equal the sums over predictions 22,065 / 27,388, both match
Conversations where only an earlier turn hit the limit, missed by cap_hit on main 2 (now counted; cap-hit 16/20)
Conversations where only an earlier turn's <think> never closed, missed on main 6 (now counted; unclosed-think 10)

Experiment: 01M53T20. An earlier attempt, 01M53SSS, failed while installing packages (No space left on device with --uv-cache-dir /tmp/uv-cache), before any eval code ran.

🤖 Generated with Claude Code

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]>
@gregorybchris
gregorybchris requested a review from a team as a code owner October 17, 2026 02:00
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]>
@gregorybchris
gregorybchris merged commit 1077555 into main Oct 17, 2026
8 checks passed
@gregorybchris
gregorybchris deleted the chrisg/mt-bench-followups branch October 17, 2026 02:38
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