Reinforcement learning

Reward shaping

Reward shaping adds learning guidance. Poorly designed rewards can teach an agent to optimize a proxy while failing the intended task.

Ask the Reinforcement learning assistant 1 min read · Updated September 9, 2026

Definition

Reward shaping adds learning guidance. Poorly designed rewards can teach an agent to optimize a proxy while failing the intended task.

Intuition

Rewarding long answers may produce verbosity instead of accuracy. A reward must reflect what you actually want to improve.

Worked example

A maze agent rewarded whenever it approaches a goal may exploit repeated movements unless the shaping rule is designed carefully.

The math

Potential-based shaping uses F(s,a,s′)=γΦ(s′)−Φ(s)F(s,a,s^{\prime})=\gamma\Phi(s^{\prime})-\Phi(s), with assumptions and terminal handling needed for policy invariance.

In practice

Evaluate real task outcomes separately from the optimized reward and keep explicit failure examples in the test set.

Go deeper

Sources

More in Reinforcement learning

Assembled from the ReLU.chat curated knowledge base. These explanations are concise on purpose; check the sources for anything important.