Skip to content

Return the WebArena-Verified task score as the reward - #413

Open
salma2vec wants to merge 1 commit into
ServiceNow:mainfrom
salma2vec:fix/webarena-verified-task-score
Open

salma2vec wants to merge 1 commit into
ServiceNow:mainfrom
salma2vec:fix/webarena-verified-task-score

Conversation

@salma2vec

Copy link
Copy Markdown

Fixes #412

Problem

WebArenaVerifiedEvaluator.__call__ returned the mean of the per-evaluator scores. webarena-verified's own TaskEvalResult scores a task 1.0 only when every evaluator passes, and 0.0 when any evaluator fails or errors. So a task that satisfied one of its two evaluators got a reward of 0.5 in BrowserGym and 0.0 in the benchmark's harness. 488 of the 812 tasks have more than one evaluator, and AgentLab's avg_reward averages these partial rewards into the reported success rate.

Change

  • browsergym/webarena_verified/.../evaluators.py: return results.score, the harness's task-level score, as the existing docstring ("1.0 or 0.0") describes. The per-evaluator results are still logged.
  • tests/webarena/test_webarena_verified_evaluator.py: runs __call__ on a real two-evaluator task from webarena-verified.json. The harness is mocked to return TaskEvalResult.create(...) for pass/pass, pass/fail, fail/pass and pass/error, and the test checks that the reward equals the harness's task score. It skips when browsergym.webarena_verified isn't installed, like test_webarenalite_evaluators.py.

Testing

  • The new test: 4 passed with this change. On main, 3 fail with assert 0.5 == 0.0 (pass/fail, fail/pass, pass/error).
  • I ran it with webarena-verified 1.2.3 on Python 3.12. Playwright, browsergym.core.registration, browsergym.webarena (instance and task) and nltk were replaced by small local modules, because libwebarena pulls in more than I could install on this machine. The test itself only touches the evaluator, the mocked harness and webarena-verified's result types.
  • black --config=./pyproject.toml --check (24.2.0, as pinned in .pre-commit-config.yaml) passes on both files.
  • Not run: the tests/webarena CI jobs against live WebArena instances.

WebArenaVerifiedEvaluator returned the mean of the per-evaluator scores.
webarena_verified scores a task 1.0 only when every evaluator passes and
0.0 when any evaluator fails or errors, so a task that satisfied one of
its two evaluators got a reward of 0.5 here and 0.0 in the benchmark's
own harness. 488 of the 812 tasks have more than one evaluator.

Return results.score, the harness's task-level score, as the docstring
already describes.

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.

WebArena-Verified reward averages evaluator scores instead of using the benchmark's task score (partial credit for failed tasks)

1 participant