Repository navigation
Add the BFCL v3 multi-turn categories - #449
Conversation
|
Written by the Claude Code session |
gregorybchris
left a comment
There was a problem hiding this comment.
This review was generated by an agent following
REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.
Nice work overall! The ground-truth replay check (4,700 calls, 800 of 800 graded correct) is exactly the right fidelity evidence. Dispatching calls by method lookup instead of eval is also a clear improvement on upstream. A few things should be addressed before merging.
I found three blocking issues. Two are parity divergences in the checker that I reproduced against upstream at the pinned commit (ac59a475). The first one probably explains the open miss_func/miss_param discrepancy. The third is a failure-visibility regression that the shared vllm_server change causes outside BFCL. After those come prompt fidelity, persisted diagnostics, and several duplication and reuse items.
Verification: On the PR head (0b277c08), ruff check, ruff format and ty all pass. ty prints one pre-existing warning in harness/sandbox/executor.py, which this PR doesn't touch. Unit tests: 3051 passed, 35 skipped.
Blocking
-
src/olmo_eval/common/scorers/bfcl/multi_turn/checker.py:161
The PR runsirrelevance_checkeras part of grading. Upstream at the pinned commit has the call commented out ineval_runner.multi_turn_runner(lines 129–134). The function exists inmulti_turn_checker.py, but nothing calls it.multi_turn_checkeritself justcontinues on an empty-truth turn, and the comment there says the calls are still executed "so that the state check at the next turn is accurate". I reproduced the difference withMathAPI: truth path[[], ["add(a=1, b=2)"]], and the model callsaddon both turns. This PR returnsmulti_turn:irrelevance_error:decoder_success. Upstream grades the entry correct. Onlymiss_funcandmiss_paramhave empty-truth turns, and those are exactly the two categories where Qwen3-8B (thinking off) is far below the reference (0.005 vs 0.155, 0.040 vs 0.135).baseandlong_contextare close. I expect this is the open discrepancy. Please drop the irrelevance check from the scored path so it matches the reference. If we want the stricter grading, it can land later as a versioned:v2variant. Sinceextracted_answer(the per-turn calls) is saved in the predictions, could you rescore the existing Qwen and Olmo runs without the check and post the newmiss_*numbers next to the reference? Please also add a regression test with an empty-truth turn where the model calls something and the entry is still valid. -
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:168(scorer) andsrc/olmo_eval/harness/scaffolds/bfcl_multi_turn.py:175
When the step budget runs out on a turn before the last one, the scaffold stops early, so the rollout has fewer turns than the ground truth. Upstream fails such an entry outright asmulti_turn:force_terminated(eval_runner.py:76–94). Here the missing turns are padded as empty. If every remaining turn has an empty ground truth, the entry is graded correct. Reproduced: truth[["add(a=1, b=2)"], []], with a rollout of 20addsteps on turn 0 and nothing after. This PR returns{'valid': True}. Upstream returnsforce_terminated. Please have the scorer return 0 witherror_type: multi_turn:force_terminatedwhenlen(rollout) != len(ground_truth), and add a test. Related nit: upstream's counter allows 21 executed steps before it force-quits (count += 1thenif count > MAXIMUM_STEP_LIMIT), whilerange(max_steps)allows 20. -
src/olmo_eval/inference/providers/vllm_server.py:1113,1123
_generate_or_mark_overflowchangesageneratefor every caller ofvllm_server, not only the BFCL scaffold. The runner's batch and chat paths checkrequest_error, so plain tasks still fail the instance. But two other callers read.textdirectly:src/olmo_eval/evals/external/benchmarks/scicode/eval.py:238(text = results[0][0].text). I reproduced this with a stubbed_generate_single_asyncthat raises a "maximum context length" error. On the base branch,ageneratereturns[[]]and SciCode raisesIndexError, so the instance fails. On this branch it returns[[LMOutput(text="")]], so SciCode extracts empty code for the step and scores it. A context overflow has become a silent zero, which the repo treats as a blocking failure-visibility problem.src/olmo_eval/common/scorers/llm_judge.py:363already turned the dispatch failure into""before this PR. That gap is in the existing framework (the one raised in #429), but the new marked output keeps it alive.
Could we make the marking opt-in so it only reaches the caller that asked for it? For example, the scaffold could catch the overflow itself, or
ageneratecould take a flag. Alternatively, add a small shared helper that raises onrequest_errorand use it in SciCode and the judge, e.g.:def first_output(outputs: Sequence[LMOutput]) -> LMOutput: """The first output of a request, raising if the provider marked it failed.""" error = request_error(outputs) if error is not None or not outputs: raise RuntimeError(error or "Provider returned no output.") return outputs[0]
Please add a test showing that a non-BFCL caller still fails on an overflow.
Non-blocking
-
src/olmo_eval/harness/scaffolds/bfcl_multi_turn.py:229
In prompting mode, execution results go back as one user message containingrepr(results), a list of bare strings. The comment says this matches the reference, but the model then can't tell which result belongs to which call. Upstream's API prompting path sendsrepr([{"role": "tool", "name": <decoded call>, "content": <result>}, ...])(model_handler/utils.py:format_execution_results_prompting). Its OSS handler, the one a local Olmo or Qwen would use, appends one{"role": "tool", "name": ..., "content": ...}message per result (oss_model/base_oss_handler.py:_add_execution_results_prompting). Which handler did the Olmo reference run use? Sincebaseis also below the reference (0.075 vs 0.130), this is the first thing I would check for the prompting gap. -
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:179,196
The PR notes thatbfcl_errordoesn't reach the saved predictions. The framework already has a channel that does:set_scorer_result(output, self.name, {...})fromcommon/scorers/base.py, whichbuild_predictionssaves underscorer_results. Could the scorer recorderror_typeanderrorthat way? The step-budget and context-overflow flags should go there too. Then a parse failure, a forced stop and an overflow can each be counted from the predictions file instead of the logs. That matters because overflow counts depend on the server'smax_model_len, which is not part of the task hash. -
src/olmo_eval/harness/scaffolds/bfcl_multi_turn.py:159
+1 to the existing thread comment. When a reply's tool calls fail to decode,_record_assistantstill writes the malformedtool_callsinto the history. vLLM then rejects the next request with a 400, and the instance is dropped from the denominator. That biases comparisons toward models that emit malformed calls. Please fold in the fix frompd_bfcl_multiturn-h038(9538453) or an equivalent, with its test. -
src/olmo_eval/inference/errors.py:64
is_context_overflowre-implements the exception-chain walk inclassify_terminal_provider_error(same file, line 20). Could both use one generator?def _exception_chain(exc: BaseException) -> Iterator[BaseException]: current: BaseException | None = exc seen: set[int] = set() while current is not None and id(current) not in seen: seen.add(id(current)) yield current current = current.__cause__ or current.__context__
-
src/olmo_eval/harness/scaffolds/bfcl_multi_turn.py:75
Thesupports_toolscheck and its error message duplicateHarness._check_tools_supported(harness/harness.py:97). Could that become a module-level helper (e.g.require_tool_support(provider)) that both call? Then the guard and its wording live in one place. -
src/olmo_eval/common/scorers/bfcl/multi_turn/execution.py:63
parse_call_stringsrepeats the dotted-name walk fromresolve_ast_call(common/scorers/bfcl/decoding.py:107). Could we factor out acall_name(node: ast.Call) -> strindecoding.pyand use it in both places? -
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:227–260, 332, 349
BFCLMultiTurnTaskre-implements most ofBFCLTask: theDataSource(path=BFCL_REPO, ..., revision=BFCL_REVISION)construction (three times here, twice in__init__.py), the lazy_load_answerscache, theinstancespassthrough,format_request, and thetype(...)plussetattr(module, ...)registration loop. Could the shared parts move to a small base class, e.g. a_BFCLDataTaskwith a_load(data_files)helper and the answer cache, that both tasks extend? The guide also asks us to replace dynamictype()generation with__init_subclass__or one class plus configuration. With a shared base, both registration loops can be fixed at once. I'm fine with that as a follow-up issue, since #429 introduced the pattern. -
src/olmo_eval/evals/suites/bfcl.py:101andsrc/olmo_eval/evals/tasks/bfcl/multi_turn.py:60
MULTI_TURN_CATEGORIESis defined twice. Please keep one, in the task module, and import it in the suite. That direction is allowed: suites may import from tasks.
Nits
- Nit:
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:91:category_from_idis used only by a test, and it shadows the package'scategory_from_id, which has different semantics (it keeps the prefix). Please remove it, or rename it if it gets a caller. - Nit:
src/olmo_eval/harness/scaffolds/bfcl_multi_turn.py:84:payload.get("max_steps", ...)is never set by the formatter. Please remove the parameter or make it a task setting. - Nit:
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:280:Languageandprepare_function_docsare imported insideprocess_docfrom modules that are already imported at the top of the file. - Nit:
src/olmo_eval/evals/tasks/bfcl/multi_turn.py:324:"functions": visiblehas no consumer in the multi-turn path. - Nit:
src/olmo_eval/common/scorers/bfcl/multi_turn/checker.py:127: the inlinefrom .execution import parse_call_stringscan join the top-level import from the same module. - Nit:
LONG_CONTEXT_CATEGORIESis a one-element frozenset.self.category == "long_context"says the same thing.
Before merge
Please make the following changes, each with a regression test:
- Remove the irrelevance check from scoring, and report rescored
miss_*numbers next to the reference. - Fail entries that were force-terminated early.
- Keep the context-overflow marking from reaching SciCode and the judge as an empty reply.
After that, you can merge once #429 lands, the branch is rebased, and CI is green. Please open follow-up issues for:
- the shared BFCL task base and removing the
type()registration (non-blocking item 7); - the framework gap where dispatch turns a provider exception into an empty output for direct
ageneratecallers.
0b277c0 to
925827e
Compare
|
Thanks for the review. All three blocking items are addressed in 925827e. The branch is rebased onto #429, which now includes a3265e5 (see the note at the end). Blocking 1: irrelevance check. Removed from the scored path. Upstream defines the check but never calls it. I confirmed that at the pinned commit Before rerunning, I regraded the saved rollouts without the check. The reruns came out close to that prediction:
That closes Blocking 2: force-terminated. A rollout with fewer turns than the ground truth now scores 0 as Blocking 3: overflow reaching other callers. I took the helper route rather than making the marking opt-in. With opt-in, an ordinary task whose prompt overflows would go back to dispatch's empty output and score zero silently, whereas the runner already records a marked reply as a failed instance. SciCode now reads its reply through Non-blocking
All six nits are done. Rerun results (
Qwen3-8B with thinking on is still running and will be added to the description when it finishes. Also fixed, in #429 (a3265e5). While working on this I found that #429's new Local checks pass (ruff, format, |
The multi-turn categories are graded on what a model's calls did, not on what it wrote: after each turn the involved API instances must hold the state the ground truth path leaves them in, and everything the ground truth's calls returned must also have come back from the model's. The API classes are vendored from the reference implementation, which is where the benchmark defines them; an instance's attributes after a turn are what a prediction is compared against, so reimplementing them would change the scores. They are kept as they are upstream apart from their imports, and are excluded from linting so they stay that way. Each simulates its domain in memory, with no file, network or process access. Calls are dispatched by looking the method up on the instance that defines it, rather than rendering them back to source and evaluating them as the reference does. Calls arrive already decoded, so nothing a model writes is executed as code, and it can reach only methods the involved classes have. Replaying every ground truth path executes 4,700 calls across multi_turn_base, miss_func, miss_param and long_context without a single failure, and the checker passes all 800 of those rollouts while rejecting every rollout with a call removed. multi_turn_composite is left out. Its ground truth calls an older signature than the other categories do, and some of its calls are not valid Python, so it cannot execute against the classes any version of the reference ships; it is also absent from the v3 multi-turn summary. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
They are kept as they are upstream, so their diagnostics are not ours to fix and would drown the ones that are. Lint already skips them for the same reason. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
A multi-turn entry is a conversation rather than a single request: for each user turn the model is asked for calls, those calls run against the entry's API instances, their results come back as the next message, and the turn ends when the model stops calling. Both regimes are driven the same way, differing only in whether calls arrive as tool_calls answered with tool messages, or as text answered in the user's next message. The rollout's instances only exist to answer the model. What it did is graded afterwards by replaying its calls against fresh instances, which keeps a score independent of anything the rollout left behind. Two of the categories perturb the conversation, and both are handled here: a turn may hold back functions the model needs, offering them partway through with a stock message, which a prompted model needs spelled out since it has no tool list to update; and a turn may be one the model cannot satisfy yet, where calling nothing is what is being measured. Scaffolds only receive the request, and nothing carried the state a rollout acts on, so LMRequest gains a metadata field for a task to hand one a payload. Replaying every ground truth path through the scaffold and the checker scores 174 of 200 entries correct in each category. The rest are the entries whose ground truth writes an argument positionally, which model-side decoding drops as it does upstream; the same paths written the way the benchmark asks a model to write them score 99 in 100. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
An entry names the API classes it involves rather than carrying their functions, so the documents are assembled here from the dataset's per-class files, through a mapping that does not always follow the class names. One category holds functions back until a turn partway through: those are resolved from the names the entry gives, taken out of the tools the model is shown, and handed to the scaffold to offer at their turn. Both halves share one sanitized name map, so a call made after a function is offered still reads back under the name the dataset gives it. Driving a rollout needs the bfcl_multi_turn scaffold, which a task cannot ask for, so a harness preset carries it and the scorer refuses a reply with no recorded rollout rather than scoring it zero; a missing harness would otherwise read as a weak model. bfcl:multi_turn averages the four categories as equals, as the leaderboard does. There is no base regime: a pretrained model is not asked to drive a twenty-step tool-executing rollout. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
The prompting formatter inherits from the tool calling one, which sends the function schemas, so a prompted rollout was given its functions twice: once in the system prompt it is meant to read them from, and again as schemas. A model answering the second way would have produced calls this regime does not read, and a server not configured to parse tool calls would have refused the request outright. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
…mode The scaffold added each held-back function to the tool list whatever the regime, so the first miss_func turn gave every later request a tool list. A server started for prompting rejects those, which failed all 200 instances of bfcl_multi_turn_miss_func:prompt and tripped the hard failure gate. The prompting path already announces the functions in the message, so the schemas only belong in the tool list when the model calls natively. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
A prompted rollout announced the functions a miss_func turn offers by formatting the tool API schemas, while the system prompt had written the rest as BFCL function documents. The model was handed a function in a dialect it had not seen anywhere else in the conversation. The task now renders the offer alongside the schemas the tool regime needs, and a prompted rollout that reaches a turn without one is refused rather than falling back to the schemas. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
The rendered documents were put on the instance but not copied into the request, so a prompted rollout reached a miss_func turn without them and was refused. The payload test now reads the offer off the request, which is what the scaffold sees. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
The rollout asked for a flat 1024 tokens at temperature 0. It now samples like the single-turn regimes: up to 4096 tokens, cut back to the room the conversation leaves in the context window, at temperature 0.001. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
A long conversation can grow past the model's context window partway through. The reference implementation records that failure as the model's answer and grades the entry wrong. Here it failed the instance instead, and enough of them failed the whole long context category on a model with a 40k window. vLLM's rejection of an over-long prompt is now returned as a marked reply rather than raised. Retrying such a request cannot succeed. The multi-turn rollout ends on that reply and the scorer gives it zero. Every other failed request still fails its instance. A step that gets no reply at all now says so, where it used to raise an IndexError. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
Such an entry is graded wrong without failing, and the reason the scorer records is not kept with the saved predictions, so nothing showed how many entries a run lost this way. The scaffold now logs each one, as it does for an exhausted step budget. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
The harness leaves tool support to a scaffold, since most scaffolds send their tools over their own client. This one sends its schemas through the provider, so on a provider that drops them a native function calling rollout would show the model no functions and score zero. The scaffold now refuses that case itself. The examples no longer pass enable_auto_tool_choice, which the runner now sets whenever a task sends tool schemas. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
… recorded as text, not re-sent as tool_calls vLLM re-renders the history through the chat template and answers 400 when an assistant turn carries tool-call arguments that do not decode to an object, so the next step got no reply and the entry was dropped from the run (excluded from the denominator). The reference grades such a step wrong and goes on; so does this now: the step still reads as no calls, the model's words stay in the history as text, and the rollout continues. Seen on H038's control arm (5 of the first 18 entries) with the qwen3_xml parser. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YF5pJMhpQYBzsXcJ3rGcP5
Grading now matches the reference implementation: - The irrelevance check is no longer run. The reference defines it but never calls it, so a call on a turn the ground truth leaves alone was failing entries the reference passes. - A rollout with fewer turns than the ground truth scores zero as force_terminated. It was padded with empty turns, which passed when the remaining ground truth was empty. - A turn stops once more than the step limit has run, as the reference counts, so it can run 21 steps rather than 20. The limit is a scaffold setting rather than an unused payload key. - A prompted model gets each result back as a tool message named after the call that produced it, as the reference handler for local models sends them, instead of one user message listing bare results. A context overflow marked on a reply no longer reaches a direct caller as an empty answer. SciCode and the LLM judge read replies through first_output, which raises on a reply the provider marked failed; the judge still returns an empty string when nothing came back at all. Each prediction's scorer_results now records whether the entry passed, why it failed, and whether a turn ran out of steps, so these can be counted from the predictions file. The tool-support check, the exception-chain walk and the dotted call-name walk each live in one place now, MULTI_TURN_CATEGORIES is defined once, and an unused helper, payload entry and constant are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
925827e to
0733a26
Compare
Follows #429, which is merged; this PR is rebased onto
main.Adds the BFCL v3 multi-turn categories. Each entry is a conversation against stateful APIs, and it is graded on what the model's calls did, not on what it said.
What is measured
A multi-turn entry gives the model a sequence of user turns and a set of API classes: a file system, trading, travel booking, messaging, vehicle control, ticketing and maths. Within a turn the model calls functions, the calls run against live in-memory instances, the results come back as the next message, and the turn ends when the model stops calling, with a limit of 20 steps. After each turn the model's instances must hold the same state as instances driven by the ground-truth calls. Everything the ground-truth calls returned must also have come back from the model's calls, compared unordered and cumulatively.
bfcl_multi_turn_basebfcl_multi_turn_miss_funcbfcl_multi_turn_miss_parambfcl_multi_turn_long_contextbfcl:multi_turnaverages the four as equals, as the leaderboard does. Each task also exists as:prompt, using BFCL's prompting mode. There is no:baseregime: a pretrained model isn't asked to drive a 20-step rollout that executes tools.multi_turn_compositeisn't registered. Its ground truth calls an older signature (add_to_watchlist(stocks=[...])) than the classes the other categories need, and some of its calls aren't valid Python. No single version of the reference implementation's classes can execute it. It's also absent from the v3 multi-turn summary.No server flags are needed: after #429, the runner turns on tool-call parsing whenever a task sends tool schemas.
How it's built
common/scorers/bfcl/multi_turn/api/) are vendored from gorilla commitac59a475d3. That's the version the v3 ground truth was written against; later versions changed signatures it calls. All nine files match that commit exactly apart from their import lines. Keeping them identical matters because an instance's attributes are what gets graded. They're excluded from ruff andtyinpyproject.toml. They simulate everything in memory, with no file, network or process access.execution.py) dispatches each call by name onto the involved instances. Upstream runseval()on a generated string instead. Positional arguments are kept, since some ground-truth calls use them. A call that fails to parse or raises becomes that call's result, and the calls after it still run.checker.py) ports upstream's multi-turn checker: a state comparison over public attributes and the unordered, cumulative response check.main.force_terminated, as upstream does.harness/scaffolds/bfcl_multi_turn.py) drives one entry per instance through thebfcl_multi_turnpreset.max_stepsin the harness'sscaffold_kwargschanges the limit.miss_funcit offers the withheld functions at their turn, as tool schemas when calling natively or written out in the prompt's own format when prompted.cd(folder='temp')), as upstream's handler for local models sends them.evals/tasks/bfcl/multi_turn.py) assembles each entry's function documents from the dataset's per-class files and splits off the withheld ones before the model sees either half.scorer_results.bfcl_multi_turnrecords whether the entry passed, itserror_typeanderrorif it didn't, and whether a turn ran out of steps. Failures can be counted from the predictions file.Fidelity check: replaying the dataset's own ground-truth paths through execution and grading runs 4,700 of 4,700 calls without error and grades all 800 of 800 rollouts correct.
Sampling and context overflow
The rollout samples the way the single-turn regimes do after #429: up to 4096 tokens at temperature 0.001, cut back to whatever room the conversation leaves in the context window.
A conversation can still outgrow the window partway through, mostly in
long_contexton models with smaller windows. Upstream catches the error, records it as the model's answer and grades the entry wrong. This PR does the same:vllm_serverreturns a context-overflow rejection as a marked reply (CONTEXT_OVERFLOW_KEYininference/errors.py) instead of raising. Dispatch used to retry such a request, which can never succeed.error_type: multi_turn:context_overflow.Every other failed request still fails its instance. The runner already records a marked reply as a failed instance. Callers that read replies directly, SciCode and the LLM judge, now go through
first_output, which raises on a marked reply, so an overflow there doesn't read as an empty answer.Shared code touched
LMRequest.metadata(new, optional) carries the per-instance rollout payload to the scaffold. It isn't sent to the model, and the harness passes it through_apply_config.inference/errors.py:CONTEXT_OVERFLOW_KEY,is_context_overflowandis_context_overflow_output.first_output.classify_terminal_provider_error.inference/base.py:require_tool_support, used by both the harness guard from Add the BFCL chat regimes: native function calling and prompting #429 and this scaffold. The guard trusts scaffolds, and this one sends its schemas through the provider, so it checks for itself.vllm_server: the overflow marking above.scicode/eval.pyandcommon/scorers/llm_judge.py: replies read throughfirst_output. The judge still returns""when nothing came back at all, as it did before.common/scorers/bfcl/decoding.py:call_name, shared by single-turn decoding and the parsing of ground-truth calls.Results
On commit
925827e1. Every instance was saved, and none failed. The thinking-on run used--no-preemptible; the others ran as preemptible jobs.Failures counted from
scorer_results:miss_func)long_context)long_context)miss_func)long_context)Against the original BFCL implementation
USE_THINKING: 0, originalBoth references ran a modified BFCL build (
shashankg/bfcl-latest), not upstream, at temperature 0 rather than upstream's default of 0.001.allenai/general-tool-use-dev) withUSE_ENVIRONMENT_ROLE=1andUSE_OPENAI_FUNCTION_DEFINITION_FIXES=1. It also ran a checkpoint namedgrpo_all_mix_p64_4_8k_olmo3-instruct-dpo-lbc-v2__1__1763365141_checkpoints_step450, which has been described as the same model asallenai/Olmo-3-7B-Instruct. Olmo 3's chat template renders atoolmessage exactly as anenvironmentone, so the result format here matches that run.Effect of the review fixes
From the previous runs of this PR. Before the reruns, I regraded those runs' saved rollouts without the irrelevance check, and the reruns came out close to that prediction.
miss_parammiss_funcbaseOpen discrepancy
These still disagree with the original implementation:
miss_func: 0.030 against 0.155. The irrelevance check accounted for themiss_paramgap, which is now 0.125 against 0.135, but not this one. Most failures (107 of 194) are the model making no call at all on the turn where the withheld function is offered. I checked that the offered schema arrives intact and isn't visible before its turn. I haven't found the cause.base(0.065 against 0.130). Changing the result format to match upstream didn't close the gap. The reference's modified handler and its function-definition fixes are differences this PR doesn't reproduce.long_contextfell in both FC runs: Olmo from 0.055 to 0.035, with no overflows, forced stops or step-limit hits, and Qwen with thinking on from 0.290 to 0.240, with 26 overflows against 23 before. Run-to-run variation at temperature 0.001 could account for some of it. So could the fix that keeps malformed tool calls in the history as text, which changes what later steps see. I haven't separated the two.The Qwen
miss_funcand Olmo numbers should be read as provisional until these are explained.Not included
multi_turn_composite(see above).:baseregime.🤖 Generated with Claude Code
https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu