feat(scorers): add non_final_output_tokens metric robust to answer-verbosity variance - #495
Open
prernakakkar-google wants to merge 2 commits into
Open
feat(scorers): add non_final_output_tokens metric robust to answer-verbosity variance#495prernakakkar-google wants to merge 2 commits into
prernakakkar-google wants to merge 2 commits into
Conversation
prernakakkar-google
requested review from
IsmailMehdi and
helloeve
as code owners
July 15, 2026 09:12
Collaborator
Author
|
/gcbrun |
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.
What & why
token_consumption(input + output) is noisy for comparing agent efficiencybecause output tokens carry high, presentation-driven variance: two runs can
invoke the identical tool calls yet differ widely in output because one writes
a terse summary while the other renders a full table. That variance makes
side-by-side efficiency comparison unreliable, especially for one-shot runs.
This adds
non_final_output_tokens, a new deterministic scorer that reportsthe output tokens spent on the path to the answer (reasoning + tool-call
emission) while excluding the final rendered response text. Per turn it computes
sum(candidates) − estimate(response)(clamped at 0), where the response-sizeestimate reuses the existing
len/4chars-per-token heuristic frommcp_tool_metrics.py.token_consumptionis left unchanged — this is added as asibling, mirroring how
tokens_processed/effective_billed_tokenswereintroduced.
Tested
https://paste.googleplex.com/6298204256731136