flâneur — a map of the web's best reading

Reward Hacking in Reinforcement Learning | Lil'Log

lilianweng.github.io · 8,040 words · saved by 9 readers

Reward hacking occurs when a reinforcement learning (RL) agent exploits flaws or ambiguities in the reward function to achieve high rewards, without genuinely learning or completing the intended task. Reward hacking exists because RL environments are often imperfect, and it is fundamentally challenging to accurately specify a reward function. With the rise of language models generalizing to a broad spectrum of tasks and RLHF becomes a de facto method for alignment training, reward hacking in RL training of language models has become a critical practical challenge. Instances where the model learns to modify unit tests to pass coding tasks, or where responses contain biases that mimic a user’s preference, are pretty concerning and are likely one of the major blockers for real-world deployment of more autonomous use cases of AI models.

Table of Contents Background Reward Function in RL Spurious Correlation Let's Define Reward Hacking List of Examples Reward hacking examples in RL tasks Reward hacking examples in LLM tasks Reward hacking examples in real life Why does Reward Hacking Exist? Hacking RL Environment Hacking RLHF of LLMs Hacking the Training Process Hacking the Evaluator In-Context Reward Hacking Generalization of Hacking Skills Peek into Mitigations RL Algorithm Improvement Detecting Reward Hacking Data Analysis of RLHF Citation References Reward hacking occurs when a reinforcement learning (RL) agent exploits fl

Explore this link on the map →

saved by

related reading