Code for the SofT-GRPO algorithm on the LLM soft-thinking reasoning pattern.
Python
53
23 commits
updated Jan 2, 2026
We greatly appreciate your feedback and questions regarding the current status of this work.
Please feel free to contact Zhi Zheng at zhi.zheng@u.nus.edu
🔥 The First Powerful RLVR Algorithm for Soft-Thinking Reasoning: We introduce SofT-GRPO, a novel and powerful policy optimization algorithm designed for reinforcing the soft-thinking reasoning paradigm in LLMs.
⚙️ Gumbel-Softmax Noise in Rollout: It integrates the Gumbel-Softmax technique into the group rollout process, actively obtaining diverse but valid soft-thinking reasoning paths.
⚙️ Gumbel Reparameterization: We propose an innovative gradient estimation approach via Gumbel reparameterization, enabling precise attribution of improvements to the LLM’s output probability distributions in policy optimization.
📝 Comprehensive Experiments and High Effectiveness: We conduct comprehensive experiments across LLMs of 1.5B–7B parameters on five benchmarks, demonstrating that SofT-GRPO consistently outperforms the discrete-token GRPO baselines, especially at higher sample rates (Pass@16 and Pass@32). SofT-GRPO can also improve the out-of-Domain generalization ability of LLMs.
🔥 Showing the Prospects of Soft-Thinking: Can Soft-Thinking be the Answer for Better Effectiveness?
[2025/9/24] Code, Weight, and Paper are released!
[2025/12/9] [√] SGLang & verl Code Modification (e.g., activate the overlap for efficiency).
git clone https://github.com/zz1358m/SofT-GRPO-master
cd SofT-GRPO-master
conda create -n soft_grpo python=3.11.13 -y && conda activate soft_grpo
pip install pip==25.2
pip install torch==2.6.0 transformers==4.51.1 tensorboard==2.20.0 sgl_kernel==0.1.1 accelerate==1.10.1 torch_memory_saver==0.0.8 uvloop==0.21.0 jsonlines math_verify openai
pip install flash_attn==2.7.3 --no-build-isolation # may take more time (20min). try `pip install flash_attn==2.7.3 --no-build-isolation` if find undefined symbol bug, or try downloading from its official github.
cd Soft-Thinking+noise+loss-main/sglang_soft_thinking_pkg
pip install -e "python[all]"
cd ../..
building the verl-0.4.x after doing the Option1.
cd verl-0.4.x
pip3 install -e .
cd ..
or trying to install requirements. (not recommended)
pip install -r requirements.txt
./Soft-Thinking+noise+loss-main/run_sample_discrete-token_grpo.sh
./Soft-Thinking+noise+loss-main/run_sample_gumbel_grpo.sh
./Soft-Thinking+noise+loss-main/run_sample_gumbel.sh
./SofT-GRPO-deepscaler-8k.sh # change the LLM path, dataset path accordingly
./SofT-GRPO-deepscaler-8k-qwen7.sh # change the LLM path, dataset path accordingly
./SofT-GRPO-deepscaler-8k-llama3.sh # change the LLM path, dataset path accordingly
For a quick and reproducible setup, a pre-built Docker image is also available on GitHub Packages. You can pull and run it with the following commands:
docker pull ghcr.io/kuangrepi/soft-grpo:latest
docker run --gpus all -it --rm ghcr.io/kuangrepi/soft-grpo:latest
If you find our work helpful for your research, please consider giving a star ⭐ and citation 📝
@article{zheng2025soft,
title={SofT-GRPO: Surpassing Discrete-Token LLM Reinforcement Learning via Gumbel-Reparameterized Soft-Thinking Policy Optimization},
author={Zheng, Zhi and Lee, Wee Sun},
journal={arXiv preprint arXiv:2511.06411},
year={2025}
}
Python
87.2%
C++
3.3%
Cuda
3.2%
Shell
2.9%
Jupyter Notebook
2.1%
Code for the SofT-GRPO algorithm on the LLM soft-thinking reasoning pattern.
Python
53
23 commits
updated Jan 2, 2026
We greatly appreciate your feedback and questions regarding the current status of this work.
Please feel free to contact Zhi Zheng at zhi.zheng@u.nus.edu
🔥 The First Powerful RLVR Algorithm for Soft-Thinking Reasoning: We introduce SofT-GRPO, a novel and powerful policy optimization algorithm designed for reinforcing the soft-thinking reasoning paradigm in LLMs.
⚙️ Gumbel-Softmax Noise in Rollout: It integrates the Gumbel-Softmax technique into the group rollout process, actively obtaining diverse but valid soft-thinking reasoning paths.
⚙️ Gumbel Reparameterization: We propose an innovative gradient estimation approach via Gumbel reparameterization, enabling precise attribution of improvements to the LLM’s output probability distributions in policy optimization.
📝 Comprehensive Experiments and High Effectiveness: We conduct comprehensive experiments across LLMs of 1.5B–7B parameters on five benchmarks, demonstrating that SofT-GRPO consistently outperforms the discrete-token GRPO baselines, especially at higher sample rates (Pass@16 and Pass@32). SofT-GRPO can also improve the out-of-Domain generalization ability of LLMs.
🔥 Showing the Prospects of Soft-Thinking: Can Soft-Thinking be the Answer for Better Effectiveness?
[2025/9/24] Code, Weight, and Paper are released!
[2025/12/9] [√] SGLang & verl Code Modification (e.g., activate the overlap for efficiency).
git clone https://github.com/zz1358m/SofT-GRPO-master
cd SofT-GRPO-master
conda create -n soft_grpo python=3.11.13 -y && conda activate soft_grpo
pip install pip==25.2
pip install torch==2.6.0 transformers==4.51.1 tensorboard==2.20.0 sgl_kernel==0.1.1 accelerate==1.10.1 torch_memory_saver==0.0.8 uvloop==0.21.0 jsonlines math_verify openai
pip install flash_attn==2.7.3 --no-build-isolation # may take more time (20min). try `pip install flash_attn==2.7.3 --no-build-isolation` if find undefined symbol bug, or try downloading from its official github.
cd Soft-Thinking+noise+loss-main/sglang_soft_thinking_pkg
pip install -e "python[all]"
cd ../..
building the verl-0.4.x after doing the Option1.
cd verl-0.4.x
pip3 install -e .
cd ..
or trying to install requirements. (not recommended)
pip install -r requirements.txt
./Soft-Thinking+noise+loss-main/run_sample_discrete-token_grpo.sh
./Soft-Thinking+noise+loss-main/run_sample_gumbel_grpo.sh
./Soft-Thinking+noise+loss-main/run_sample_gumbel.sh
./SofT-GRPO-deepscaler-8k.sh # change the LLM path, dataset path accordingly
./SofT-GRPO-deepscaler-8k-qwen7.sh # change the LLM path, dataset path accordingly
./SofT-GRPO-deepscaler-8k-llama3.sh # change the LLM path, dataset path accordingly
For a quick and reproducible setup, a pre-built Docker image is also available on GitHub Packages. You can pull and run it with the following commands:
docker pull ghcr.io/kuangrepi/soft-grpo:latest
docker run --gpus all -it --rm ghcr.io/kuangrepi/soft-grpo:latest
If you find our work helpful for your research, please consider giving a star ⭐ and citation 📝
@article{zheng2025soft,
title={SofT-GRPO: Surpassing Discrete-Token LLM Reinforcement Learning via Gumbel-Reparameterized Soft-Thinking Policy Optimization},
author={Zheng, Zhi and Lee, Wee Sun},
journal={arXiv preprint arXiv:2511.06411},
year={2025}
}
Python
87.2%
C++
3.3%
Cuda
3.2%
Shell
2.9%
Jupyter Notebook
2.1%