AI Glossary / Reinforcement learning and robotics / Intermediate

Reward

Definition

A reward is the numerical feedback signal that defines what a reinforcement learning agent is encouraged to achieve. The environment supplies it as the agent acts and experiences outcomes. A reward can be positive, zero, or negative. The learning objective usually concerns expected cumulative reward, so the best action need not be the one with the largest immediate reward.

What it means

Rewards translate a task objective into a form the learning algorithm can use. In a simulation, this might mean points for completing a delivery and specified costs for time or energy. The numbers describe the designer's chosen objective; they are not an independent measure of overall usefulness.
Reward differs from return and value. Return combines rewards over a sequence, possibly discounting later ones. A value function estimates expected return under a policy or other specified continuation. Confusing these quantities can make a learner's decisions appear inconsistent when it is actually considering future effects.

How it works

A task defines when rewards arrive and how they are calculated. Depending on the formulation, reward may depend on the current state, action, next state, or other information included in the environment's state. It may be deterministic or stochastic.
The agent observes rewards and uses them in its learning rule. A reward can contribute directly to a sampled return or combine with estimated future value in a temporal-difference target. These learning signals need not have the same sign as the immediate reward.
Designers must specify units, tradeoffs, and timing. Combining a completion bonus with energy and delay penalties implicitly determines how much the objective values one outcome relative to another. If that tradeoff is unsuitable, maximizing the score can produce unsuitable behavior.
Sparse rewards arrive only occasionally, such as at task completion. Dense rewards provide more frequent feedback, but extra intermediate rewards can change the objective. Reward shaping requires deliberate design rather than simply awarding points for every apparently helpful activity.
Constraints and rewards also serve different roles. A finite penalty makes an outcome less attractive; it does not automatically make that outcome impossible. When an action must be disallowed, the system needs an appropriate constraint or control mechanism in addition to the scoring design.

Three practical examples

  • Game environments: supply points or terminal win-loss feedback to define the learning objective.
  • Simulated delivery: combine completed-service rewards with explicitly stated operating costs.
  • Resource management research: evaluate decisions using a declared balance of completed work, delay, and resource consumption.

Think of it this way

Think of reward as the scoring rules for an exercise. A participant learns to score well under those rules. If the rules award points for activity that does not accomplish the intended task, a high score may be a faithful response to the rules and still disappoint the person who designed them.

Worked example

Consider a fictional delivery task with two routes. Route A completes one delivery, uses 3 energy units, and takes 4 minutes. Route B completes one delivery, uses 1 energy unit, and takes 7 minutes. Both routes succeed deterministically and have no other effects.
Define the episode reward as 20 points per completed delivery, minus 2 points per energy unit, minus 1 point per minute. Route A receives 20 - 2 times 3 - 4 = 10 points. Route B receives 20 - 2 times 1 - 7 = 11 points. Under this objective, the slower route is preferred because its energy saving outweighs its additional time.
Now change the time penalty to 3 points per minute while keeping the other terms unchanged. Route A scores 20 - 6 - 12 = 2. Route B scores 20 - 2 - 21 = -3. The ranking reverses. The environment did not become more or less efficient; the stated tradeoff changed.
Suppose rewards are instead issued over two steps as -3 followed by 12, with discount factor 0.80. The discounted return is -3 + 0.80 times 12 = 6.6, while the undiscounted sum is 9. Neither quantity is simply the first reward of -3. The timing and discount convention must be specified before comparing scores.
Finally, suppose a prohibited shortcut yields 50 completion points and incurs a penalty of 30. Its net score is still 20, greater than either original route. The numerical penalty alone would not enforce prohibition in this toy task. This calculation illustrates the distinction between discouraging an outcome and making it infeasible; it does not recommend such a shortcut.

Illustrative case study

Fictional case: HazelDispatch trains a simulator agent using points for packages picked up. The agent repeatedly collects packages but leaves some undelivered because pickup activity is rewarded more directly than completed service. Reviewers compare the score with delivery records and find that the intended outcome was poorly represented.
They redefine the completion criterion and evaluate the revised policy on held-out scenarios. The example is invented and demonstrates a reward-specification issue, not a measured commercial outcome or a guarantee that changing one score term resolves every failure.

Common misconceptions and mistakes

Common mistakes include calling reward the same thing as profit, interpreting a negative reward as a failure regardless of future outcomes, and assuming more detailed reward formulas always improve learning. Arbitrary scaling can also affect numerical optimization or the balance with other objective terms. When episode lengths vary, adding the same constant at every step can change preferences by favoring longer or shorter episodes.

Business use

Businesses should review reward design as an explicit statement of tradeoffs. Useful documentation explains what is measured, when it is measured, how competing outcomes are weighted, and which requirements are handled separately. Evaluate real task outcomes alongside the training score so an apparently successful optimizer does not conceal a mismatch between the metric and the business objective.

People also ask

Can reward be negative?

Yes; negative numbers commonly represent costs or unfavorable outcomes.

Is reward always immediate cash value?

No. It is a task-defined numerical signal.

Does the highest immediate reward identify the best action?

Not when later consequences change the expected cumulative result.

Check your understanding

Why does Route B win under the first formula?

Answer: Its energy saving is worth more than its extra time cost.

What reverses the ranking?

Answer: Increasing the time penalty from 1 to 3 points per minute.

What is the discounted return from -3 then 12 at discount 0.80?

Answer: 6.6.

Related terms

  • Return
  • Reinforcement learning
  • Reward shaping
  • Discount factor
  • Temporal-difference error
  • Objective function
  • value function
  • reward hacking
  • sparse reward
  • constraints

Learn next

Next, write a reward formula for a small simulated task and vary each weight. Inspect which behaviors become attractive, then compare those behaviors with the outcomes the task was intended to achieve.

More in Reinforcement learning and robotics

  • Replacing eligibility trace - A replacing eligibility trace is a short-term credit-assignment record that is reset to a fixed active value, usually one, whenever its state or feature is...
  • Residual-gradient reinforcement learning - Residual-gradient reinforcement learning updates a value approximator by differentiating a squared Bellman-style residual through both the current...
  • Retrace(lambda) - Retrace(lambda) is a multi-step off-policy reinforcement-learning method that combines target-policy temporal-difference errors using truncated...
  • Reward hypothesis - The reward hypothesis is the proposal that goals and purposes can be represented through maximizing the expected cumulative value of a scalar reward signal.
  • Reward-to-go - Reward-to-go is the cumulative reward remaining from a particular decision onward in a trajectory.
  • Robot as a service - Robot as a service, often abbreviated RaaS and also called robots or robotics as a service, commonly describes obtaining robotic capability through a...

Sources

Richard S. Sutton and Andrew G. Barto, Reinforcement Learning: An Introduction, second edition, Sections 3.2 and 3.3: https://www.andrew.cmu.edu/course/10-703/textbook/BartoSutton.pdf Google for Developers, Machine Learning Glossary, reward: https://developers.google.com/machine-learning/glossary#reward

Previous: Reversible-jump Markov chain Monte Carlo Next: Reward hypothesis

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer