Reinforcement Learning
Transformers
Safetensors
qwen3
text-generation
ppo
tool-calling
agent
prime-rl
text-generation-inference
Instructions to use Occupying-Mars/qwen3-4b-symbolic-vanilla-ppo-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Occupying-Mars/qwen3-4b-symbolic-vanilla-ppo-v1 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Occupying-Mars/qwen3-4b-symbolic-vanilla-ppo-v1") model = AutoModelForCausalLM.from_pretrained("Occupying-Mars/qwen3-4b-symbolic-vanilla-ppo-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3-4B-Instruct-2507
|
| 4 |
+
tags:
|
| 5 |
+
- reinforcement-learning
|
| 6 |
+
- ppo
|
| 7 |
+
- tool-calling
|
| 8 |
+
- agent
|
| 9 |
+
- prime-rl
|
| 10 |
+
library_name: transformers
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Qwen3-4B — Vanilla PPO on Symbolic Tool-Calling (cmp-vanilla-ppo-4gpu-v1)
|
| 14 |
+
|
| 15 |
+
Qwen/Qwen3-4B-Instruct-2507 trained with **vanilla PPO** (Schulman et al. 2017 —
|
| 16 |
+
clipped surrogate, learned value head, trainer-side GAE) on the deterministic
|
| 17 |
+
symbolic tool-calling benchmark from the GRPO-vs-PPO-under-rollout-compaction
|
| 18 |
+
study (prime-rl fork: ChinmayK0607/blog-rl, branch feat/vanilla-ppo).
|
| 19 |
+
|
| 20 |
+
This is the **uncompacted real-PPO baseline** that study was missing: its
|
| 21 |
+
compacted PPO (rollout-reward critic targets, no GAE) collapsed to
|
| 22 |
+
0.25/0.14 pass@4; this run shows actual PPO nearly matches GRPO.
|
| 23 |
+
|
| 24 |
+
## Results (val = 72 held-out mixed tasks, greedy)
|
| 25 |
+
|
| 26 |
+
| step | 10 | 60 | 80-100 | 140 | 150 |
|
| 27 |
+
|---|---|---|---|---|---|
|
| 28 |
+
| val reward | 0.556 | 0.764 | 0.000 | 0.903 | **0.972** |
|
| 29 |
+
|
| 30 |
+
Reference (same env, Phase-A regime, 8xH100): full GRPO 1.000, compacted
|
| 31 |
+
GRPO 0.986, segment-normalized GRPO 0.986.
|
| 32 |
+
|
| 33 |
+
Notable dynamics: entropy collapse around step 80 made a corrupted tool-call
|
| 34 |
+
token the greedy argmax (val 0 for ~20 steps, 2-turn episodes) — the policy
|
| 35 |
+
**self-recovered** by step 110 and finished at 0.972 with more efficient
|
| 36 |
+
solutions (turns 14.3 -> 11.8). Critic explained variance rose from a cold
|
| 37 |
+
start (0.01 -> 0.07+) — no warm-start needed, unlike the compacted-PPO arm.
|
| 38 |
+
|
| 39 |
+
## Training setup
|
| 40 |
+
|
| 41 |
+
- Algorithm: prime-rl `ppo` — per-token terminal-reward stream, trainer-side
|
| 42 |
+
GAE (gamma=1.0, lambda=0.95), clipped surrogate (eps=0.2), clipped value
|
| 43 |
+
loss (coef 0.5), entropy_coef=0 (a 0.01 arm is a follow-up), LR 1e-6
|
| 44 |
+
- Data: symbolic-curriculum-v2 — 588 train / 72 val pass@4-mixed tasks
|
| 45 |
+
(frozen-model pass@4 sweep over deterministic pools, keep tasks solved
|
| 46 |
+
1-3 of 4 times), depth 3-5, max 24 turns, 32k-token episodes
|
| 47 |
+
- Batch 64 rollouts x group 8, 150 steps, temp 0.7, 4096 completion tokens
|
| 48 |
+
- Hardware: 4x RTX PRO 6000 Blackwell 96GB (2 inference / 2 trainer), ~35 s/step
|
| 49 |
+
- W&B: https://wandb.ai/krishnapg2315/blog-rl/runs/5c4f977de99343c7b44edfe8d05fb5c0
|
| 50 |
+
|
| 51 |
+
## Files
|
| 52 |
+
|
| 53 |
+
- `model.safetensors` — step-150 policy, value head stripped (vLLM-loadable)
|
| 54 |
+
- `value_head.safetensors` — the trained PPO value head (`value_head.weight`,
|
| 55 |
+
[1, hidden]) for critic warm-start experiments
|
| 56 |
+
(`trainer.model.ppo_value_head_init`)
|
| 57 |
+
|
| 58 |
+
## Caveats
|
| 59 |
+
|
| 60 |
+
- Step-150 weights. The greedy policy is functional (0.972 val) but the run
|
| 61 |
+
showed a mid-training degeneracy window — prefer temp>0 sampling or verify
|
| 62 |
+
greedy behavior on your tasks.
|
| 63 |
+
- Tool-call format: Qwen3/hermes (`<tool_call>` JSON blocks).
|