S_t is fixed rollout data; z_θ comes from the actor being
trained. This gives PPO/GRPO a denominator and numerator in the same sampled
probability space while retaining gradients through the current actor logits.
Enable replay
--rollout-top-p is below 1 or
--rollout-top-k is positive. A finite top-p run must also set a positive
top-k so that the captured support is bounded. Miles asks SGLang to capture its
native sampling support with return_sampling_mask, returned as base64 flat arrays
(return_flat_raw_sampling_mask) unless the output store takes it, and uses the returned
support-normalized log probability as the rollout log probability.
--rollout-top-k is the default for rollout requests, not a global upper bound
on request-specific top-k values. SGLang owns support capacity through
--sglang-sampling-mask-max-tokens (or the matching server-group override) and
rejects requests whose realized support cannot be represented.
Correctness requirements
Miles rejects configurations that it cannot replay faithfully:- Every resolved training request must have top-p, top-k, and temperature. Agentic sessions fill omitted values from the sampling defaults registered when the session is created.
- Request temperature must match the registered training temperature
(
--rollout-temperaturefor the standard rollout paths). - Frequency, presence, and repetition penalties,
logit_bias, and custom logit processors are not supported because the trainer does not replay those logit transformations. --recompute-logprobs-via-prefillis incompatible because that path does not preserve the per-token support.- The selected router must preserve
return_sampling_mask,return_flat_raw_sampling_maskandreturn_flat_raw_sampling_mask_b64. The Miles router forwards raw request bodies. The native SGLang router requires typed chat and generate request schemas that declare the fields; sgl-router-for-miles #32 declares the flat ones.
Current objective limitation
Replay currently exposes only the support-normalized actor score to the loss. Reference KL and on-policy distillation also need a full-vocabulary actor score, so Miles rejects--use-kl-loss, nonzero --kl-coef, and --use-opd with
replay until the loss interface carries both scores.
Monitor replay
On the first update from identical weights,train/train_rollout_logprob_abs_diff should be near numerical tolerance.
Afterward, interpret it with version-lag and clipping metrics because it also
reflects policy updates and staleness.
