Training frontier foundation models does not end with autoregressive pre-training. Aligning models to follow instructions safely and avoid generating toxic or harmful content requires Reinforcement Learning from Human Feedback (RLHF).

Unlike standard distributed pre-training (which streams text batches through a single model replica), distributed RLHF is an unprecedented distributed systems challenge: it requires coordinating four separate deep neural network models simultaneously across GPU clusters:

  1. The Actor (Policy) Model: Generates rollouts and updates weights via gradient descent.
  2. The Reference Model: Frozen base model enforcing KL-divergence safety boundaries.
  3. The Reward Model: Evaluates rollout responses and outputs scalar reward scores.
  4. The Critic (Value) Model: Estimates expected returns for Generalized Advantage Estimation (GAE).

This module deconstructs the distributed infrastructure powering RLHF:

  • Four-Model GPU Topology: Colocating vs. disaggregating inference rollouts and training backpropagation.
  • PPO vs. DPO: Why Direct Preference Optimization eliminates the Critic and Reward models, reducing memory footprints by .
  • Distributed Ray Orchestration: Managing GPU memory migrations, actor placement groups, and streaming tensors between vLLM inference and Megatron/DeepSpeed training engines.

What you will learn

  • Deconstruct the distributed RLHF runtime topology: simultaneous orchestration of Actor, Critic, Reward, and Reference models
  • Analyze Proximal Policy Optimization (PPO) generalized advantage estimation (GAE) and KL-divergence penalties
  • Evaluate Direct Preference Optimization (DPO) vs. PPO regarding GPU memory footprints and training stability
  • Architect dynamic GPU resource re-allocation and Ray distributed actor placement across heterogeneous clusters
STAGE TOPICS

Topics in this chapter