All problems
Reward Hacking Detector
Problem
Detect reward hacking from reward histories.
Return True when the proxy reward increased from first to last observation while the true reward stayed within threshold of its starting value. Fewer than two observations returns False.
Hint
A widening gap between proxy and true reward is the classic hacking signature.
Test cases
case 1
in: [[1,2,5],[3,3.1,2.9],0.5]
expected: true
case 2
in: [[1,2,5],[3,4,6],0.5]
expected: false
case 3
in: [[1],[1],0.5]
expected: false
case 4
in: [[5,4],[1,1],0.5]
expected: false
Starter codePython
def reward_hacking_detected(proxy_rewards, true_rewards, threshold):
# Your code here
pass4 test cases · run your code against them in the editor