An experimental repository for math reasoning with two kinds of reward signals:
\boxed{} and compare it directly with the ground-truth answer.TIGER-Lab/general-verifier to judge whether the student answer is equivalent to the reference answer.The current codebase focuses on AIME-style evaluation, Qwen base models, GRPO/LoRA training, and verifier-based scoring.
general-verifiertrl's GRPOTrainer.
├── main.py # Placeholder entry point; currently only prints hello
├── train.py # GRPO + accuracy reward training entry (DAPO-Math-17k subset)
├── train_grpo.py # GRPO + verifier reward training entry (DeepMath-103K)
├── experiments/
│ ├── common.py # AIME loading, answer extraction, shared prompts
│ ├── baseline.py # AIME 2024 baseline evaluation
│ ├── aime25_baseline.py # AIME 2025 baseline evaluation
│ ├── verifier.py # Local general-verifier loading and vLLM wrapper
│ ├── reward_func.py # Verifier reward used during training
│ ├── eval_grpo_lora.py # LoRA checkpoint evaluation
│ ├── eval_grpo_lora_ver.py # Verifier-reward LoRA checkpoint evaluation
│ └── sampler.py # OpenAI-style chat sampler
├── scripts/
│ ├── vllm.sh # Starts the local vLLM service
│ ├── dapo-grpo.sh # Example accelerate launch script
│ ├── rule-based-grpo.sh # Currently empty
│ └── verifier-based-grpo.sh # Currently empty
├── aime_2024/ # Local AIME 2024 data
├── aime_2025/ # Local AIME 2025 data
├── outputs/ # Evaluation outputs
├── dapo_math.jsonl # Additional dataset file
├── pyproject.toml # Dependency definition
└── uv.lock # uv lockfile
uv for dependency managementThe repository depends on several heavy packages, including:
torch==2.6transformers==4.57.3trl>=0.29.0vllm==0.8.5.post1flash-attnflashinfer-pythonpeftopenaiInstall dependencies with:
uv sync
aime_2024/train.jsonlaime_2024/test.jsonlaime_2024/chat.jsonlaime_2025/train.jsonlaime_2025/test.jsonlexperiments/common.py provides two helpers:
load_aime(data_dir, split) for train / testload_aime_chat_format(data_dir, split="chat") for chat-style samplesThe training scripts also use Hugging Face datasets directly:
BytedTsinghua-SIA/DAPO-Math-17ktrl-lib/DeepMath-103KYou need Hugging Face access the first time you run those scripts.
experiments/common.py defines answer extraction logic that first tries to find the last \boxed{...} in the model response.
The baseline scripts compare the extracted answer against the dataset answer field to produce rule-based-score.
Both experiments/verifier.py and experiments/reward_func.py construct a verifier prompt with:
Final Decision: Yes or Final Decision: NoThere are currently two ways to use the verifier:
TIGER-Lab/general-verifier locallyuv sync
Use the provided script:
bash scripts/vllm.sh
At the moment, the script is equivalent to:
CUDA_VISIBLE_DEVICES=0,1 uv run vllm serve Qwen/Qwen3-4B-Base \
--tensor-parallel-size 2 \
--port 8000 \
--gpu-memory-utilization 0.8 \
--max-model-len 8192 \
--dtype auto \
--task generate \
--reasoning-parser deepseek_r1
Default API endpoint:
http://localhost:8000/v1
AIME 2024:
uv run python experiments/baseline.py
AIME 2025:
uv run python experiments/aime25_baseline.py
Outputs are written under:
outputs/baseline/outputs/aime25_baseline/Rule-based reward training entry:
uv run accelerate launch train.py
Verifier-based reward training entry:
uv run accelerate launch train_grpo.py
You can also use the example shell script:
bash scripts/dapo-grpo.sh
Notes:
scripts/rule-based-grpo.sh is currently emptyscripts/verifier-based-grpo.sh is currently emptyCUDA_VISIBLE_DEVICES before multi-GPU runstrain.py and train_grpo.py currently hardcode the model name, dataset, and some hyperparametersStandard LoRA evaluation:
uv run python experiments/eval_grpo_lora.py
Verifier-reward LoRA evaluation:
uv run python experiments/eval_grpo_lora_ver.py
These scripts currently:
Qwen/Qwen3-4B-Baseoutputs/eval_grpo_lora/ or outputs/eval_grpo_lora_ver/Before running them, you will usually need to update the variables at the top of each script:
model_namelora_pathsplitdataset_nametrain.pyCurrent default behavior:
BytedTsinghua-SIA/DAPO-Math-17ktrain[:2000]trl.rewards.accuracy_rewardQwen/Qwen3-4B-Base./DAPO_GRPO_LORAtrain_grpo.pyCurrent default behavior:
trl-lib/DeepMath-103Kexperiments.reward_func.verifier_rewardQwen/Qwen3-4B-Base./testmax_steps=1000experiments/baseline.pyFlow:
aime_2024\boxed{}GeneralVerifier for an additional correctness judgmentexperiments/aime25_baseline.pySame overall flow as above, but using aime_2025.
experiments/reward_func.pyThis is the reward function used by GRPOTrainer.
It extracts answers from completions, calls TIGER-Lab/general-verifier through the OpenAI-compatible endpoint, and appends logs to verifier_log.txt.
experiments/verifier.pyProvides two verifier paths:
GeneralVerifier: loads the Hugging Face model locally and runs generateverify_reward_from_vllm(...): calls the verifier through http://localhost:8000/v1Most outputs are stored under outputs/:
outputs/baseline/outputs/aime25_baseline/outputs/eval_grpo_lora/outputs/eval_grpo_lora_ver/Training logs or verifier debug logs may also be written to:
verifier_log.txtThis is still an experiment repository, and several parts are intentionally rough:
main.py is not a real project entry point yetscripts/rule-based-grpo.sh and scripts/verifier-based-grpo.sh are emptytests/ package yet; validation is mostly script-basedIf you want the shortest path to reproducing the current setup:
uv syncbash scripts/vllm.shuv run python experiments/baseline.pytrain.py or train_grpo.py for your hardware and target experimentexperiments/eval_grpo_lora.py or experiments/eval_grpo_lora_ver.pyaccelerate and deepspeed configs more clearly11 commits
Jupyter Notebook
56.3%
Python
41.2%
Shell
2.5%
An experimental repository for math reasoning with two kinds of reward signals:
\boxed{} and compare it directly with the ground-truth answer.TIGER-Lab/general-verifier to judge whether the student answer is equivalent to the reference answer.The current codebase focuses on AIME-style evaluation, Qwen base models, GRPO/LoRA training, and verifier-based scoring.
general-verifiertrl's GRPOTrainer.
├── main.py # Placeholder entry point; currently only prints hello
├── train.py # GRPO + accuracy reward training entry (DAPO-Math-17k subset)
├── train_grpo.py # GRPO + verifier reward training entry (DeepMath-103K)
├── experiments/
│ ├── common.py # AIME loading, answer extraction, shared prompts
│ ├── baseline.py # AIME 2024 baseline evaluation
│ ├── aime25_baseline.py # AIME 2025 baseline evaluation
│ ├── verifier.py # Local general-verifier loading and vLLM wrapper
│ ├── reward_func.py # Verifier reward used during training
│ ├── eval_grpo_lora.py # LoRA checkpoint evaluation
│ ├── eval_grpo_lora_ver.py # Verifier-reward LoRA checkpoint evaluation
│ └── sampler.py # OpenAI-style chat sampler
├── scripts/
│ ├── vllm.sh # Starts the local vLLM service
│ ├── dapo-grpo.sh # Example accelerate launch script
│ ├── rule-based-grpo.sh # Currently empty
│ └── verifier-based-grpo.sh # Currently empty
├── aime_2024/ # Local AIME 2024 data
├── aime_2025/ # Local AIME 2025 data
├── outputs/ # Evaluation outputs
├── dapo_math.jsonl # Additional dataset file
├── pyproject.toml # Dependency definition
└── uv.lock # uv lockfile
uv for dependency managementThe repository depends on several heavy packages, including:
torch==2.6transformers==4.57.3trl>=0.29.0vllm==0.8.5.post1flash-attnflashinfer-pythonpeftopenaiInstall dependencies with:
uv sync
aime_2024/train.jsonlaime_2024/test.jsonlaime_2024/chat.jsonlaime_2025/train.jsonlaime_2025/test.jsonlexperiments/common.py provides two helpers:
load_aime(data_dir, split) for train / testload_aime_chat_format(data_dir, split="chat") for chat-style samplesThe training scripts also use Hugging Face datasets directly:
BytedTsinghua-SIA/DAPO-Math-17ktrl-lib/DeepMath-103KYou need Hugging Face access the first time you run those scripts.
experiments/common.py defines answer extraction logic that first tries to find the last \boxed{...} in the model response.
The baseline scripts compare the extracted answer against the dataset answer field to produce rule-based-score.
Both experiments/verifier.py and experiments/reward_func.py construct a verifier prompt with:
Final Decision: Yes or Final Decision: NoThere are currently two ways to use the verifier:
TIGER-Lab/general-verifier locallyuv sync
Use the provided script:
bash scripts/vllm.sh
At the moment, the script is equivalent to:
CUDA_VISIBLE_DEVICES=0,1 uv run vllm serve Qwen/Qwen3-4B-Base \
--tensor-parallel-size 2 \
--port 8000 \
--gpu-memory-utilization 0.8 \
--max-model-len 8192 \
--dtype auto \
--task generate \
--reasoning-parser deepseek_r1
Default API endpoint:
http://localhost:8000/v1
AIME 2024:
uv run python experiments/baseline.py
AIME 2025:
uv run python experiments/aime25_baseline.py
Outputs are written under:
outputs/baseline/outputs/aime25_baseline/Rule-based reward training entry:
uv run accelerate launch train.py
Verifier-based reward training entry:
uv run accelerate launch train_grpo.py
You can also use the example shell script:
bash scripts/dapo-grpo.sh
Notes:
scripts/rule-based-grpo.sh is currently emptyscripts/verifier-based-grpo.sh is currently emptyCUDA_VISIBLE_DEVICES before multi-GPU runstrain.py and train_grpo.py currently hardcode the model name, dataset, and some hyperparametersStandard LoRA evaluation:
uv run python experiments/eval_grpo_lora.py
Verifier-reward LoRA evaluation:
uv run python experiments/eval_grpo_lora_ver.py
These scripts currently:
Qwen/Qwen3-4B-Baseoutputs/eval_grpo_lora/ or outputs/eval_grpo_lora_ver/Before running them, you will usually need to update the variables at the top of each script:
model_namelora_pathsplitdataset_nametrain.pyCurrent default behavior:
BytedTsinghua-SIA/DAPO-Math-17ktrain[:2000]trl.rewards.accuracy_rewardQwen/Qwen3-4B-Base./DAPO_GRPO_LORAtrain_grpo.pyCurrent default behavior:
trl-lib/DeepMath-103Kexperiments.reward_func.verifier_rewardQwen/Qwen3-4B-Base./testmax_steps=1000experiments/baseline.pyFlow:
aime_2024\boxed{}GeneralVerifier for an additional correctness judgmentexperiments/aime25_baseline.pySame overall flow as above, but using aime_2025.
experiments/reward_func.pyThis is the reward function used by GRPOTrainer.
It extracts answers from completions, calls TIGER-Lab/general-verifier through the OpenAI-compatible endpoint, and appends logs to verifier_log.txt.
experiments/verifier.pyProvides two verifier paths:
GeneralVerifier: loads the Hugging Face model locally and runs generateverify_reward_from_vllm(...): calls the verifier through http://localhost:8000/v1Most outputs are stored under outputs/:
outputs/baseline/outputs/aime25_baseline/outputs/eval_grpo_lora/outputs/eval_grpo_lora_ver/Training logs or verifier debug logs may also be written to:
verifier_log.txtThis is still an experiment repository, and several parts are intentionally rough:
main.py is not a real project entry point yetscripts/rule-based-grpo.sh and scripts/verifier-based-grpo.sh are emptytests/ package yet; validation is mostly script-basedIf you want the shortest path to reproducing the current setup:
uv syncbash scripts/vllm.shuv run python experiments/baseline.pytrain.py or train_grpo.py for your hardware and target experimentexperiments/eval_grpo_lora.py or experiments/eval_grpo_lora_ver.pyaccelerate and deepspeed configs more clearly11 commits
Jupyter Notebook
56.3%
Python
41.2%
Shell
2.5%