openclaw-rl-training
openclaw-rl-training — an installable skill for AI agents.
By reason-machines · 1,282 installs
npx skills add reason-machines/trending-skills --skill openclaw-rl-training
Source repository · Upstream listing
OpenClaw RL Training
Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
OpenClaw RL is a fully asynchronous reinforcement learning framework that converts live multi turn conversations into training signals for personalized AI agents. It wraps a self hosted model as an OpenAI compatible API via [OpenClaw](https://openclaw.ai), intercepts conversations, and continuously optimizes the policy in the background without interrupting usage. It also supports scalable RL for terminal, GUI, SWE, and tool call agents.
Architecture Overview
Four independent async loops that never block each other:
1. Agent Serving — OpenClaw compatible API serving rollouts
2. Rollout Collection — Captures multi turn conversations as training trajectories
3. PRM/Judge Evaluation — Scores turns using next state feedback (majority voting optional)
4. Policy Training — GRPO/OPD/Combine training via [slime](https://github.com/THUDM/slime) or [Tinker](https://thinkingmachines.ai/tinker/)
Installation
Project Structure
Three Learning Paradigms
1. Binary RL (GRPO)
A Process Reward Model scores each turn from next state feedback. Uses GRPO advantage estimation with PPO style clipped surrogate loss.
2. On Policy Distillation (OPD)
When next state reveals useful hindsight, a judge extracts a textual hint to augment the prompt, creating an enhanced teacher. Token level log probability gap becomes a directional advantage signal.
3. Combination Method (Recommended)
Merges Binary RL scalar supervision with OPD token level directional signal. Strongest and most robust optimization.
Quick Start — Personal Agent (Track 1)
Binary RL Launch Script
OPD Launch Script
Combination Method (One Line)
Configuration — Key Environment Variables
LoRA Training
Custom Loss / Rollout Functions (Plugin API)
The slime framework exposes extension points without modifying core code:
Example Custom Loss (TypeScript style config, Python implementation)
Example Custom Reward Model
Deploying on Tinker (Cloud)
Track 2 — General Agentic RL
Terminal Agent RL
GUI Agent RL
Tool Call Agent RL
SWE Agent RL
Data Format — Conversation Trajectories
OpenClaw RL automatically classifies API messages. Manual format for custom data:
main turns : Multi turn interactions that form training trajectories
side turns : Non trainable system/utility turns excluded from training
OpenClaw API Server Setup
Majority Voting for Robust PRM Scoring
Adding a New Method (Contribution Pattern)
Common Patterns
Monitor Training Progress
Resume from Checkpoint
Evaluate Trained Checkpoints
Troubleshooting
Out of GPU memory during rollout + training:
Async loop falling behind (buffer overflow):
PRM scores all near 0.5 (reward collapse):
Verify next state fields contain meaningful feedback signals
Check judge model prompt template matches expected format
Try increasing majority vote N: majority vote n 7
SGLang server not starting:
Ray job submission fails:
Key References
[Technical Report (arXiv)](https://arxiv.org/abs/2603.10165)
[OpenClaw Plugin](https://openclaw.ai)
[Slime Training Framework](https://github.com/THUDM/slime)
[Tinker Cloud Platform](https://thinkingmachines.ai/tinker/)
[SDFT Paper](https://arxiv.org/abs/2601.19897) — integrated in openclaw opd
[SDPO Paper](https://arxiv.org/abs/2601.20802) — integrated in openclaw opd