Downloads · 30 days
21
33% of all-time downloads
Aurorra1123/Qwen3-4B-Instruct-2507-ClawGym-SFT
Qwen3-4B-Instruct-2507-ClawGym-SFT is a text generation model from Aurorra1123. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
ClawGym agentic 轨迹数据上的 SFT 复现结果。基座为 Qwen3-4B-Instruct-2507,训练框架 OpenRLHF 0.10.4 + DeepSpeed ZeRO-2,硬件 4× H200。
Downloads · 30 days
21
33% of all-time downloads
All-time downloads
63
Public
Parameters
4.4B
11 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.8 GB · 80%
From the Hugging Face model README
ClawGym agentic 轨迹数据上的 SFT 复现结果。基座为 Qwen3-4B-Instruct-2507,训练框架 OpenRLHF 0.10.4 + DeepSpeed ZeRO-2,硬件 4× H200。
| 项目 | 数值 |
|---|---|
| 总墙钟 | 19.6 小时(每 epoch 约 6 小时 32 分) |
| 优化步 | 573 步(191 步/epoch × 3 epoch) |
| 末步 loss | 0.454 |
| 末步学习率 | 1e-6 |
| 平均微步耗时 | 7.72 s/it |
| 显存峰值 | 约 142.6 GB / 143 GB(单卡) |
| 运行状态 | 3 个 epoch 全部完成,无 OOM,4 个 rank 正常退出 |
epoch 数取 3,依据为 ClawGym 论文中性能在第 3 个 epoch 结束(step 309)时最高、之后小幅持续下降的结论,以及官方 launch_scripts/example.sh 的 --max_epochs 3。
完整脚本见 training/run_sft.sh。
| 参数 | 取值 |
|---|---|
| 基座模型 | Qwen3-4B-Instruct-2507(qwen3,36 层,hidden 2560,bf16) |
| max_len | 65536 |
| batch_size | 128 |
| micro_batch_size | 8 |
| 梯度累积 | 16 |
| max_epochs | 3 |
| 学习率 | 1e-5(Adam) |
| zero_stage | 2 |
| param_dtype | bf16 |
| ring_attn_size | 4(序列并行,数据并行度 1) |
| attn 实现 | flash_attention_2 |
| packing_samples | 开启 |
| gradient_checkpointing | 开启 |
| PYTORCH_CUDA_ALLOC_CONF | expandable_segments:True |
| checkpoint | save_steps 80(优化步),max_num 10,save_hf |
OpenRLHF 0.10.4 使用命名空间式参数(--data.* / --train.* / --ds.* / --model.* / --ckpt.*),ClawGym example.sh 中的扁平参数在该版本已失效。
本次使用 micro_batch_size=8,官方脚本中该值为 1。
OpenRLHF 0.10.4 的 SFT 数据侧只有基于 pad 的 collate_fn(openrlhf/datasets/sft_dataset.py),不会把多条样本装入同一个 ≤max_len 的 bin。--packing_samples 仅触发模型侧的去-pad 与变长注意力路径(openrlhf/models/ring_attn_utils.py 的 unpad_and_slice_tensor),该路径按 micro-batch 内的行构造 cu_seqlens,因此 micro_batch_size=1 时无实际作用。上述两个文件与官方 v0.10.4 逐字节一致,为框架原始行为。
取 micro=8 后,每 epoch 的微步数由 24497 降至 3051。子集实测比 micro=1 快约 23%,逐优化步的 gpt_loss 与单条模式的差值 ≤0.0011。
见 training/requirements-freeze.txt(完整 pip 清单)与 training/env-core.txt。
| 项目 | 版本 |
|---|---|
| 硬件 | 4× NVIDIA H200(143771 MiB),驱动 580.126.20 |
| Python | 3.11.15 |
| torch | 2.8.0+cu128(CUDA 12.8) |
| openrlhf | 0.10.4(editable,源码取自 ClawGym-Agents/SFT/OpenRLHF) |
| deepspeed | 0.19.1 |
| transformers | 5.7.0 |
| flash_attn | 2.8.3+cu12torch2.8 |
| ring-flash-attn | 0.1.8 |
| accelerate | 1.14.0 |
| datasets | 5.0.1 |
| tokenizers | 0.22.2 |
| peft | 0.20.0 |
data/sft_trajectory.jsonl,来自 ClawGym-Trajectory,2.1 GB,24497 条多轮 agentic 轨迹。
| 项目 | 数值 |
|---|---|
| 顶层字段 | messages、tools |
| 每条记录的消息数 | 中位 22,均值 28.7,范围 7–135 |
| system 消息数 | 24497 |
| user 消息数 | 24497 |
| assistant 消息数 | 291884 |
| tool 消息数 | 361487 |
数据版权归 ClawGym 原作者所有,此处仅用于记录本次训练所用的输入。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Aurorra1123/Qwen3-4B-Instruct-2507-ClawGym-SFT"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
DeepSpeed 中间 checkpoint(global_step160/240/320/400/480/560)未上传,保留在本地训练机上。其中 step320 对应论文所述最优点位置。
评测(ClawGymBench、OpenClaw、judge)不在本次范围内,本仓库只包含训练产物。