Answers.Body: <blockquote>
    <p>Why do both approaches prevent the AI agent from changing its reward function at will? </p>
  </blockquote>
  
  <p>In RL for optimal control, the reward function is part of the <em>problem formulation</em>. That is, it describes the goals of the agent. Sometimes this is obviously something that should not be under the agent's control, if the reward is a real-world quantity that it should maximise - e.g. the amount of money it makes in profit - then it makes no sense that the agent could arbitrarily declare that the quantity is different to the thing that it observed.</p>
  
  <p>Other times, there is some flexibility, an agent that needs to escape a maze in a short time could have -1 reward per time step inside the maze or -0.1 reward per time step, or +1 reward for escaping with a discount factor applied. However, the flexibility can only go so far before it describes a different problem. Changing the -1 per time step to +1 per time step means that the agent's goal switches from escaping to staying in the maze. </p>
  
  <p>In general, multiplying all the rewards in a MDP by some <em>positive</em> constant does not change a reinforcement learning problem. Sometimes it may be worth doing this scaling to make it easier for a specific approach, such as neural networks, to work efficiently. However, this is not something to put directly under the agent's control, but a hyperparameter like the number of hidden layers in the neural network. As a hyperparameter, usually the reward scaling is very flexible and not something worth spending much effort tuning - <em>unlike</em> the architecture of a neural network.</p>
  
  <blockquote>
    <p>What happens if we do allow the AI agent to do so?</p>
  </blockquote>
  
  <p>Unless significant constraints are placed on what is allowed to change, then the agent will get any amount of reward it "wants" by doing anything it "wants", within whatever constraints are placed on changes allowed to the reward function. Typically in RL this would result in an agent that acts more or less randomly whilst getting progressively higher and higher reward on each iteration. Or in other words, an agent that does not attempt to solve any kind of problem.</p>
  
  <p>There are a few special cases where a reward function can be adjusted or learned. One common case is <a href="https://towardsdatascience.com/inverse-reinforcement-learning-6453b7cdc90d" rel="nofollow noreferrer">inverse reinforcement learning</a>, where an agent's activities are observed, it is assumed to be solving an MDP-like problem, and you are interested in understanding how it solves it, including what reward function it is using. The reward function must be learned by fitting it to observations of the agent.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-14T08:49:07.110Z
Answers.LastActivityDate: 2019-12-15T09:43:08.230Z
Answers.LastEditDate: 2019-12-15T09:43:08.230Z
Answers.UserDisplayName: Neil Slater
Answers.Body: <p>both standard RL and ERL maintain a fixed reward structure to ensure stable learning, focus on achieving defined objectives, and prevent the issues associated with reward manipulation. Allowing agents to change their reward functions could lead to unpredictable, misaligned, and potentially harmful behaviors.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-09-30T11:45:20.957Z
Answers.LastActivityDate: 2024-09-30T11:45:20.957Z
Answers.UserDisplayName: Kristina_Poole
Body: <p>In standard Reinforcement Learning the reward function is specified by an AI designer and is external to the AI agent. The agent attempts to find a behaviour that collects higher cumulative discounted reward. In Evolutionary Reinforcement Learning the reward function is specified by
  the agent’s genetic code and evolved in simulated Darwinian evolution over multiple generations.
  Here too the AI agent cannot directly adjust the reward function and instead adjusts its behaviour
  towards collecting higher rewards. Why do both approaches prevent the AI agent from changing its reward function at will? What happens if we do allow the AI agent to do so?</p>
  
Tags: <reinforcement-learning><rewards>
Title: Why cannot an AI agent adjust the reward function directly?
UserDisplayName: rodan
ThreadText: # Why cannot an AI agent adjust the reward function directly?
  
  (Asked by: username_0 on 2019-12-14)
  
  In standard Reinforcement Learning the reward function is specified by an AI designer and is external to the AI agent. The agent attempts to find a behaviour that collects higher cumulative discounted reward. In Evolutionary Reinforcement Learning the reward function is specified by
  the agent’s genetic code and evolved in simulated Darwinian evolution over multiple generations.
  Here too the AI agent cannot directly adjust the reward function and instead adjusts its behaviour
  towards collecting higher rewards. Why do both approaches prevent the AI agent from changing its reward function at will? What happens if we do allow the AI agent to do so?
  
  **Tags:** reinforcement-learning, rewards
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-12-14. Score: 6
  
  > Why do both approaches prevent the AI agent from changing its reward function at will?
  
  In RL for optimal control, the reward function is part of the *problem formulation*. That is, it describes the goals of the agent. Sometimes this is obviously something that should not be under the agent's control, if the reward is a real-world quantity that it should maximise - e.g. the amount of money it makes in profit - then it makes no sense that the agent could arbitrarily declare that the quantity is different to the thing that it observed.
  
  Other times, there is some flexibility, an agent that needs to escape a maze in a short time could have -1 reward per time step inside the maze or -0.1 reward per time step, or +1 reward for escaping with a discount factor applied. However, the flexibility can only go so far before it describes a different problem. Changing the -1 per time step to +1 per time step means that the agent's goal switches from escaping to staying in the maze.
  
  In general, multiplying all the rewards in a MDP by some *positive* constant does not change a reinforcement learning problem. Sometimes it may be worth doing this scaling to make it easier for a specific approach, such as neural networks, to work efficiently. However, this is not something to put directly under the agent's control, but a hyperparameter like the number of hidden layers in the neural network. As a hyperparameter, usually the reward scaling is very flexible and not something worth spending much effort tuning - *unlike* the architecture of a neural network.
  
  > What happens if we do allow the AI agent to do so?
  
  Unless significant constraints are placed on what is allowed to change, then the agent will get any amount of reward it "wants" by doing anything it "wants", within whatever constraints are placed on changes allowed to the reward function. Typically in RL this would result in an agent that acts more or less randomly whilst getting progressively higher and higher reward on each iteration. Or in other words, an agent that does not attempt to solve any kind of problem.
  
  There are a few special cases where a reward function can be adjusted or learned. One common case is [inverse reinforcement learning](https://towardsdatascience.com/inverse-reinforcement-learning-6453b7cdc90d), where an agent's activities are observed, it is assumed to be solving an MDP-like problem, and you are interested in understanding how it solves it, including what reward function it is using. The reward function must be learned by fitting it to observations of the agent.
  
  
  ---
  
  ### Answer by username_2 on 2024-09-30. Score: 0
  
  both standard RL and ERL maintain a fixed reward structure to ensure stable learning, focus on achieving defined objectives, and prevent the issues associated with reward manipulation. Allowing agents to change their reward functions could lead to unpredictable, misaligned, and potentially harmful behaviors.
  
  
  ---
  
  