Conversation
A model can return a custom object whose __eq__ always returns True, causing all comparisons (out == exp) and special oracles to pass without solving the problem. Same exploit class as HumanEval (openai/human-eval#67). Add a type check before the comparison: if type(out) != type(exp), treat as a mismatch. Uses type() identity to reject dunder-overriding subclasses.
This branch has not been deployed
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.
Summary
A model can return a custom object whose
__eq__always returnsTrue, causing all comparisons (out == exp) and special oracles in EvalPlus to pass without solving the problem. A model can score 100% on HumanEval+ and MBPP+ by returning_AlwaysEqual()from every function.This is the same exploit class found in HumanEval (openai/human-eval#67), now confirmed against EvalPlus's hardened test suite — including the special oracles.
The exploit
EvalPlus then does (
eval/__init__.py:155-157):Every comparison passes. The special oracles (
abs(out - x) <= atol) also pass because__sub__and__abs__are overridden.Verified
out == FalseTrue(should be wrong)out == [1,2,3]Trueout == 42Trueabs(out - 5) <= 0.1True(oracle bypassed)Fix
Add a
type()identity check before the comparison: iftype(out) is not type(exp), treat as a mismatch (skip the==comparison). Allowsint/floatcross-comparison for math tasks.Verified
_AlwaysEqual()vsbool→ BLOCKED (type mismatch) ✅Truevsbool→ allowed (correct) ✅42vsfloat→ allowed (numeric cross-type) ✅Scope
This affects HumanEval+, MBPP+, and any EvalPlus-evaluated benchmark. The fix is in the core evaluation loop, protecting all datasets automatically.
Related
Checklist
py_compilepasses)