Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:OpenRLHF OpenRLHF Rejection Sampling

From Leeroopedia


Knowledge Sources
Domains Alignment, Data_Processing
Last Updated 2026-02-07 00:00 GMT

Overview

An iterative alignment technique that generates multiple responses per prompt, selects the highest-reward response, and retrains the model on this filtered data.

Description

Rejection Sampling (also called Best-of-N sampling) generates multiple candidate responses from the policy model for each prompt, scores them with a reward model, and selects the best response. The selected (prompt, best_response) pairs form a curated SFT dataset used to retrain the model. This process can be repeated iteratively, progressively improving the model.

Usage

Use as an alternative to PPO when simplicity is preferred. The workflow cycles: generate N responses per prompt, score all, keep the best, retrain with SFT. Requires a trained reward model.

Theoretical Basis

For each prompt x:

  1. Generate N responses: y1,...,yNπθ(|x)
  2. Score each: ri=R(x,yi)
  3. Select best: y*=argmaxiri
  4. Retrain: minimize logπθ(y*|x)

This implicitly optimizes: 𝔼x[maxy{y1,...,yN}R(x,y)]

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment