Qwen3.5-4b ppo_kl != 0
System Info
Is it normal to get ppo_kl != 0?
The same run with Qwen/Qwen3-4B-Instruct-2507 get ppo_kl = 0
Information
- [ ] The official example scripts
- [x] My own modified scripts
Tasks
- [x] An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give details below)
Reproduction
grpo base script
Expected behavior
It should be always 0 for stable training
Hello! I've been looking into these recently too. Could I ask which algorithm you used, and what hardware you ran it on to get these results?
Hello! I've been looking into these recently too. Could I ask which algorithm you used, and what hardware you ran it on to get these results?
I’m seeing a similar issue in GRPO training.
When training Qwen3-series models, actor/ppo_kl stays at 0 as expected. However, when training Qwen3.5-series models under a similar
setup, actor/ppo_kl becomes non-zero.
Environment:
- GRPO
- GPUs: H20, 4 nodes × 8 GPUs
- verl:
0.9.0.dev0 - transformers:
5.6.2 - sglang:
0.5.12.post1 - vLLM:
0.9.0.dev0
FYI issue 6280, it is believed bug in datapipeline, a workaround you can try: set rollout.log_prob_micro_batch_size_per_gpu the same as actor.ppo_micro_batch_size_per_gpu
FYI issue 6280, it is believed bug in datapipeline, a workaround you can try: set rollout.log_prob_micro_batch_size_per_gpu the same as actor.ppo_micro_batch_size_per_gpu
Thanks. The training runs normally with this setting.
I tracked this down on current main (Qwen3.5-0.8B, RTX 5090, FSDP engine, use_remove_padding). Without the causal-conv1d package (it isn’t in verl’s uv.lock), the transformers 5.16.1 GDN wrapper drops verl’s seq_idx, so the causal conv1d mixes the previous packed sample’s last 3 tokens into each sample, even with FLA installed. With a log-prob micro-batch of 8 and a train micro-batch of 2, ppo_kl is −0.041 and pg_clipfrac 9.2%. Equal sizes give ppo_kl 0, which hides it, but rollout_corr/kl stays at 0.040. The seq_idx guard in #8646 fixes it: ppo_kl −1.4e-4 and rollout_corr/kl 0.00051. With #8646 and batch_invariant=True, log-probs are bitwise identical across micro-batch sizes 2, 4 and 8.
I tracked this down on current main (Qwen3.5-0.8B, RTX 5090, FSDP engine,
use_remove_padding). Without thecausal-conv1dpackage (it isn’t in verl’s uv.lock), the transformers 5.16.1 GDN wrapper drops verl’sseq_idx, so the causal conv1d mixes the previous packed sample’s last 3 tokens into each sample, even with FLA installed. With a log-prob micro-batch of 8 and a train micro-batch of 2, ppo_kl is −0.041 and pg_clipfrac 9.2%. Equal sizes give ppo_kl 0, which hides it, butrollout_corr/klstays at 0.040. Theseq_idxguard in #8646 fixes it: ppo_kl −1.4e-4 androllout_corr/kl0.00051. With #8646 andbatch_invariant=True, log-probs are bitwise identical across micro-batch sizes 2, 4 and 8.
Nice catch, this really helped! Just curious,Could this also happen in other models if the convolution reads across packed sample boundaries, or is it specific to Qwen3.5?
In verl it’s limited to Qwen3.5 and Qwen3.5-MoE: they’re the only models whose GDN forward verl patches to pass seq_idx, and #8646 covers both. The transformers 5.16.1 wrapper drops seq_idx the same way for every model with a short conv (Qwen3-Next, Mamba2, LFM2 and others), so code that passes it to them without causal-conv1d installed would hit the same issue.