Home › Glossary › Reinforcement Learning › Reward Function

Intermediate · Reinforcement Learning

Reward Function

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A scalar signal that tells a reinforcement-learning agent how good its action was.

Technical Definition

A scalar signal that tells a reinforcement-learning agent how good its action was.

How it works

The reward function R(s, a) is the only feedback an RL agent receives — it defines the task. A good reward function is dense enough to guide learning yet not so narrow that the agent finds shortcuts (reward hacking). Designing reward functions is one of the hardest open problems in RL and is closely tied to AI alignment.

Related Concepts

  • Reinforcement Learning — A paradigm where an agent learns to make decisions by receiving rewards or penalties from its environment through trial and error.
  • Reward Shaping — Designing or modifying the reward signal to guide an RL agent toward desired behavior more efficiently.
  • Policy — In reinforcement learning, the strategy an agent follows to choose actions given a state.