Skip to main content

PPO Training

Train language models using Proximal Policy Optimization (PPO) for reinforcement learning from human feedback (RLHF).

Overview

PPO training is a 2-step process:
  1. Train a Reward Model - Train a model to score responses (see Reward Modeling)
  2. Run PPO Training - Use the reward model to guide policy optimization

Quick Start

Python API

Requirements

PPO training requires either --rl-reward-model-path (path to a trained reward model) or --model-ref (reference model for KL divergence). At least one must be specified.

Parameters

Core PPO Parameters

Training Parameters

Generation Parameters

Advanced Parameters

Data Format

PPO training uses prompts only (the model generates responses):

RL Environment Types

Three environment types are available:

Multi-Objective Rewards

Enable multiple reward signals:

Example: Full RLHF Pipeline

Step 1: Train Reward Model

Step 2: Run PPO Training

Best Practices

  1. Start with a good base model - Fine-tune with SFT before PPO
  2. Use a well-trained reward model - Quality of rewards determines PPO success
  3. Monitor KL divergence - Too high means model is diverging too much from original
  4. Start with default hyperparameters - Adjust based on training dynamics
  5. Use small learning rates - PPO is sensitive to learning rate (1e-5 to 5e-6)

Next Steps

Reward Modeling

Train reward models

DPO Training

Simpler alternative to PPO

GRPO Training

RL with custom environments

RL Module

Low-level RL building blocks