Skip to content

feat(scorers): add non_final_output_tokens metric robust to answer-verbosity variance - #495

Open
prernakakkar-google wants to merge 2 commits into
mainfrom
fetaure_tool
Open

feat(scorers): add non_final_output_tokens metric robust to answer-verbosity variance#495
prernakakkar-google wants to merge 2 commits into
mainfrom
fetaure_tool

Conversation

@prernakakkar-google

Copy link
Copy Markdown
Collaborator

What & why

token_consumption (input + output) is noisy for comparing agent efficiency
because 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 reports
the 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-size
estimate reuses the existing len/4 chars-per-token heuristic from
mcp_tool_metrics.py. token_consumption is left unchanged — this is added as a
sibling, mirroring how tokens_processed / effective_billed_tokens were
introduced.

Tested

https://paste.googleplex.com/6298204256731136

@prernakakkar-google

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@prernakakkar-google prernakakkar-google added automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit and removed automerge: exact Summon MOG for automerging, but approvals need to be against the latest commit labels Jul 15, 2026
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