Files
foxhunt/docs
jgrusewski 494125c104 spec(dqn): distributional RL aggregation — UCB on C51+IQN σ for action selection
Designs the structural fix for the C51 expected-Q Hold/Flat bias exposed
by the Kelly val-Flat-collapse fix. The bias is a manifestation of a
deeper project-wide pearl:

  "Distributional RL aggregation discards uncertainty;
   action selection must restore it."

Any value head representing Q as a distribution (atoms, quantiles,
ensembles) MUST expose both E[Q] and σ(Q) to action selection. Boltzmann
on E[Q] alone produces structural bias toward low-variance actions
regardless of expected payoff — the C51+IQN Flat-attractor is one
instance of this lost-information pattern.

Fix: extract σ(Q) from BOTH C51 atoms (closed form) and IQN quantiles
(IQR/1.349), blend by loss-time weight, feed Q_eff = E[Q] + κ·σ
(κ=1.0 structural identity) to direction-branch Boltzmann ONLY.

4-phase implementation:
  Phase 0 — TDD hypothesis verification (Rust mirror functions + 5 unit
            tests including GPU integration on real checkpoint)
  Phase 1 — Audit existing reward levers (B.2, CF, PopArt, Q-target)
            via 6 unit tests; fix any bugs found
  Phase 2 — UCB integration: new compute_q_with_uncertainty kernel,
            modified action_select, Rust orchestration, project-wide
            aggregation contract in dqn-wire-up-audit.md
  Phase 3 — Verification per Plan 5 Task 5 multi-seed × multi-fold

5-layer verification gate; 8 risks with mitigations; 4 stop conditions
that halt execution and force redesign.

Existing band-aid fixes (Kelly cap, eps-floor, tau-floor) stay — they
address symptoms at different layers. UCB adds the missing aggregation
step that was the common root across all the symptoms.

Direction-branch only — magnitude/order/urgency don't have the
Flat-attractor (atom-mass collapse asymmetry).

5-7 days active work across 4 sub-plans; each gets its own
writing-plans cycle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 23:24:25 +02:00
..