#4818 (head c9d5fbe2) next to draft
#4833 (head ddd0dcb7). All links are pinned to those two heads.
main. Two PRs add it, written separately, with no shared code.Six pages on #4818, one question each. This one asks what the other score-centering PR covers that #4818 does not.
Example: a 4-token prompt and 3 generated tokens, so a row is S = 7 tokens. K = 2.
At the first generated token the sampler's top 2 are ids 17 and 4, with q = 0.45 and 0.25 (log q = −0.80, −1.39). The trainer gives them
p = 0.50 and 0.32. [3, 2] means [generated tokens, K candidates], and [7, 2] means [row tokens, K candidates].
The two PRs give the same numbers at the start and at the end. Both record ids 17 and 4, both read p = 0.50 and 0.32, and both compute c = q − ρ·p = −0.383 and −0.283, where ρ = (1 − 0.70) ÷ (1 − 0.82) = 1.667 scales the part of the vocabulary nobody recorded. They differ in the middle (how the K candidates reach the trainer) and at the end (what the correction is added to).
| Setup | #4818 | #4833 |
|---|---|---|
| v2 trainer with token capture | ✓ | ✗ v2 setup and its train fields are not wired |
| v1 GRPO, native vLLM (sync or async) | ✗ raises at setup | ✓ |
| v1 GRPO + Gym, no token capture | ✗ | ✓ needs the Gym fork |
| top-k / top-p sampling | ✗ rejected | ✓ positive top_k ≤ K, using the vLLM sampling mask (L1010, renormalize) |
| Automodel with TP or CP | ✗ rejected at setup | ✓ unpacked rows only |
| Sequence packing, Megatron CP | ✓ | ✗ packing rejected |
| PPO ratio and clipping kept | ✓ | ✗ requires disable_ppo_ratio |
| Sequence-level loss averaging | ✓ | ✗ token-level only |
| Upstream Gym, GPU CI run | ✓ Gym main, CI passed before the last fixes | ✗ fork pin, never run in CI |
The math is the same estimator. Both compute c = m − α·p on the K candidates, with the same
IS, TIS and ICE-POP rules for m and α (#4818
score_centering.py L89,
#4833 clipped_pg.py L99).
The only difference is what that term is added to. A is the advantage, y the sampled token, w its importance weight, sg means no gradient:
With disable_ppo_ratio: true and token-level loss, #4818's first term is that same REINFORCE term, so #4818
already covers #4833's loss. One small difference: #4833 computes w from the current log-probs, while #4818 uses the standard
importance weight from the old ones. These match on the first update of a batch.
Where it would land: RL, as follow-ups to #4818. Only the Gym-without-capture item needs a Gym change, and it should go
to Gym main, not a fork.
| #4833 piece | Take it? | How, on top of #4818 |
|---|---|---|
| top-k / top-p via vLLM's sampling mask | Yes, this is the planned top-p follow-up | Use vLLM's return_sampling_mask so the replay does not depend on score centering. Carry over #4833's validation rule: the mask is on for the whole engine, so validation must keep the training top_k and cannot be greedy. |
| Automodel TP/CP | Yes, small | #4818 raises for Automodel's sharded logits (model_utils.py L1751). The existing get_distillation_topk_logprobs_from_logits already handles them, and #4833 shows it works for this (2-GPU test on H100). Then drop #4818's Automodel setup check. |
| v1 loops, Gym without token capture | Only if v1 users ask for it | Adds a second way for the K candidates to travel (HTTP JSON), and needs a Gym schema change. #4833's HTTP path also repeats two things #4818 fixed in review: K is forced onto every request that asks for token-id logprobs, not only training calls, and the per-token Python extraction runs on vLLM's event loop. |
| REINFORCE-only loss | No | #4818's added term already reduces to it (see above). |
score_centering_top_k
next to score_centering), and it pins a personal Gym fork.