Views
No views yet
Note: This is a test run with minimal data (8 train / 4 test samples, 6 steps) to validate the training pipeline configuration.
code_interpreter tool across multiple turns
to solve math and coding problems, rather than relying on verbose self-reasoning
or indiscriminate tool calls.Qwen3-4B-Instruct-2507
│
├── Stage 1: SFT (multi-turn agentic cold-start)
│ Dataset: y-ohtani/open_agentrl_like_sft (2K samples, Apache-2.0)
│ Epochs: 10, Max length: 32768, Full fine-tuning (FSDP, bfloat16)
│
└── Stage 2: GRPO-TCR (this model)
Dataset: y-ohtani/open_agentrl_grpo_2k (8 samples = test run, Apache-2.0)
Epochs: 3, Total steps: 6, Algorithm: GRPO + 5 enhancements (see below)| Parameter | Value |
|---|---|
| Base (SFT model) | qwen3-4b-ra-sft-merged-epoch3 |
| Algorithm | GRPO (Group Relative Policy Optimization) |
| Max prompt length | 2,560 |
| Max response length | 10,480 |
| Max turns | 16 |
| Learning rate | 1e-6 |
| Train batch size | 4 |
| Responses per prompt (n) | 8 |
| PPO mini batch size | 1 |
| Epochs | 3 |
| Total steps | 6 |
| Train samples | 8 (test run) |
| Test samples | 4 |
| Loss aggregation | token-mean |
| Clip ratio | low=0.2, high=0.28 (asymmetric) |
| KL divergence | Disabled (kl_coef=0.0) |
| Overlong penalty | buffer=3,000, factor=1.0 |
| Reward manager | DAPO |
| Rollout engine | vLLM (sync mode, TP=4) |
| Sequence parallel | 4 (Ulysses) |
| Param/optimizer offload | True (CPU) |
| GPU memory utilization | 0.3 |
| Tool format | Hermes |
| Hardware | 4x RTX 4090 (24GB) |
| Enhancement | Purpose |
|---|---|
| Multi-turn tool calling | Enable agentic reasoning (up to 16 turns) |
| TCR (Tool Call Reward) | Reward tool usage even on wrong answers to prevent exploration collapse |
| Asymmetric clipping | Promote exploration by allowing larger probability increases |
| Overlong penalty | Suppress verbose responses, encourage efficient tool use |
| KL removal + token-mean | Allow free exploration without reference model constraint |
| Benchmark | Accuracy | Score | Reward |
|---|---|---|---|
| deepscaler | 1.0 | 1.0 | 1.0 |
| taco_code | 0.0 | 0.5 | 0.5 |
| numina_math | 0.0 | -1.1 | -1.1 |
| Source | Original Dataset | License | Domain |
|---|---|---|---|
| deepscaler | agentica-org/DeepScaleR-Preview-Dataset | MIT | Math (reasoning) |
| omni_math | KbsdJames/Omni-MATH | Apache-2.0 | Math (olympiad) |
| numina_math | AI-MO/NuminaMath-1.5 | Apache-2.0 | Math (general) |
| taco_code | BAAI/TACO | Apache-2.0 | Coding (algorithm) |
| leetcode_code | newfacade/LeetCodeDataset | Apache-2.0 | Coding (LeetCode) |
All training data is sourced from Apache-2.0 / MIT licensed open datasets. This repository does NOT redistribute the dataset.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "y-ohtani/GRPO-TCR-Qwen3-4B-test"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13messages = [
14 {"role": "user", "content": "Find all prime numbers p such that p^2 + 2 is also prime."}
15]
16text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
17inputs = tokenizer(text, return_tensors="pt").to(model.device)
18outputs = model.generate(**inputs, max_new_tokens=4096)
19print(tokenizer.decode(outputs[0], skip_special_tokens=True))| Component | Source | License |
|---|---|---|
| Base model | Qwen/Qwen3-4B-Instruct-2507 | Apache-2.0 |
| SFT dataset | y-ohtani/open_agentrl_like_sft | Apache-2.0 |
| RL dataset | y-ohtani/open_agentrl_grpo_2k | Apache-2.0 |
| Training framework | Open-AgentRL (verl) | Apache-2.0 |
| Methodology | DemyAgent (arXiv:2507.15997) | — |