Repository navigation
Add BFCL v3 single-turn categories as a completion task - #387
Merged
Merged
Conversation
The Berkeley Function Calling Leaderboard grades a reply by comparing the calls it made against a list of accepted values per parameter, so an answer is right when it names the right function and supplies values the benchmark accepts. Its checker is vendored under common/scorers/bfcl rather than depended on: the bfcl-eval package pins numpy==1.26.4 and pulls faiss, sentence-transformers, anthropic and cohere, which does not coexist with the vLLM environment here. BFCL addresses an instruction-tuned model, through a chat template or a tool calling API. This registers its single-turn categories as a plain completion instead, so a pretrained model with no chat template can be measured on the same instances: the instruction, the function documents and the question form one block of text that the model continues with its calls. The exemplars carrying the answer format are hand-written rather than sampled, so none is drawn from the evaluated set, and they cover the shapes a category can take. One of them declines to call anything, without which a base model calls something on nearly every instance and the irrelevance categories measure nothing. Decoding also accepts the JSON tool-call formats models pick up during pretraining, so a reply is judged on the function it chose rather than the surface form it reached for. BFCL weights its live summaries by how many instances each category holds, which a suite average cannot express, so those summaries are tasks that pool their categories' instances. Two deliberate departures from the reference, both commented where they happen: an arithmetic argument is folded rather than passed to eval, which would run whatever a model wrote; and the v3 prompt is reproduced verbatim, including its wording slips and its rendering of function documents as a Python repr under a sentence calling it JSON, because changing either moves the scores. Replaying BFCL's own possible answers back through the checker reproduces 999/1000 non-live Python, 1344/1351 live, 92/100 Java and 49/50 JavaScript. Every remaining case is a dataset quirk the reference checker fails identically, such as simple_363, whose possible answer names find_closest while its function document names restaurant_search.find_closest. The chat regimes BFCL was built for follow separately. Multi-turn is left out because scoring it needs BFCL's stateful API backend, and the executable and REST categories because they grade by running the predicted calls against live third-party APIs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
gregorybchris
approved these changes
Sep 18, 2026
The task's section had grown to the longest in the top-level README while covering one benchmark, so it moves to a README beside the code, matching how olmo_eval/analysis and olmo_eval/cli/results document themselves. The task module becomes a package so it has a directory to hold it. The top-level README keeps a short pointer, so the benchmark is still findable from the feature list without carrying its category tables, exemplar settings and checker notes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
The exemplars are written in the task module rather than drawn from a dataset, so nothing about them reached TaskConfig: fewshot_source was None, and the task hash moved only with num_fewshot. Replacing an exemplar outright left the hash byte-identical, so two runs prompted differently shared an identity, and the three languages' sets were indistinguishable in a stored configuration. fewshot_source now names the set, as minerva_math names its fixed one. The name carries a digest of the exemplar text as well, because these exemplars are expected to be revised and a name alone would still let an edit reuse an earlier run's hash; a task that shows none of them takes a new hash too, which errs towards a fresh identity over a silently shared one. The field is only recorded, not resolved: the exemplars are built directly, so nothing looks the name up as a data source. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu
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.
Registers the BFCL v3 single-turn categories, reformulated as a completion so a
pretrained model with no chat template can be measured on them. The chat regimes
BFCL was built for (native function calling, and BFCL's own prompting mode) follow
in a separate PR.
What this adds
common/scorers/bfcl/— the vendored AST checker, decoder, Java/JavaScriptparsers and value converters, and one scorer that dispatches on category.
evals/tasks/bfcl/— 15 tasks (13 categories plus two pooled live tasks), thecompletion formatter, hand-written exemplars per language, and the benchmark's
own README; the top-level README keeps a pointer rather than the detail.
evals/suites/bfcl.py— five suites reproducing BFCL's own summaries.The exemplars are written in the task module rather than drawn from a dataset, so
fewshot_sourcenames the set that produced a run's prompts — the wayminerva_mathnames its fixed set — with a digest of the exemplar text, so thatrevising an exemplar cannot reuse an earlier run's task hash.
uv run olmo-eval run -m my-base-model -t bfcl uv run olmo-eval run -m my-base-model -t bfcl_simple:2shot # :0shot .. :5shot, default 5Why vendored
bfcl-evalon PyPI pinsnumpy==1.26.4and pulls faiss, sentence-transformers,anthropic and cohere. That does not coexist with the vLLM environment here, so the
checker is vendored instead. Java and JavaScript need tree-sitter grammars, declared
as task-specific dependencies so no other category installs them.
Fidelity
Replaying BFCL's own possible answers back through the checker reproduces
999/1000 non-live Python, 1344/1351 live, 92/100 Java, 49/50
JavaScript. Every remaining case is a dataset quirk the reference checker fails
identically — e.g.
simple_363, whose possible answer namesfind_closestwhile itsfunction document names
restaurant_search.find_closest.Two deliberate departures, both commented in the source:
eval, which would runwhatever the model wrote.
rendering of function documents as a Python repr under a sentence calling it
JSON — changing either moves the scores.
Results
Full suite, 3641 instances per run, a100. Default is 5 exemplars.
5-shot
simplemultipleparallelparallel_multiplejavajavascriptirrelevancelive(pooled)0-shot
simplemultipleparallelparallel_multiplejavajavascriptirrelevanceliveReading these
overall from 5-shot to 0-shot), so the exemplars are not advantaging either one.
drops for Olmo are
parallel_multiple(−0.395) andirrelevance(−0.233) — themulti-call and declining exemplars. Live decode failures go from 1.1% to 38.6%
without them; the model narrates instead of calling.
simpleis close to a formatting check. It stays at 0.848 for Olmo at 0-shot,because the instruction block spells the
[func(arg=value)]format out in words.Complying needs instruction-following, not tool-calling priors. The categories that
do probe tool calling are
live,irrelevanceandparallel_multiple.no case/punctuation folding, no int→float widening, no variable-name handling —
leaves 96.2% of correct
simpleand 96.8% of correctliveintact. Dropping everytolerance would move
simplefrom 0.925 to 0.890.Known issue, not introduced here
The
bfclsuite's headline number is mis-weighted by a pre-existing framework bug:_compute_child_averageflattens a nested suite withchild.expand()and averagesthe leaves equally, ignoring that suite's own aggregation strategy. So
bfclreportsa flat mean of 7 leaves for its non-live term (Olmo 0.657, Qwen 0.835) instead of
BFCL's average-of-averages (0.677, 0.846). The tables above use the corrected values.
bfcl:non_liveandbfcl:non_live_astare correct when run directly — theflattening only bites at three levels of nesting. The same bug affects
olmobase:easy:qa:rc,science:biology,science:nojudgeandscience:all, sofixing it changes numbers for suites outside this PR and is left for its own change.
Not implemented
third-party APIs.
Because the executable categories are missing,
bfcl:non_liveis BFCL's non-liveoverall with those terms left out and will not match a published non-live number.
bfcl:non_live_astand the live summaries are directly comparable.🤖 Generated with Claude Code
https://claude.ai/code/session_01P9Qzbda9kPQePRC7MKJxnu