Visitar URL original
feat(eval_service): return per-item scores in Eval response by erinlimbogoogle · Pull Request #646 · GoogleCloudPlatform/evalbench · GitHub
Skip to content

feat(eval_service): return per-item scores in Eval response - #646

Open
erinlimbogoogle wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
erinlimbogoogle:feat/item-scores-in-response
Open

erinlimbogoogle wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
erinlimbogoogle:feat/item-scores-in-response

Conversation

@erinlimbogoogle

Copy link
Copy Markdown
Collaborator

Return per-item scores in Eval response

With summary_in_response, Eval only returned run-level counts. Callers wanting a per-item breakdown (e.g. by prompt template) had to approximate it from the headline, which is upward-biased.

_process_results now also returns item_scores, built from the same scores_df that goes to the scores table, and Eval includes it top-level:

{"job_id": "...", "summary": {...},
"item_scores": {"400": {"exact_match": 1.0, "llmrater": 1.0, "executable": 1.0, "golden_failed": false}}}

• executable — generated SQL ran without a DB error (same signal as the headline metric).
• golden_failed — golden SQL errored, so the zero is a dataset/infra problem, not a model one. Requires the new golden_error field on score rows (BQ picks it up via ALLOW_FIELD_ADDITION).
• scorer_errors — comparators that raised.

Interact / AgentInteract payloads are unchanged. Multi-trial runs return {} (per-row ids are _trial_; a per-item view is ambiguous). Reporter output is unchanged. ~40 KB for a 460-item run.

The Eval RPC with summary_in_response only returned run-level counts
({"total", "scores": {metric: correct}}). Callers that wanted to slice
results by dataset item (e.g. per prompt template) had no per-item data
and were left to approximate it, which produces upward-biased numbers.

_process_results now also returns an item_scores dict, built from the
same scores_df that is written to the scores table:

  {item_id: {<comparator>: 0.0..1.0,
             "executable": 0|1,          # generated SQL ran without error
             "golden_failed": bool,      # golden SQL failed: zero is unfair
             "scorer_errors": [...]}}    # comparators that raised

Eval includes it as a top-level "item_scores" key next to "summary".
Interact and AgentInteract discard it; their stream payloads are
unchanged. Multi-trial runs return {} since per-row ids are
"<id>_trial_<n>" and the headline is computed over trials.

score rows now also carry golden_error (BigQuery table uses
ALLOW_FIELD_ADDITION, so the new column is picked up automatically).
This is what lets golden_failed distinguish a dataset/infra zero from
a model zero.

Scores stored to reporters are unchanged; item_scores is built after
reporter.store().
@erinlimbogoogle
erinlimbogoogle force-pushed the feat/item-scores-in-response branch from e22f23f to 20c2887 Compare October 5, 2026 21:46
@erinlimbogoogle
erinlimbogoogle marked this pull request as ready for review October 6, 2026 15:28
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.

2 participants