pytorch / pytorch/rl

[Feature Request] Reward-hacking / training-instability monitoring transform

Open
#3,984 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.6k
Forks
484
Avg merge
1d 1h
Merged PRs (30d)
207

Description

Motivation

Reward hacking / reward-model overoptimization is a common failure mode in RL post-training, and there's currently no standard TorchRL transform for monitoring it during a run.

Solution

An optional transform that tracks signals correlated with reward-hacking onset — KL-vs-reference acceleration, entropy-collapse trend, and advantage-distribution drift (Wasserstein vs. a rolling baseline) — and logs them alongside existing metrics. Related code: https://github.com/Aarav500/flight-recorder (Apache-2.0), which implements these extractors already (currently for GRPO/TRL-style training).

This comes from work on two reward-hacking-detection benchmarks (RHOB, Flight Recorder). One relevant finding: these signals reliably audit hacking after the fact but don't reliably give early warning at a usable false-positive rate (paper: "Audit or Early Warning? A Benchmark for Online Detectors of Reward Hacking") — worth knowing before assuming such a transform gives early warning rather than post-hoc detection.

Proposing before attempting a PR — happy to share methodology/code if there's interest.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed signals in this issue and the related Flight Recorder implementation, then compare them with the cited reward-hacking benchmark findings. Define the transform scope and metric behavior before implementation; done should mean an optional TorchRL transform that logs the agreed KL, entropy, and advantage-drift signals during training.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.