You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Qwen2.5VL-7B-Instruct model loss starts with nan #874
For GRPO training with Qwen2.5VL-7B-Instruct, the loss at step 0 is nan and training does not proceed. token logprob errors are also consistently less than 1.05. Setting the KL loss to 0 seems to work (there are no nans). This problem does not occur with Qwen2.5VL-3B-Instruct or Qwen2VL-7B-Instruct (with kl penalty factor set to 0.01).
The problem is that the KL loss in calculate_kl_penalty_joschu2020 function overflows for high/low values of r
Steps to reproduce uv run examples/run_vlm_grpo.py policy.model_name=Qwen/Qwen2.5VL-7B-Instruct
The simplest fix that works for me is to clamp the value of the loss before computing KL
KL loss is generally very unstable (and high variance) which has led researchers to explore other forms of Bregman-divergences as well
Activity
rohitrango commentedon Aug 8, 2025
cc @terrykong @SahilJain314 @ZhiyuLi-Nvidia