Skip to content

docs: explain near-zero policy loss - #2577

Draft
Gavin-Meng wants to merge 1 commit into
THUDM:mainfrom
Gavin-Meng:docs/interpret-zero-policy-loss-1621
Draft

Gavin-Meng wants to merge 1 commit into
THUDM:mainfrom
Gavin-Meng:docs/interpret-zero-policy-loss-1621

Conversation

@Gavin-Meng

Copy link
Copy Markdown

Summary

  • Define train/pg_loss and train/loss in the English and Chinese RL experiment guides.
  • Show how GRPO advantages can produce a zero scalar policy loss at the start of an on-policy update while the individual log-ratio gradients remain nonzero.
  • Point readers to gradient norm, reward spread within a prompt, and held-out evaluation reward.

Related to #1621 and the example in its discussion.

Verification

  • Apple Silicon CPU with Python 3.12 and PyTorch 2.15.0. The current compute_policy_loss reduced contributions [-0.5, 0.5] to 0.0 and backpropagated log-ratio gradients [-0.25, 0.25].
  • PYTHONPATH=. python -m pytest tests/test_policy_loss.py -q passed all 18 tests.
  • git diff --check passed. The verification exercises the policy-loss calculation in isolation. It does not reproduce the original Qwen2.5 training run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant