openrlhf-training

Train large language models with distributed PPO, GRPO, RLOO, and DPO using Ray and vLLM.

13.0k|930|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill openrlhf-training-orchestra-research
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openrlhf-training
Source: https://github.com/Orchestra-Research/AI-research-SKILLs/tree/main/06-post-training/openrlhf
Command: npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill openrlhf-training-orchestra-research

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openrlhf, ray, vllm, torch, transformers, deepspeed, and includes references (resource) components.

What problem does it solve? RLHF training of large models (7B-70B+) requires coordinating actor, critic, reward, and reference models across GPU clusters while keeping generation fast and memory usage manageable, which is difficult to orchestrate manually. ## Core Features & Use Cases - Distributed RL Algorithms: Run PPO, GRPO, RLOO, REINFORCE++, and DPO training through Ray-based scheduling with ZeRO-3 sharding. - vLLM-Accelerated Rollouts: Speed up sample generation with vLLM inference engines and Hybrid Engine GPU sharing via sleep/wake cycles. - Custom Rewards & Agent RLHF: Plug in custom reward functions for code or math tasks, or run multi-step agent training with environment feedback. - Use Case: Fine-tune a Llama-3-8B model with GRPO on a math dataset using a custom answer-checking reward function across an 8-GPU Ray cluster, without needing a critic model. ## Quick Start Use the openrlhf-training skill to set up a GRPO training run for a Llama-3-8B model on my 8-GPU Ray cluster with vLLM acceleration.

Frequently Asked Questions about openrlhf-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train a model with GRPO using OpenRLHF?▼

Run the train_ppo_ray module with --advantage_estimator group_norm to enable GRPO, which removes the need for a critic model. Add --use_kl_loss and --kl_estimator k3 for the KL loss from the GRPO paper, and optionally --no_advantage_std_norm to disable standard deviation normalization.

What is the difference between PPO, GRPO, and RLOO in OpenRLHF?▼

PPO uses a critic network for maximum stability but consumes more memory, while GRPO and RLOO are critic-free and about 30% lighter on memory. RLOO adds per-token KL rewards and requires multiple samples per prompt, whereas GRPO uses group reward normalization.

OpenRLHF vs TRL vs veRL for RLHF training?▼

OpenRLHF targets distributed multi-node training of 7B-70B+ models with Ray and vLLM acceleration, running about 2x faster than DeepSpeedChat. TRL suits simpler single-node training, while veRL is ByteDance's framework aimed at very large models like 671B.

How many GPUs do I need to train a 70B model with OpenRLHF?▼

A 70B model requires roughly 48 A100 80GB GPUs with the Hybrid Engine enabled, using a vLLM:Actor:Critic ratio of 1:1:1. Without GPU colocation, the same setup needs about 64 dedicated GPUs.

Why does OpenRLHF fail with a DeepSpeed GPU index out of range error?▼

This error occurs because Ray sets CUDA_VISIBLE_DEVICES in a way DeepSpeed does not expect. Fix it by setting the environment variable RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES=1 before launching training.

Can I use a custom reward function instead of a reward model in OpenRLHF?▼

Yes, pass a Python file to --remote_rm_url defining a reward_func that receives queries, prompts, and labels and returns rewards, scores, and extra logs. This supports reinforced fine-tuning for tasks like code execution checking or math answer verification.