REINFORCE Leave-One-Out (RLOO)
March 26, 2026 · View on GitHub
REINFORCE Leave-One-Out (RLOO) is a reinforcement learning algorithm based on the classic REINFORCE policy-gradient method. It constructs an unbiased advantage baseline via the Leave-One-Out (LOO) technique.
Algorithm Overview
For clarity, we explain RLOO by contrasting it with GRPO (Group Relative Policy Optimization).
Both GRPO and RLOO estimate advantages via intra-group comparisons to avoid the high variance of a global baseline. Their core differences are mainly in the following aspects:
Difference 1: How the Advantage Baseline Is Constructed
1. GRPO (Group Relative Policy Optimization)
For each prompt, GRPO generates response samples and normalizes rewards using the group mean and standard deviation:
Where:
- is the reward of the -th sample
- is the group mean
- is the group standard deviation
2. RLOO (REINFORCE Leave-One-Out)
For each prompt, RLOO generates response samples and constructs the baseline via Leave-One-Out, i.e., for the -th sample, the baseline is the mean of the other samples:
This can be equivalently rewritten as:
where is the group mean reward.
Note: We use here to match the notation in the paper. It has the same meaning as in GRPO and corresponds to the configuration parameter
num_generations.
Why Leave-One-Out?
The key advantage is unbiasedness. For the -th sample, its reward is independent of the baseline , hence the advantage estimate is unbiased. In contrast, using the mean including itself as the baseline introduces bias.
Difference 2: How KL Regularization Is Applied
To prevent the policy from drifting too far from the reference policy, both algorithms introduce KL divergence regularization, but in different ways:
GRPO: Adds KL divergence as an independent regularization term to the loss:
RLOO: Integrates KL divergence directly into the reward, constructing a modified reward:
where is the KL coefficient (parameter beta), and is the reference policy (typically an SFT model or the initial policy).
Parameter Configuration
RLOO training can be enabled based on GRPOTrainer by setting the following parameters:
# Basic RLOO configuration
--advantage_estimator rloo # Use RLOO's leave-one-out advantage estimator
--kl_in_reward true # Integrate KL divergence into the reward (default for RLOO)
You can refer to this script for training.
Important Parameters
-
--advantage_estimator: Choose the advantage estimatorgrpo(default): standardize using group mean and standard deviationrloo: construct the baseline via Leave-One-Out
-
--kl_in_reward: Controls where the KL term is appliedfalse: KL as a separate regularization term in the loss (GRPO style)true: subtract KL directly from the reward to form a modified reward (RLOO style)
-
--num_generations: Number of samples per prompt, i.e., -
--beta: KL regularization coefficient- Controls how conservatively the policy updates
Other parameters are consistent with the GRPO arguments.