Files
foxhunt/crates
jgrusewski eeb0a829bf feat(rl): done-gated π update — fixes qpa crash with sparse rewards
Gate both PPO advantage and Q→π distillation on done-steps only:
- advantage = done * (returns - V) — non-done advantages are zero
- distillation gradient only fires when done > 0.5 per batch element

With 5-6% of batch having real rewards, non-done gradient was 94%
noise that destabilized Q-π alignment. Done-gating ensures π only
learns from steps where trades closed and rewards validate the signal.

qpa: holds at +0.625 through 3000 steps (previously crashed to -0.85).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:28:49 +02:00
..