Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

TinyZero

> 编程语言
Open source

Minimal reproduction of DeepSeek R1-Zero

13.2K stars0 likes2 views
WebsiteGitHub

About

Minimal reproduction of DeepSeek R1-Zero

TinyZero

⚠️ Deprecation Notice: This repo is no longer actively maintained. For running RL experiments, please directly use the latest veRL library. For the archived original documentation, see OLD_README.md.

TinyZero is a reproduction of DeepSeek R1 Zero in countdown and multiplication tasks. We built upon veRL.

Through RL, the 3B base LM develops self-verification and search abilities all on its own.

You can experience the Aha moment yourself for < $30.

Twitter thread: https://x.com/jiayi_pirate/status/1882839370505621655

Full experiment log: https://wandb.ai/jiayipan/TinyZero

📢: We release Adaptive Parallel Reasoning, where we explore a new dimension in scaling reasoning models.

Installation

bash
conda create -n zero python=3.9
# install torch [or you can skip this step and let vllm install the correct version for you]
pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu121
# install vllm
pip3 install vllm==0.6.3 # or you can install 0.5.4, 0.4.2 and 0.3.1
pip3 install ray

# verl
pip install -e .

# flash attention 2
pip3 install flash-attn --no-build-isolation
# quality of life
pip install wandb IPython matplotlib

Countdown task

Data Preparation

conda activate zero
python ./examples/data_preprocess/countdown.py --local_dir {path_to_your_dataset}

Run Training

conda activate zero

For the following code, if you see out-of-VRAM, try adding critic.model.enable_gradient_checkpointing=True to the script, and check out the discussion here.

Single GPU

Works for model <= 1.5B. For Qwen2.5-0.5B base, we know it fails to learn reasoning.

bash
export N_GPUS=1
export BASE_MODEL={path_to_your_model}
export DATA_DIR={path_to_your_dataset}
export ROLLOUT_TP_SIZE=1
export EXPERIMENT_NAME=countdown-qwen2.5-0.5b
export VLLM_ATTENTION_BACKEND=XFORMERS

bash ./scripts/train_tiny_zero.sh

3B+ model In this case, the base model is able to develop sophisticated reasoning skills.

bash
export N_GPUS=2
export BASE_MODEL={path_to_your_model}
export DATA_DIR={path_to_your_dataset}
export ROLLOUT_TP_SIZE=2
export EXPERIMENT_NAME=countdown-qwen2.5-3b
export VLLM_ATTENTION_BACKEND=XFORMERS

bash ./scripts/train_tiny_zero.sh

Instruct Ablation

We experiment with Qwen-2.5-3B Instruct too. Data Preparation To follow chat template, we need to reprocess the data:

bash
conda activate zero
python examples/data_preprocess/countdown.py --template_type=qwen-instruct --local_dir={path_to_your_dataset}

Training

bash
export N_GPUS=2
export BASE_MODEL={path_to_your_model}
export DATA_DIR={path_to_your_dataset}
export ROLLOUT_TP_SIZE=2
export EXPERIMENT_NAME=countdown-qwen2.5-3b-instruct
export VLLM_ATTENTION_BACKEND=XFORMERS

bash ./scripts/train_tiny_zero.sh

Acknowledgements

  • We run our experiments based on veRL.
  • We use Qwen2.5 series base model Qwen2.5.

Citation

@misc{tinyzero,
author       = {Jiayi Pan and Junjie Zhang and Xingyao Wang and Lifan Yuan and Hao Peng and Alane Suhr},
title        = {TinyZero},
howpublished = {https://github.com/Jiayi-Pan/TinyZero},
note         = {Accessed: 2025-01-24},
year         = {2025}
}

Issues· 82 open

View all issuesOpen on GitHub
  • #125

    Did anyone try to launch this repo with a more recent version of veRL?

    Updated Jun 29, 2026
  • #124

    Qwen2.5 1.5B with GRPO meets Entropy Collapse

    Updated Jun 27, 2026
  • #105

    qwen2.5-3b OOM Issue on 8x V100 GPUs

    Updated Mar 29, 2026
  • #122

    How to reproduce a qwen-3b model that supports multiplication?

    Updated Dec 2, 2025
  • #77

    模型只会加减,不会乘除。。。

    Updated Dec 2, 2025
  • #92

    how to run main_generation and main_eval?

    Updated Dec 2, 2025
  • #108

    How to guarantee the problem is valid?

    Updated Dec 2, 2025
  • #100

    How to run SFT on 2 L40 GPUs

    Updated Dec 2, 2025
  • #120

    定义答案正确的奖励是不是应该从<answer>的标签里找

    Updated Nov 7, 2025
  • #57

    follow the official code,got the error:because name 'global_poolverl_group_2:0' already exists

    Updated Oct 2, 2025

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言