Fix BFCL default argument scoring#63
Open
wise-east wants to merge 1 commit into
Open
Conversation
Treat omitted optional arguments as equivalent to explicitly passing their schema defaults so valid calls are not marked incorrect. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Why this matters
The current scorer measures whether the model reproduced the ground truth's argument serialization, not whether it produced the correct function call. For an optional argument with a declared default, omission and explicitly passing that default produce the same effective invocation. Marking one form incorrect creates false negatives for operationally valid calls.
This is harmful in several ways:
exec_simple_86), while others explicitly include them (exec_simple_79). A model cannot follow one consistent serialization policy and be correct in both cases under raw dictionary equality.Normalizing both calls with optional schema defaults before comparison makes the score track effective tool behavior. It does not relax correctness for unknown keys, required arguments, or explicit values that differ from the default.
Concrete examples
exec_simple_86:calculate_investment_valuedeclares optionaladjust_for_inflationwith defaulttrue; the ground truth omits it, so a model call that explicitly passesadjust_for_inflation=trueis semantically equivalentexec_simple_79:sort_arraydeclares optionalreversewith defaultfalse; the ground truth explicitly passesreverse=false, so a model call that omits it is also semantically equivalentexec_simple_78: the ground truth passesreverse=true; omission remains incorrect becausetruediffers from the schema defaultfalseTesting
ruff check src/eval/tasks/bfcl/task_context/bfcl_evaluation_code.pyMade with Cursor