Answers.Body: <p>In reinforcement learning (RL), an immediate reward value must be returned after each action, along with the next state. This value can be zero though, which will have no direct impact on optimality or setting goals.</p>
  <p>Unless you are modifying the reward scheme to try and make an environment easier to learn (called <a href="https://link.springer.com/referenceworkentry/10.1007%2F978-0-387-30164-8_731" rel="nofollow noreferrer">reward shaping</a>), then you should be aiming for a &quot;natural&quot; reward scheme. That means granting reward based directly on the goals of the agent.</p>
  <p>Common reward schemes might include:</p>
  <ul>
  <li><p>+1 for winning a game or reaching a goal state granted only at the end of an episode, whilst all other steps have a reward of zero. You might also see 0 for a draw and -1 for losing a game.</p>
  </li>
  <li><p>-1 per time step, when the goal is to solve a problem in minimum time steps.</p>
  </li>
  <li><p>a reward proportional to the amount of something that the agent produces - e.g. energy, money, chemical product, granted on any stop where this product is obtained, zero otherwise. Potentially a negative reward based on something else that the agent consumes in order to produce the product, e.g. fuel.</p>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-21T10:40:28.477Z
Answers.LastActivityDate: 2020-12-20T16:59:50.490Z
Answers.LastEditDate: 2020-12-20T16:59:50.490Z
Answers.UserDisplayName: Neil Slater
Body: <p>In reinforcement learning, an agent can receive a positive reward for correct actions and a negative reward for wrong actions, but does the agent also receive rewards for every other step/action?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-22T20:51:45.357Z
Comments.Text: This question seems to be very similar to [Can reinforcement learning be used for tasks where only one final reward is received?](https://ai.stackexchange.com/q/12189/2444).
Comments.UserDisplayName: nbro
Tags: <reinforcement-learning><reward-design><reward-functions><reward-shaping><dense-rewards>
Title: Is a reward given at every step or only given when the RL agent fails or succeeds?
UserDisplayName: Dan D.
ThreadText: # Is a reward given at every step or only given when the RL agent fails or succeeds?
  
  (Asked by: username_0 on 2020-07-21)
  
  In reinforcement learning, an agent can receive a positive reward for correct actions and a negative reward for wrong actions, but does the agent also receive rewards for every other step/action?
  
  **Tags:** reinforcement-learning, reward-design, reward-functions, reward-shaping, dense-rewards
  > **Comments:**
  > **username_1**: This question seems to be very similar to [Can reinforcement learning be used for tasks where only one final reward is received?](https://ai.stackexchange.com/q/12189/2444).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-07-21. Score: 3 | Accepted answer
  
  In reinforcement learning (RL), an immediate reward value must be returned after each action, along with the next state. This value can be zero though, which will have no direct impact on optimality or setting goals.
  
  Unless you are modifying the reward scheme to try and make an environment easier to learn (called [reward shaping](https://link.springer.com/referenceworkentry/10.1007%2F978-0-387-30164-8_731)), then you should be aiming for a "natural" reward scheme. That means granting reward based directly on the goals of the agent.
  
  Common reward schemes might include:
  
  * +1 for winning a game or reaching a goal state granted only at the end of an episode, whilst all other steps have a reward of zero. You might also see 0 for a draw and -1 for losing a game.
  * -1 per time step, when the goal is to solve a problem in minimum time steps.
  * a reward proportional to the amount of something that the agent produces - e.g. energy, money, chemical product, granted on any stop where this product is obtained, zero otherwise. Potentially a negative reward based on something else that the agent consumes in order to produce the product, e.g. fuel.
  
  
  ---
  
  