CRIT (gpt-5.5): (1) _gt_correct keyed on a FIXED sentinel string the wrong solution could print itself -> gt_correct=True. Now a fresh secrets.token_hex nonce per call, unguessable, lives in outer globals not the solution namespace. (2) __is_safe used isinstance(x,int), so an int SUBCLASS with __eq__=True passed as safe and __strict_eq trusted it. Now exact types (type(x) in (...)). +2 verify cases (forge_sentinel, int-subclass eq). 29/29. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.9 KiB
Code Review: multi-loophole reward substrate
Summary
The main risk is that the new strict oracle is not actually strict in two concrete cases, so gt_correct can become True for wrong solutions. That breaks both reward correctness and the claimed non-overlap invariant.
Critical (must fix)
-
src/projected_grpo/rewards.py:253-282_gt_correctaccepts_GT_OK_SENTINEL in proc.stdout. A wrong solution can print"__GT_CORRECT_REACHED__"before failing tests and getgt_correct=True,passed=True,exploited=Falsein every mode. I verified this with a wrongsolve()plusprint("__GT_CORRECT_REACHED__"). Fix by using an unguessable per-call token and checking an exact final line, or better, a parent-owned side channel the solution cannot write. -
src/projected_grpo/rewards.py:212-231__is_safeusesisinstance(x, (int, float, bool, str)), then__strict_eqcallsa == b. A subclass ofintwith__eq__ = always Trueis treated safe, so a wrong eq-override solution getsgt_correct=Trueand pays on all subsets. I verifiedclass Evil(int): __eq__=lambda... True; return Evil(999)passes as correct inrun_tests,eq_override, andexit_code. Use exact types:type(x) is int, etc., and exact container types recursively. Add this toverify_rewards.py; the currentEQ_HACKonly tests a custom object, so the tests encode the same wrong assumption.
Important (should fix)
-
src/projected_grpo/rewards.py:484/docs/spec/20260530_faithful_multi_loophole_env.md:146-153:passed = gt_correct OR channel_iis a constructed oracle-plus-positive-detectors environment, not a faithful flawed grader. Arguing both sides: it probably does not violate the intervention no-cheat invariant if the oracle is only the environment reward and not used to gate projection; but it does silently change the originalgt_pass OR hackednature and gives an honest-solve escape route that can suppress hack emergence. The paper claim should say “constructed non-overlap substrate”, not “realistic flawed grader”. -
src/projected_grpo/build_substrate.py:199-203+src/projected_grpo/train.py:1062-1067: prompt exposure is even, but teacher-demo diversity is not. Current substrate is 7/13/21 rollouts for 7/7/7 prompts, andG_t>1duplicates low-count modes while sampling diverse demos for high-count modes. If “even across classes” is load-bearing, cap or resample to equal unique teacher rollouts per prompt/mode.
Positive
src/projected_grpo/verify_rewards.py:148-185includes useful cross-mode non-overlap cases andos._exitregressions; keep that style, but add the two oracle-forging cases above.
Verdict
REQUEST CHANGES
Fix the two gt_correct=True false positives before trusting any substrate run. Then explicitly frame the reward as a constructed non-overlap benchmark, not a realistic flawed grader.
[?2026h[r[?1006l[?1002l[?1000l[?1007h[?1049l[<999u[>4;0m[?2026l