Downloads · 30 days
170
20% of all-time downloads
cmcheng/DeepMath-GRPO_DeepSeek-R1-Distill-Qwen-1.5B
DeepMath-GRPO_DeepSeek-R1-Distill-Qwen-1.5B is a text generation model from cmcheng. Use it when you need the model to write or continue text. It is set up for transformers.
- 训练环境: - 显卡:2 NVIDIA 4090 48GB - 加速框架:DeepSpeed,采用 bf16 混合精度训练
Downloads · 30 days
170
20% of all-time downloads
All-time downloads
852
Public
Parameters
1.8B
7.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.6 GB · 100%
From the Hugging Face model README
训练环境:
训练数据量:97870
测试数据量:5152
验证集选取:从测试集随机抽取 100 条
训练迭代步数: 5000
训练参数:
grpo_config = GRPOConfig(
# ---- 基础配置 ----
output_dir="./deepmath_grpo_output",
save_strategy='steps',
save_total_limit=2,
#save_steps=100,
# ---- 批次大小 ----
per_device_train_batch_size=4, # 每设备批次大小
per_device_eval_batch_size=4,
gradient_accumulation_steps=4, # 梯度累积步数
# 有效批次大小 = 4 * 2 * 8 GPUs = 64(与论文 512 有差距,可根据硬件调整)
# ---- 训练步数 ----
max_steps=5000, # 论文中 DeepMath-Zero 训练 500 步
#num_train_epochs=1,
# ---- 推理框架配置
use_vllm=True,
vllm_gpu_memory_utilization=0.3,
# 评估策略
eval_strategy='steps',
eval_steps=500,
metric_for_best_model="eval_reward",
greater_is_better=True,
logging_strategy='epoch',
logging_dir="train_logs/",
load_best_model_at_end=True,
# ---- 学习率 ----
learning_rate=1e-6, # 论文 Table 5: lr=1e-6
# ---- GRPO 特有参数 ----
num_generations=settings.GROUP_SIZE_TRAIN, # 4
num_generations_eval=settings.GROUP_SIZE_EVAL, # 4
generation_batch_size=4, # 生成批次大小
max_completion_length=2048, # 最大生成长度(论文推理时为 32768,训练时 2048)
loss_type='grpo', # 使用标准 GRPO 算法训练
# ---- KL 散度控制 ----
beta=0.001, # 论文 Table 5: kl_coef=1e-3
# ---- 裁剪参数 ----
epsilon=0.2, # 论文 Table 5: clip_ratio_low=0.2
epsilon_high=0.28, # 论文 Table 5: clip_ratio_high=0.28
# ---- 温度参数 ----
temperature=1.0, # 论文 Table 5: temperature=1.0 (Zero RL)
# ---- 内存优化 ----
bf16=torch.cuda.is_bf16_supported(),
fp16=not torch.cuda.is_bf16_supported(),
gradient_checkpointing=True,
# ---- 报告与日志 ----
report_to="tensorboard", # 可改为 "wandb" 启用 wandb 日志
run_name="deepmath-grpo-qwen-0.5b-instruct",
# 随机种子
seed=settings.SEED
)