Skip to content

Add credentialed BFCL v4 web evaluation - #341

Open
ReinforcedKnowledge wants to merge 2 commits into
allenai:mainfrom
ReinforcedKnowledge:feat/bfcl-v4-web
Open

ReinforcedKnowledge wants to merge 2 commits into
allenai:mainfrom
ReinforcedKnowledge:feat/bfcl-v4-web

Conversation

@ReinforcedKnowledge

Copy link
Copy Markdown

Summary

Add an opt-in bfcl_v4_web external evaluation covering BFCL v4's credentialed web-search categories:

  • web_search_base
  • web_search_no_snippet

Together these categories contribute the remaining 20% of the official BFCL v4 score. They are kept separate from the deterministic non-web evaluation in #340 because they use a paid, live external service and can fail for reasons unrelated to the evaluated model.

Depends on #340.

Implementation

  • Reuses the pinned official Gorilla checkout and OpenAI-compatible provider integration introduced in Add BFCL v4 non-web external evaluation #340.

  • Runs BFCL's official web generation and scoring paths.

  • Validates the exact expected inventory:

    • 2 result files
    • 2 score files
    • 200 result rows
  • Rejects missing or unexpected files, missing or duplicate IDs, inference errors, tracebacks, malformed scores, and inconsistent counts.

  • Reports the official fixed-weight web contribution:

    0.2 * mean(web_search_base, web_search_no_snippet)

Credential handling

  • Requires SERPAPI_API_KEY only in the outer evaluation process.
  • Writes the credential to a temporary mode-0600 file.
  • Mounts that file into the sandbox instead of forwarding the key through a container environment variable or command-line argument.
  • Removes the temporary credential file when execution finishes.
  • Prevents the key from appearing in the serialized sandbox configuration, run command, audit records, or persisted output.
  • Performs a configurable quota preflight and records the quota before and after evaluation.

Live-search auditing

The adapter wraps the pinned BFCL GoogleSearch.get_dict() boundary and records one sanitized event per request:

  • monotonic sequence number
  • SHA-256 of the query rather than the raw query
  • response classification
  • result count where available
  • duration

Explicit SerpAPI errors take precedence over any stale or partial result data. Rate-limit responses retain BFCL's retry signal, while malformed responses, empty results, error payloads, missing results, non-rate-limit exceptions, and incomplete or out-of-order audit records fail closed.

Why this is a separate evaluation

Web search is live, stochastic, credentialed, and paid. Combining it with the non-web suite would allow quota exhaustion, service failures, or changing search results to invalidate the deterministic 80% of BFCL v4.

The two evaluations report their fixed-weight contributions independently:

  • bfcl_v4_non_web: maximum 0.8
  • bfcl_v4_web: maximum 0.2

Their contributions can be added when both runs use the same model and evaluation configuration.

Validation

  • 19 focused BFCL tests passed on the combined branch.
  • Repository unit suite: 2168 passed, 8 skipped.
  • Full Ruff lint and formatting checks passed.
  • Full ty type checking passed.
  • git diff --check passed.
  • A freshly built wheel contains the runner, web adapter, and scorer patch.
  • The exact 200-example official web workload completed against allenai/Olmo-3-7B-Instruct with:
    • 2 result files
    • 2 score files
    • 200 unique rows
    • no tracebacks or inference errors
  • The reference model emitted no tool calls in that run, so both categories correctly scored 0.0 and no search credits were consumed. This validates the model/provider, inventory, scoring, and zero-score paths, but is not presented as a model-quality result.
  • The remaining live-search boundary was exercised separately through the same pinned official WebSearchAPI and proposed audit wrapper:
    • one successful SerpAPI request
    • organic results returned
    • quota changed from 6107 to 6106
    • exactly one sanitized audit event
    • no raw query or credential persisted

Run the pinned official BFCL generator and evaluator against an OpenAI-compatible endpoint, covering the non-live, live, multi-turn, and memory collections. Validate exact file and ID inventories, reject inference failures, independently recompute the fixed-weight score contribution, pin the memory encoder, and record reproducibility metadata. Apply a hash-verified temporary scorer patch for BFCL's currently uncalled multi-turn irrelevance check.
Register the official web-search and no-snippet categories as a separate opt-in external evaluation. Mount SerpAPI credentials through a temporary mode-0600 secret file, preflight quota, audit live searches without recording raw queries or keys, validate exact result and score inventories, and report the fixed 0.2-weight contribution.

Generalize the pinned BFCL runner so the existing non-web path retains its behavior while the web path skips the memory encoder setup. Add regression coverage for score weighting, secret lifecycle, response classification, failure handling, and exception redaction.

This branch has not been deployed

No deployments
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