Define expected behaviour
Specify safety constraints, proxy vs true reward signals, and the signatures of plausible reward hacking in your domain.
Detect reward hacking. Inspect learned policy behaviour.
Reward hacking detection aims to identify when an agent exploits a proxy reward signal in unintended ways. Practical detection compares observed behaviour and long‑term outcomes against expected safety constraints, examines distributional shifts in states and actions, and tests edge cases in simulators or replay logs.
Learning concept · Not a validated service
Reward hacking detection aims to identify when an agent exploits a proxy reward signal in unintended ways. Practical detection compares observed behaviour and long‑term outcomes against expected safety constraints, examines distributional shifts in states and actions, and tests edge cases in simulators or replay logs.
A proposed application is a monitoring tool that flags anomalous policies for human review before deployment. This tool should not be used to make automated safety-critical decisions without human oversight; the extension is not implemented in the supplied starter.
Specify safety constraints, proxy vs true reward signals, and the signatures of plausible reward hacking in your domain.
Run controlled simulations or replay logs to produce trajectories under baseline and learned policies, collecting state, action and reward traces.
Compare empirical distributions and summary statistics (e.g. sudden reward jumps, rare states) and flag trajectories that violate constraints.
Present flagged examples with traces and summaries for a human reviewer to decide mitigation such as reward redesign or safety layers.
The supplied starter simulates a simple epsilon‑greedy multi‑armed bandit: it samples four fixed Bernoulli arms, updates empirical mean estimates online, tracks action counts and prints totals. It does not implement reward‑hacking detection logic, nor does it use an RL environment, policy gradients, or safety checks.
for step in range(1, 2001):
if rng.random() < epsilon:
action = rng.integers(len(true_reward_rates))
else:
action = int(np.argmax(estimated_values))
reward = 1 if rng.random() < true_reward_rates[action] else 0
action_counts[action] += 1
total_reward += reward
estimated_values[action] += (reward - estimated_values[action]) / action_counts[action]The starter is a basic multi‑armed bandit simulation with four fixed reward rates and an epsilon‑greedy learner. It does not model environment states, proxy vs true rewards, anomaly detection, or any of the monitoring and signalling required for reward‑hacking detection, so it cannot validate detection methods for the titled task.
A proposed extension is to replace the bandit with environment trajectories (simulator or logged data), instrument both proxy and true outcome signals, compute divergence and anomaly scores per trajectory, and train a classifier or rule set to flag likely reward‑hacking behaviours for human review.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.