NVIDIA-NeMo/RL #4818 (head f0d9860e), next to community draft
#4833 and the public
Miles score-centering guide.
top_p = 1, no top_k).Six pages on this PR, one question each — this one: what adding top-p to score centering would take.
Same six-token example as the "two top-ks" page. vLLM q = 0.45, 0.25, 0.15, … for ids 17, 4, 9;
trainer p = 0.50, 0.32, 0.10. Right lane: top_k = 4, top_p = 0.8, so vLLM keeps {17, 4, 9}; K = 6 slots recorded.
All values computed with the PR's own compute_score_centering_term.
So is it mask replay or score centering? Both, from one payload. With a top-k bound and
processed_logprobs, vLLM's K recorded slots contain its whole kept set, with cut tokens marked −inf. The trainer reads
the kept set from those slots and renormalizes over it: that is the replay. Score centering on the same slots then has no
"rest" to guess, so it becomes exact. Miles calls this "support mode": "H is then the full sampling distribution and nothing is
approximated." It needs a positive top_k, and K at least that large.
Where it would land: RL only. Same two columns, same token-capture route. No Gym change: the tensors never pass through Gym on this route.
| Piece | #4818 today | With top-p support |
|---|---|---|
| Setup check | rejects top_p < 1 and any top_k | allow them; require processed_logprobs and top_logprobs K larger than top_k (ties at the cut can need more) |
| vLLM worker extraction | rejects any non-finite log-prob (extract_score_centering_samples) | keep −inf slots as padding; check the kept mass is 1 and at least one slot is cut |
| Trainer log-prob of the sampled token | full softmax | renormalized over the kept slots (the replay), for both the current and old log-probs |
| Correction term | top-K exact, rest estimated | whole kept set exact; padding slots masked out |
A team branch already does this padding-and-masking for Gym without token capture, and is planned as a
follow-up once #4818 lands. Two other designs get the kept set from vLLM's separate return_sampling_mask instead of
from the top-K slots: #3937 (mask replay only) and community draft
#4833, which uses it for score centering on native vLLM rollouts and Gym
without token capture (see the vs #4833 and
moving a mask pages).
top_k has to bound it.
Pure top-p with no top-k cannot fit in K slots. For #4818 itself, nothing changes: it is right to reject filters until this lands.