Implement an end-to-end toy RLHF loop on a “bandit-LM”: train an RM from synthetic prefe

RLHF & Preference Optimization6 / 7

Chapter 126 / 7

RLHF & Preference Optimization

Implement an end-to-end toy RLHF loop on a “bandit-LM”: train an RM from synthetic prefe

Super-hard

Implement an end-to-end toy RLHF loop on a “bandit-LM”: train an RM from synthetic preferences, optimize the policy with PPO + KL control, and plot gold vs proxy reward to exhibit over-optimization. [OpenAI]

Target interface
softmax(z)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.