feat(instruction_following): add loose-mode evaluation and compute_metrics#1720
Open
rodboev wants to merge 4 commits into
Open
feat(instruction_following): add loose-mode evaluation and compute_metrics#1720rodboev wants to merge 4 commits into
rodboev wants to merge 4 commits into
Conversation
…trics Signed-off-by: Rod Boev <rod.boev@gmail.com>
…Skills spec Signed-off-by: Rod Boev <rod.boev@gmail.com>
…ym convention Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
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.
The
instruction_followingserver currently evaluates each instruction in strict mode only and returns no aggregate metrics fromcompute_metrics(). As a result,rollouts_aggregate_metrics.jsonomits all four IFEval accuracy dimensions:prompt_strict_accuracy,instruction_strict_accuracy,prompt_loose_accuracy, andinstruction_loose_accuracy.This PR adds loose-mode evaluation and the missing
compute_metrics()override:follow_all_instructions_looseandfollow_instruction_list_loosetoInstructionFollowingVerifyResponse_check_following_loosehelper that uses a native loose API if available (check_following_loose/check_following(..., mode="loose")) and falls back to the IFEval perturbation set: the original text, without-first-line, without-last-line, and without-first-and-last-line variants, each duplicated with asterisks removed, matching the NeMo Skills conventionverify(), avoiding double instantiationcompute_metrics(tasks: List[List[Dict]])onInstructionFollowingResourcesServer, matching the base class signature, and aggregates all four IFEval accuracy scores as percentages (0-100), consistent withcompute_pass_majority_metricsloose >= strictinvariant, andcompute_metrics()arithmeticNo new dependencies.
verifiable_instructionsis already inrequirements.txt.Closes #1160
Checklist
uv run pytest resources_servers/instruction_following/tests/test_app.py -x -vruff check --config pyproject.toml resources_servers/instruction_following/app.py resources_servers/instruction_following/tests/test_app.pyruff format --config pyproject.toml --check resources_servers/instruction_following/app.py resources_servers/instruction_following/tests/test_app.pynemo_gymcoreTargeted tests were not run locally; upstream CI is the source of truth.