What Causes the Unexpected Increase in Entropy During Training?
During my training on mathematical tasks using GRPO, I observed that the entropy suddenly increases after a certain period, causing the model training to crash. I've tried various approaches to address this issue, including changing the dataset, reducing the learning rate, increasing the KL penalty, increasing the max_response_length, and lowering the sampling temperature, but none of these have resolved the problem. In all my experiments, the entropy_coeff was set to 0. I'm using the model: DeepSeek-R1-Distill-Qwen-1.5B. I also attempted to switch to DeepSeek-R1-Distill-Llama-8B, but it did not help either.
I would like to know if anyone else has encountered a similar problem, and what factors might cause this phenomenon?
It might be a bug in the reward function
It might be a bug in the reward function
Thank you very much for your suggestion. However, I don’t think the reward function is the root cause. I have tried several different reward functions, including those from SimpleRL and Skywork OR1 , and I have even used a reward model, but I still observed the same trend. Therefore, I believe the reward function may not be the main issue.
In fact, I still haven’t found the cause of the problem. Do you know of any configurations used in successful practices that might help?
It might be a bug in the reward function
Thank you very much for your suggestion. However, I don’t think the reward function is the root cause. I have tried several different reward functions, including those from SimpleRL and Skywork OR1 , and I have even used a reward model, but I still observed the same trend. Therefore, I believe the reward function may not be the main issue.
In fact, I still haven’t found the cause of the problem. Do you know of any configurations used in successful practices that might help?
I also meet this issue, do you have any solutions?
any update on this? I'm experiencing this with verl 0.5.x
I have the similar question. I use math-verify with llm_as_a_judge as the reward function and qwen3-4/8/14b-base as the policy model. Training dataset is DAPOMATH-17K. My experimental versions are verl 0.4.1.x and 0.5.x. But I find that only when I use some long-cot data to distill qwen this situation will happen. I have also try many strategies like adding or removing curriculum learning, different reward scripts, ablations about chat template, warm steps, different learning rates, different distillation data sources and amounts and so on.
Maybe you can try newer or older version of verl? Or try to filter overlong samples or give a punishment to this sort of samples? I haven’t try these strategies but I am preparing to try these.
Below is my entropy curve:
Have you solved this problem? Looking forward to your reply.
I have solved this promble by setting the response clip ratio up to 5% (abandoning left data from training). The pink one is the entropy curve after I fix this bug:
I have solved this promble by setting the response clip ratio up to 5% (abandoning left data from training). The pink one is the entropy curve after I fix this bug:
![]()
Hi there, what exactly do you mean by "left data" here?
other overlong data points
other overlong data points
could you provide more detail? I encountered the same issue and I'm dying for that QAQ
A fundamental assumption is that the output length of models increases significantly after long-CoT distillation. Since small LLMs inherently lack the strong abstract reasoning capability possessed by powerful LLMs, pure distillation cannot fully bridge this capability gap, which consequently leads to overthinking behavior in distilled small models.
To tackle this problem, we observed a key phenomenon in Just RL. They adopted r1-distilled small models as the base model to conduct long-range reinforcement learning (RL). During training, the model output length first decreases and then gradually rises.
This inspires a feasible training paradigm for small model RL:
1. First align the output length and trim overly lengthy samples 2. Proceed with further exploratory training and then let the output length grow steadily
In our practical scenarios, distilled models initially have a 10%-30% truncation ratio. These truncated samples carry no valid training signals, and even fail to optimize the EOS token. Massive noisy signals exert devastating impacts on RL training, which is inherently unstable. The model perplexity keeps accumulating until strong signals from partial samples pull model parameters back to the pre-distillation status, trapping the model in local optima.
Practical Solutions
1. Filter excessive truncated samples Empirically control the truncation ratio down to 5%. Ensure the reserved policy training samples are divisible by world size (total GPU quantity). 2. Adopt DAPO soft length penalty Set buffer token lengths based on preset SFT token limits, and apply linear length penalty. Example: Linear penalty drops to 0.5 from 8k tokens to 12k tokens.
Applicable Scope & Implementation
The above optimization strategy is strictly applicable to RL training of small models after long-CoT distillation. The relevant code logic can be efficiently implemented via Claude 4.7 and GPT Codex.
If you still fail to resolve this issue, refer to our open-source project: https://github.com/Tsinghua-dhy/CPT
We will release complete implementation codes and detailed technical reports soon. Feel free to discuss further technical details with me anytime.
Let me know if you need any step-by-step tuning parameters!
A fundamental assumption is that the output length of models increases significantly after long-CoT distillation. Since small LLMs inherently lack the strong abstract reasoning capability possessed by powerful LLMs, pure distillation cannot fully bridge this capability gap, which consequently leads to overthinking behavior in distilled small models.
To tackle this problem, we observed a key phenomenon in Just RL. They adopted r1-distilled small models as the base model to conduct long-range reinforcement learning (RL). During training, the model output length first decreases and then gradually rises.
This inspires a feasible training paradigm for small model RL:
1. First align the output length and trim overly lengthy samples 2. Proceed with further exploratory training and then let the output length grow steadily
In our practical scenarios, distilled models initially have a 10%-30% truncation ratio. These truncated samples carry no valid training signals, and even fail to optimize the EOS token. Massive noisy signals exert devastating impacts on RL training, which is inherently unstable. The model perplexity keeps accumulating until strong signals from partial samples pull model parameters back to the pre-distillation status, trapping the model in local optima.
Practical Solutions
1. Filter excessive truncated samples Empirically control the truncation ratio down to 5%. Ensure the reserved policy training samples are divisible by world size (total GPU quantity). 2. Adopt DAPO soft length penalty Set buffer token lengths based on preset SFT token limits, and apply linear length penalty. Example: Linear penalty drops to 0.5 from 8k tokens to 12k tokens.
Applicable Scope & Implementation
The above optimization strategy is strictly applicable to RL training of small models after long-CoT distillation. The relevant code logic can be efficiently implemented via Claude 4.7 and GPT Codex.
If you still fail to resolve this issue, refer to our open-source project: https://github.com/Tsinghua-dhy/CPT
We will release complete implementation codes and detailed technical reports soon. Feel free to discuss further technical details with me anytime.
Let me know if you need any step-by-step tuning parameters!
Thank you so much for your insightful reply and instructions! I have followed your suggestions and set up 4 experiments. The results are:
where the four experiment settings are:
- (Cyan) (Base model is Qwen3.5-4B non-thinking) DAPO and overlong filter, where at most 5% of trained samples are overlong samples in each batch.
- (Red) (Base model is Qwen3.5-4B non-thinking) DAPO and overlong filter, where at most 1% of trained samples are overlong samples in each batch.
- (Purple) (Base model is Qwen3-4B non-thinking) just DAPO.
- (Grey) (Base model is Qwen3.5-4B-Base non-thinking) just DAPO.
The key observations are:
- For Qwen3.5-4B non-thinking, although I added overlong filter, it still crashed.
- Qwen3.5-4B-Base's acc can grow stably via only DAPO, even if the clip ratio is 0.3 at the beginning of the training. However, it suddently crashed at around 100 steps.
- Qwen3-4B non-thinking can stably gain can grow stably via only DAPO, but it also crashed after 200 steps.
- All of them crashed after kl_loss dramatically increased.
I'm really confused. In my 50+ trials with different settings, I've never run a single experiment without any collapse. I want to kindly ask if you have tried GRPO with Qwen3.5 and DAPO-math-17K? Your experiences and suggestions are really precious. I will be more than grateful if you can share a successful training config.
Unfortunately, I have no experience of running RL training on Qwen3.5 Base. I’ve listed below several possible reasons I can think of, along with some suggestions that might be useful:
- Perhaps Qwen3.5 uses a more recent attention architecture, and
verl, open-source training frameworks, or inference frameworks such asvLLMhave not yet fully adapted to it. This may cause training to collapse due to tiny floating-point precision errors. I suggest using Codex to analyze the repository. - Confirm that the base model does not use a chat template during training.
- Check the RL micro-batch size and train batch size. Try to keep training as on-policy as possible, while avoiding too many samples in a single gradient update, since that may cause the policy to shift too much after each update. Monitor the
clip_highandclip_lowmetrics. - You can try training from a checkpoint distilled with a small number of long-CoT samples.
- Look up papers that train using the same base model, and copy their training repositories.
- Check the reward script.
- The collapse of Qwen3 4B Base after around 200 training steps should be considered normal. It indicates that the model has already reached its current capability limit on DAPO Math. Further improvement would require dedicated optimization of the training framework itself, the training data, or the base model.
- Print the number of samples participating in gradient updates in each round to ensure that the setting for discarding truncated samples is indeed taking effect.
The suggestions above are all empirical. I hope you can get the training running successfully!
Unfortunately, I have no experience of running RL training on Qwen3.5 Base. I’ve listed below several possible reasons I can think of, along with some suggestions that might be useful:
- Perhaps Qwen3.5 uses a more recent attention architecture, and
verl, open-source training frameworks, or inference frameworks such asvLLMhave not yet fully adapted to it. This may cause training to collapse due to tiny floating-point precision errors. I suggest using Codex to analyze the repository.- Confirm that the base model does not use a chat template during training.
- Check the RL micro-batch size and train batch size. Try to keep training as on-policy as possible, while avoiding too many samples in a single gradient update, since that may cause the policy to shift too much after each update. Monitor the
clip_highandclip_lowmetrics.- You can try training from a checkpoint distilled with a small number of long-CoT samples.
- Look up papers that train using the same base model, and copy their training repositories.
- Check the reward script.
- The collapse of Qwen3 4B Base after around 200 training steps should be considered normal. It indicates that the model has already reached its current capability limit on DAPO Math. Further improvement would require dedicated optimization of the training framework itself, the training data, or the base model.
- Print the number of samples participating in gradient updates in each round to ensure that the setting for discarding truncated samples is indeed taking effect.
The suggestions above are all empirical. I hope you can get the training running successfully!
Thank you for your encouragement! After tens of trial, I finally made it by setting "use_legacy_worker_impl: disable". It works. Thank you again for your reply and wish you every success at research!!
Unfortunately, I have no experience of running RL training on Qwen3.5 Base. I’ve listed below several possible reasons I can think of, along with some suggestions that might be useful:
- Perhaps Qwen3.5 uses a more recent attention architecture, and
verl, open-source training frameworks, or inference frameworks such asvLLMhave not yet fully adapted to it. This may cause training to collapse due to tiny floating-point precision errors. I suggest using Codex to analyze the repository.- Confirm that the base model does not use a chat template during training.
- Check the RL micro-batch size and train batch size. Try to keep training as on-policy as possible, while avoiding too many samples in a single gradient update, since that may cause the policy to shift too much after each update. Monitor the
clip_highandclip_lowmetrics.- You can try training from a checkpoint distilled with a small number of long-CoT samples.
- Look up papers that train using the same base model, and copy their training repositories.
- Check the reward script.
- The collapse of Qwen3 4B Base after around 200 training steps should be considered normal. It indicates that the model has already reached its current capability limit on DAPO Math. Further improvement would require dedicated optimization of the training framework itself, the training data, or the base model.
- Print the number of samples participating in gradient updates in each round to ensure that the setting for discarding truncated samples is indeed taking effect.
The suggestions above are all empirical. I hope you can get the training running successfully!
Thank you for your encouragement! After tens of trial, I finally made it by setting "use_legacy_worker_impl: disable". It works. Thank you again for your reply and wish you every success at research!!
Congratulations on the successful trial!
中文:
根据本线程目前的公开信息,这个问题还不能可靠地归因到单一的 verl 核心 bug,也不适合直接关闭。原作者报告在 GRPO 数学任务中 entropy 突然升高并导致训练崩溃,并且已经尝试过更换数据集、降低学习率、增加 KL penalty、增加 max_response_length、降低 sampling temperature、更换 DeepSeek-R1-Distill 模型等方法。原作者后续还说明,尝试 SimpleRL / Skywork OR1 的 reward function 以及 reward model 后仍观察到类似趋势。
后续讨论里有两个有用但仍偏经验性的线索:
- 社区用户指出,long-CoT distillation 后的小模型可能产生较高的 overlong / truncated sample 比例;大量被截断样本可能缺少有效训练信号。verl 文档也建议监控
response_length/clip_ratio,并说明较高的clip_ratio往往意味着截断过多。 - 另一个复现者最后报告,设置
trainer.use_legacy_worker_impl=disable后问题解决;当前 verl 文档也显示 legacy worker 正在迁移到 unified engine,且示例中存在+trainer.use_legacy_worker_impl=disable的用法。
如果这个 issue 仍需继续定位,建议补充以下最小信息:verl 版本或 commit、完整训练配置、模型与 tokenizer/chat template 设置、trainer.use_legacy_worker_impl 的实际值、response_length/clip_ratio 和 response_length_non_aborted/clip_ratio 曲线、KL / clip_high / clip_low 指标曲线,以及是否已经尝试 trainer.use_legacy_worker_impl=disable。在这些信息补齐前,我建议把当前结论视为“需要更多复现信息”,而不是确认关闭。
English:
Based on the public information in this thread, this cannot yet be attributed to a single confirmed verl core bug, and I would not recommend closing it directly. The original report describes a sudden entropy increase during GRPO math training that causes training collapse, after trying dataset changes, lower learning rate, higher KL penalty, larger max_response_length, lower sampling temperature, and different DeepSeek-R1-Distill models. The author also reported that trying SimpleRL / Skywork OR1 reward functions and a reward model did not remove the same trend.
There are two useful but still empirical leads in the later discussion:
- A community member suggested that small models after long-CoT distillation may have a high overlong / truncated-sample ratio, and that many truncated samples may carry weak or invalid training signals. The verl docs also recommend monitoring
response_length/clip_ratio, where a high value often means too much truncation. - Another reproducer later reported that setting
trainer.use_legacy_worker_impl=disablemade their run work. Current verl docs also show the migration away from legacy workers toward the unified engine, and examples include+trainer.use_legacy_worker_impl=disable.
If this issue still needs investigation, please provide the minimal reproduction details: verl version or commit, full training config, model and tokenizer/chat-template settings, the actual trainer.use_legacy_worker_impl value, response_length/clip_ratio and response_length_non_aborted/clip_ratio curves, KL / clip_high / clip_low curves, and whether trainer.use_legacy_worker_impl=disable has already been tested. Until then, I would classify this as needing more reproduction information rather than confirmed for closure.
This response was generated by a scheduled Codex GPT5.5 issue processing task.