Skip to content

fix(evals): StepEfficiency negative score on redundant calls within a step - #62

Open
usegitdivyansh wants to merge 1 commit into
future-agi:mainfrom
usegitdivyansh:fix/step-efficiency-redundancy-denominator
Open

fix(evals): StepEfficiency negative score on redundant calls within a step#62
usegitdivyansh wants to merge 1 commit into
future-agi:mainfrom
usegitdivyansh:fix/step-efficiency-redundancy-denominator

Conversation

@usegitdivyansh

Copy link
Copy Markdown

Fixes #60

What does this PR do?

Fixes StepEfficiency returning a negative score when a single trajectory step contains more than one redundant tool call.

Why?

Redundancy was counted per tool call (the inner loop runs over step.tool_calls) but the ratio divided that count by total_steps, the number of steps. When a step makes several redundant calls, redundant_count exceeds total_steps, so redundancy_ratio goes below 0 and the final score drops out of the documented 0 to 1 range. On the reproduction in #60 (one step, five identical calls) the metric returned -0.2.

What changed?

The redundancy ratio now divides by total_calls instead of total_steps, matching the failure calculation in the same method. total_calls is moved up so it is defined once before both uses. As discussed in #60, the per-call denominator keeps the ratio bounded by construction, so no clamp is added.

Tests

Adds test_redundant_calls_within_single_step, covering multiple redundant calls within a single step and asserting the score stays within 0 to 1. The existing single-call-per-step test is unchanged. Full agent suite passes locally (29 passed).

… step

Redundancy was counted per tool call but normalized by step count, so a single step with multiple redundant calls could push redundancy_ratio below 0 and produce a negative score, out of the documented 0 to 1 range. Divide by total tool calls instead, matching the failure calculation in the same method. The per-call denominator keeps the ratio bounded by construction, so no clamp is needed.

Adds a test covering multiple redundant calls within a single step.

Fixes future-agi#60
@usegitdivyansh

Copy link
Copy Markdown
Author

@abhiramArise this implements option 1 as discussed in #60 — redundancy now divides by total_calls, no clamp. Added a test for the multiple-calls-per-step case alongside the existing single-call test. Ready for review whenever you get a chance.

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.

StepEfficiency can return a negative score when a step contains multiple redundant tool calls

1 participant