---
title: "Policy Gradients (REINFORCE)"
description: "Two buttons, rewards 0 and 2: turn one sampled reward into a policy gradient update, see why one update is noisy, and how a baseline and reward-to-go help."
canonical_url: "https://fanout.sh/ai/lessons/reinforcement-learning-policy-gradients"
md_url: "https://fanout.sh/ai/lessons/reinforcement-learning-policy-gradients.md"
access: "pro-preview"
---

# Policy Gradients (REINFORCE)

Two buttons, rewards 0 and 2: turn one sampled reward into a policy gradient update, see why one update is noisy, and how a baseline and reward-to-go help.

- Access: Fanout Pro (public preview)
- Module: Reinforcement Learning

## A glimpse of Policy Gradients (REINFORCE)

An agent has two buttons. Pressing left ends the attempt with reward 0; pressing right ends it with reward 2. It starts by choosing each button with probability 0.5.

We want to change those probabilities using the reward from a button it actually pressed. This is the simplest setting for a policy gradient: improve the action-selection rule directly.

## Continue learning

Pro unlocks guided learning, complete notes, practical walkthroughs, exercises, and every AI Research lesson.

---
This representation contains public Fanout content only. Protected Pro lessons, account data, billing, checkout, and pricing are not included.

Browse the public content map: https://fanout.sh/sitemap.md
