Skip to content

Fix IFEval correctness bugs in if_functions and IFEvalVerifier#1683

Merged
finbarrtimbers merged 7 commits into
mainfrom
finbarr/fix-if-functions
May 12, 2026
Merged

Fix IFEval correctness bugs in if_functions and IFEvalVerifier#1683
finbarrtimbers merged 7 commits into
mainfrom
finbarr/fix-if-functions

Conversation

@finbarrtimbers
Copy link
Copy Markdown
Collaborator

@finbarrtimbers finbarrtimbers commented May 12, 2026

Bundles a bunch of IFEval correctness fixes:

#1651/#1655 with regression tests Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bundles several correctness fixes across the codebase, including logic corrections for CSV header handling, prevention of division-by-zero errors in DPO and IFEval verifiers, and updates to GPT-4o pricing. It also fixes operand direction and tolerance logic in IFEval constraint functions and adds corresponding regression tests. Feedback suggests enhancing the choice validation functions by using regular expressions with word boundaries to avoid false positive matches resulting from simple substring checks.

Comment thread open_instruct/if_functions.py
def validate_choice(text: str, options: list) -> bool:
for option in options:
if text in option:
if option in text:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the implementation in open_instruct/if_functions.py, using substring matching here can lead to false positives (e.g., matching "B" in "Banana"). Using regular expressions with word boundaries or lookarounds would make the validation more robust.

Suggested change
if option in text:
if re.search(rf"(?<!\w){re.escape(str(option))}(?!\w)", text):

@finbarrtimbers finbarrtimbers changed the title Bundle small correctness fixes (#1615/#1618/#1619/#1623/#1625/#1646/#1651/#1655) Bundle small correctness fixes May 12, 2026
…terize tests, dedupe if_functions Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…1686 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@finbarrtimbers finbarrtimbers changed the title Bundle small correctness fixes Fix IFEval correctness bugs in if_functions and IFEvalVerifier May 12, 2026
…ubstring false positives Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…in separate PR) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…word-boundary fix Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@finbarrtimbers finbarrtimbers requested a review from hamishivi May 12, 2026 15:54
@finbarrtimbers finbarrtimbers enabled auto-merge May 12, 2026 15:54
Copy link
Copy Markdown
Collaborator

@hamishivi hamishivi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh thanks for this

@finbarrtimbers finbarrtimbers added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit a09e149 May 12, 2026
6 of 7 checks passed
@finbarrtimbers finbarrtimbers deleted the finbarr/fix-if-functions branch May 12, 2026 16:10
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.

2 participants