verl icon indicating copy to clipboard operation
verl copied to clipboard

[Fully Async + GSPO] Is actor/pg_clipfrac around 0.4 expected with 3e-4/4e-4 clipping?

Open DBMing opened this issue 3 months ago • 1 comments

I am running fully asynchronous GRPO training with the Megatron backend and a separate vLLM rollout worker. The policy loss is configured as GSPO.

During training, actor/pg_clipfrac remains consistently high, usually around 0.35–0.44 and approximately 0.4 on average.

The training does not diverge, but the reward improves only slowly. I would like to confirm whether this clipping fraction is expected for GSPO under fully asynchronous training, or whether it indicates excessive policy staleness or an incorrect loss configuration.

Setup

  • Model: Qwen3.5-35B-A3B
  • Trainer backend: Megatron
  • Rollout backend: vLLM
  • Training GPUs: 8
  • Rollout GPUs: 8
  • Advantage estimator: GRPO
  • Policy loss: GSPO
  • Fully asynchronous policy training
  • rollout.n=8
  • ppo_mini_batch_size=16

Therefore, each actor update uses 16 prompt groups and 128 trajectories.

Image

In a synchronous run using the same GSPO clipping values, actor/pg_clipfrac is almost zero. However, I understand that the synchronous trainer may recompute old_log_probs with the current Megatron actor, so the two metrics may not be directly comparable.

Questions

  1. Is a persistent actor/pg_clipfrac of approximately 0.4 expected for GSPO in fully asynchronous training?

  2. Does this mean that too many sequence-level policy-gradient terms are being clipped and therefore contribute little or no direct policy gradient?

  3. Are the following GSPO paper values recommended for fully asynchronous training?

clip_ratio_low: 0.0003
clip_ratio_high: 0.0004

A Qwen3.5 fully-async example uses:

policy_loss.loss_mode: gspo
clip_ratio_low: 0.2
clip_ratio_high: 0.28

Is 0.2/0.28 intentionally recommended for fully-async GSPO, or is it intended for the bypass_mode PPO-clip loss?

DBMing avatar Aug 11 '26 09:08 DBMing

I checked the current compute_policy_loss_gspo implementation and the fully-async Qwen3.5 example. A few concrete points may help interpret this metric.

  1. actor/pg_clipfrac ~= 0.4 is a real clipping fraction, but it is token-weighted, not a fraction of sequences.

Current GSPO computes one sequence ratio

negative_approx_kl_seq = sum((log_prob - old_log_prob) * mask) / seq_len
s = exp(negative_approx_kl_seq)

and then

pg_losses1 = -A * s
pg_losses2 = -A * clamp(s, 1 - eps_low, 1 + eps_high)
pg_clipfrac = masked_mean(pg_losses2 > pg_losses1, response_mask)

Numerically, s is shared by all valid tokens in a response, so a clipped response contributes its response length to this metric. Therefore ~0.4 means roughly 40% of valid response tokens are in responses for which the clipped branch wins; it does not necessarily mean 40% of the 128 trajectories.

For the usual GRPO case where the advantage sign is constant across a response, the clipping conditions reduce to:

  • positive advantage: clipped when s > 1 + eps_high;
  • negative advantage: clipped when s < 1 - eps_low.

On those branches the clamp is locally constant, so the direct GSPO surrogate gradient through s is zero. That does not imply the entire actor gradient is zero if other terms (KL, entropy, etc.) are enabled.

  1. With 3e-4 / 4e-4, a large clip fraction is quite plausible under fully-async staleness.

Those are indeed the very tight GSPO paper clipping values. A response with positive advantage only needs its geometric-mean sequence ratio to exceed 1.0004 to be clipped (and negative-advantage responses below 0.9997). In a fully asynchronous setup, stale rollout log-probs can move many responses past those thresholds even when training remains numerically stable.

So I would not read 0.4 as "expected/healthy" by itself; I would read it as evidence that a large token-weighted portion of the batch is currently outside the configured GSPO trust region. The useful next diagnostic is the distribution of negative_approx_kl_seq / s, split by advantage sign and preferably also reported as sequence count rather than only token-weighted pg_clipfrac.

  1. The repo's current Qwen3.5 fully-async example really does use 0.2 / 0.28 with GSPO.

verl/experimental/fully_async_policy/shell/grpo_qwen35_35b_megatron_async.sh currently has:

clip_ratio_low=0.2
clip_ratio_high=0.28
loss_mode="gspo"
loss_agg_mode="seq-mean-token-mean"

so those values are not just bypass-mode PPO clipping in that example; they are passed to the GSPO loss. I would still distinguish "the example uses these values" from "0.2/0.28 is a generally recommended GSPO setting"—it is much wider than the paper setting and appears to be a practical async recipe choice.

A useful A/B would be to keep the same saved rollout batch and compare the sequence-level s distribution plus positive/negative-side clip counts under 3e-4/4e-4 vs 0.2/0.28. That separates policy staleness from the threshold choice without confounding it with fresh rollouts.

I maintain QuotientGuard, which can capture the realized effective coefficient at verl's actual loss-contribution point. It is useful here if you want to check whether verifier/reward-equivalent responses are being selectively zeroed by the clipping branch; I would treat that as a separate diagnostic from the aggregate clip fraction, not as evidence of downstream harm.

ot4562-glitch avatar Sep 21 '26 04:09 ot4562-glitch