24点游戏
收藏资源简介:
24点游戏是一个经典的数学游戏,要求使用4个数字和基本运算(加法、减法、乘法、除法)来得到结果24。本项目通过不同的训练方法(Zero-RL、SFT、SFT+RL)来增强大型语言模型(LLMs)在24点游戏中的推理和自我验证能力。
The 24-point game is a classic mathematical puzzle that requires using four given numbers and four basic arithmetic operations (addition, subtraction, multiplication, and division) to obtain the result of 24. This work adopts multiple training strategies including Zero-RL, SFT, and SFT+RL to enhance the reasoning and self-validation capabilities of Large Language Models (LLMs) in the 24-point game.
24-Game-Reasoning 数据集概述
数据集简介
- 目标:通过不同训练方法(Zero-RL、SFT、SFT+RL)增强大语言模型在24点游戏中的推理和自验证能力
- 游戏类型:经典数学游戏,使用4个数字和基本运算(加、减、乘、除)得到结果24
游戏规则
- 必须使用四张牌的数字各一次
- 允许运算符:加法(+)、减法(-)、乘法(×)、除法(÷)
- 允许使用括号()改变运算顺序
- 禁止使用其他运算符或数字
- 除法结果可以是小数或无限循环数
数据集结构
24-Game-Reasoning/
├── data/
│ ├── 24game_grpo/ # RL数据集
│ └── 24game_sft/ # SFT数据集
├── docs/
├── images/
│ ├── examples/
│ └── results/
├── results/
├── scripts/
│ ├── data_processing/
│ ├── evaluation/
│ └── training/
├── templates/
├── utils/
├── verl/
使用方法
1. 数据准备
bash python scripts/data_processing/data_preparation.py
2. 模型训练
2.1 Zero-RL训练
bash cd verl bash scripts/run_qwen25_math_grpo.sh
2.2 SFT训练
bash cd verl bash scripts/run_qwen25_math_sft.sh 4 None
2.3 SFT+RL训练
bash cd verl bash scripts/run_qwen25_math_grpo_sft_rl.sh
3. 模型评估
bash python scripts/evaluation/eval.py --base_model_path /path/to/model --val_data_path data/24game_sft/val.parquet
实验结果
方法比较
- Zero-RL:直接使用RL训练基础模型
- SFT:使用人工标注数据进行监督微调
- SFT+RL:先进行SFT训练,再进行RL训练
主要发现
- RL训练能有效增强模型在24点游戏中的推理和自验证能力
- 思维链长度与准确率呈正相关,但过长会导致计算资源浪费
- SFT+RL组合方法效果最佳,Zero-RL也是有效训练策略
引用格式
bibtex @misc{24GameReasoning2024, author = {Wei, Shaohang}, title = {24-Game-Reasoning: Enhancing LLMs Reasoning and Self-Verification Capabilities}, year = {2025}, publisher = {GitHub}, journal = {GitHub Repository}, howpublished = {url{https://github.com/sylvain-wei/24-Game-Reasoning}} }
许可协议
- MIT License




