An Easy-to-use, Scalable and High-performance Agentic RL Framework based on Ray (PPO & DAPO & REINFORCE++ & VLM & TIS & vLLM & Ray & Async RL)
An Easy-to-use, Scalable and High-performance Agentic RL Framework based on Ray (PPO & DAPO & REINFORCE++ & VLM & TIS & vLLM & Ray & Async RL)
OpenRLHF is the first high-performance, production-ready open-source RLHF framework that combines Ray + vLLM distributed architecture with a unified agent-based design paradigm for scalable and extensible reinforcement learning from human feedback.
Learn More: Documentation | Slides | Technical Report | Video
New Backend: Molt brings an Automodel-powered backend to OpenRLHF that's more powerful than DeepSpeed — scaling RL training to hundreds of billions of parameters while keeping the same familiar, elegant OpenRLHF workflow.
--algo.advantage.estimator flash_reinforce, a binary-KL trust region on the vLLM logprobs, sample-mean aggregation). Training script: train_flash_reinforce_ray_agent_async.sh--train.async_enable and async agent RLHF via --train.agent_func_path. See train_reinforce_baseline_ray_agent_async.sh for a runnable example.OpenRLHF is the first RLHF framework built on Ray + vLLM distributed architecture, orchestrating multiple components across GPUs efficiently:
Ray - Distributed Scheduler and Controller
OpenRLHF leverages Ray for efficient distributed scheduling. It separates the Actor, Reward, Reference, and Critic models across different GPUs, enabling scalable training for models up to 70B+ parameters.
Hybrid Engine Scheduling: All models and vLLM engines can share GPU resources—minimizing idle time and maximizing GPU utilization. This allows running full RLHF pipelines on limited hardware.
vLLM - High-Performance Inference Engine
RLHF training spends 80% of the time on sample generation. Powered by vLLM with Auto Tensor Parallelism (AutoTP) and Pipeline Parallelism (PP), OpenRLHF delivers high-throughput, memory-efficient generation.
DeepSpeed - Memory-Efficient Training
Built on DeepSpeed ZeRO-3, deepcompile, AutoTP, and RingAttention. Enables large model training without heavyweight frameworks while working directly with HuggingFace models.
Transformers - Model Interface
Native integration with HuggingFace Transformers for seamless model loading, state management, and fine-tuning of pretrained models.
NCCL / CUDA IPC - High-Speed Communication
Efficient inter-GPU communication for distributed training and inference.
On top of the Ray distributed architecture, OpenRLHF is the first RLHF framework to implement a unified agent-based paradigm. Every training run—whether standard PPO or complex multi-turn reasoning—follows a consistent agent execution pipeline.
OpenRLHF unifies generation and training through token-in-token-out agent execution, ensuring perfect consistency, easy single/multi-turn extension, and zero text-level mismatches.
…| Principle | Description | Benefit |
|---|---|---|
| Token-in-Token-out | All sampling produces token-level trajectories | Zero text-level mismatch |
| Unified Interface | Same AgentExecutorBase API for all modes |
Switch modes with one flag |
| Algorithm-Agnostic | RL algorithms (PPO, REINFORCE++, etc.) are decoupled from agent executors | Any algorithm works with any mode |
| Extensible | Plug in custom rewards/environments easily | Rapid experimentation |
| Production-Ready | Sync/Async/Hybrid Engine support | From research to deployment |
The agent execution mode is independent of the RL algorithm you choose. You can use any algorithm (PPO, REINFORCE++, GRPO, etc.) with any execution mode:
| Mode | Use Cases | Interface | Complexity |
|---|---|---|---|
| Single-Turn | Standard RLHF, custom reward functions | Optional reward_func() |
⭐ Default (99% use cases) |
| Multi-Turn | Multi-step reasoning, interactive environments | reset() + step() |
⭐⭐ Advanced |
OpenRLHF implements PPO, REINFORCE++, REINFORCE++-baseline, GRPO, RLOO with advanced optimization tricks inspired by practical guides and community best practices.
Key Design: RL algorithms are decoupled from agent execution modes. All algorithms work seamlessly with both single-turn and multi-turn agent executors, running through the unified token-in-token-out pipeline for consistent behavior.
Show algorithm comparison table| Algorithm | --algo.advantage.estimator |
Key Feature | Best Use Case |
|---|---|---|---|
| PPO | (default) | Full critic network | Stable training, proven results |
| REINFORCE++ | reinforce |
PPO tricks without critic | Efficient training, less memory |
| REINFORCE++-baseline | reinforce_baseline |
Mean reward baseline | Reasoning tasks (RLVR), robust to reward scales |
| RLOO | rloo |
Per-token KL + PPO-clip | Multi-sample training |
| GRPO | group_norm |
Group normalization | Batch-based training |
| Dr. GRPO | dr_grpo |
Simplified GRPO | Removes local /std norm |
| FlashREINFORCE | flash_reinforce |
Critic-free single-rollout RL: batch-mean baseline, binary-KL trust region on the vLLM logprobs | Async agentic RL with one rollout per prompt (script) |
References: Zhihu article | Notion best practices
OpenRLHF provides a complete RLHF pipeline with agent-based flexibility:
Single-Turn Mode (Default - 99% of use cases)
--reward.remote_url)EvalPort: portable interchange for compute_eval_metrics results
Support for Ascend NPU
math_utils.grade_answer ignores units when both reference and prediction carry one, so the right number with the wrong unit (or wrong rate) is graded correct
[Roadmap] OpenRLHF on Intel XPU
[Bug] seq-mask-tis skips token-level truncation and can produce non-finite PPO updates
Suboptimal forward dispatch order in make_experience causes unnecessary serialization
LoRA + colocated vLLM: policy→vLLM weight sync fails end-to-end (dtype, then unmapped adapter names)
reward model HTTP service has no authentication, defaults to binding all interfaces, and the training client consumes whatever the endpoint returns
[Bug] Async oversampling checkpoints drop buffered rollouts on resume
[Bug] RewardDataset silently keeps preference pairs that become identical after truncation