liveBook · Manning

REINFORCE

As explained in Reinforcement Learning from Human Feedback

REINFORCE is a policy-gradient reinforcement-learning algorithm that updates a policy using sampled returns or rewards.

REINFORCE is a vanilla policy-gradient algorithm that directly improves a parameterized policy from sampled trajectories. In RLHF, the policy generates completions, receives reward-model scores, and updates toward higher-reward behavior without storing scores in a replay buffer. section 6.1 section 6.6

For an action a_t in state s_t, the update weights the log-policy gradient by the return advantage: ∇θ log πθ(a_t | s_t)(G_t − b(s_t)). Here G_t is a Monte Carlo return and b(s_t) is a baseline estimating what is typical from the state. The baseline reduces variance without changing the basic policy-gradient direction. section 6.2.3 section 6.2.11

The implementation is defined by three operational components:

  • Use a positive learning rate to set the update magnitude. section 6.2.3
  • Subtract a baseline or other normalizing factor from the reward to improve stability. section 6.2.3 section 6.6
  • Assign the scalar reward to the parameters that produced each action through the log-policy gradient. section 6.2.3
  • Use recently generated, on-policy samples; unlike PPO, REINFORCE has no importance-sampling ratio or learned value function. section 6.2.11

Language-model update

A language model generates a completion, combines its reward-model score with a KL penalty from a reference model to form shaped reward, and applies the REINFORCE gradient to the sampled token decisions. section 6.2.3

Equation 6.24
\[\label{eq:REINFORCE_with_advantage} \nabla_{\theta}J(\theta) \;=\; \mathbb{E}_{\tau \sim \pi_{\theta}}\!\Big[ \sum_{t=0}^{T} \nabla_{\theta} \log \pi_{\theta}(a_t \mid s_t)A_t \Big].\]

Use the advantage-form equation to inspect how sampled actions, log-policy gradients, and advantage estimates combine into the expected policy update. section 6.2.3

How Reinforcement Learning from Human Feedback covers it

How deep it goes
Derives the Monte Carlo advantage update and implementation components, but stops short of learned value estimation and importance-ratio control.
Examples
Uses sampled language-model completions, reward-model scores, shaped rewards, and formal advantage-gradient equations.
What it assumes
Assumes parameterized policies, trajectories, rewards, log-policy gradients, and advantage estimates while defining the REINFORCE update explicitly.
What you can do after
Apply sampled returns and baselines to update a policy toward higher-reward outputs without a learned value function.
How it connects
Contrasts with PPO, GRPO, and RLOO while using policy gradients, reward models, baselines, advantages, and KL penalties.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Reinforcement Learning from Human Feedback. The section links point to the parts of the book it draws on.