Answers.Body: <blockquote>
    <p>In respect of RL, is model-free and off-policy the same thing, just different terminology? </p>
  </blockquote>
  
  <p>No, they are entirely different terms, with the only thing they have in common is that they are both ways in which an RL agent can vary. An agent is generally either working off-policy or on-policy, and is generally either model-based or model-free. These things can otherwise appear in all four combinations.</p>
  
  <blockquote>
    <p>If not, what are the differences?</p>
  </blockquote>
  
  <h3>Model-based vs model-free</h3>
  
  <p>A model-based learning agent uses knowledge of the environment dynamics in order to make predictions of expected outcomes. A model-free learning agent does not use such knowledge. The model here might be provided explicitly by the developer - that could be code for physics to predict a mechanical system, or it might be the rules of a board game that the agent is allowed to know and query to predict outcomes of actions before taking them. Models can also be learned statistically from experience, although that is harder to make effective.</p>
  
  <h3>On-policy vs off-policy</h3>
  
  <p>An on-policy agent learns statistically about how it is currently acting, and assuming a control problem, then uses that knowledge to change how it should act in future. An off-policy agent can learn statistically from other observed behaviours (including its own past behaviour, or random and exploratory behaviour) and use that knowledge to understand how a different <em>target</em> behaviour would perform.</p>
  
  <p>Off-policy learning is a strict generalisation of on-policy learning and includes on-policy as a special case. However, off-policy learning is also often harder to perform since observations typically contain less relevant data.</p>
  
  <blockquote>
    <p>I've read that the policy can be thought of as 'the brain', or decision making part, of machine learning application, where it stores its learnings and refers to it when a new action is required in the new state.</p>
  </blockquote>
  
  <p>That's basically correct when considering how an agent learns how to behave in an environment.</p>
  
  <p>You are assigning a bit too much to the word policy here. A policy is strictly only the mapping from a state to an action (or probability distribution over actions), and often written <span class="math-container">$\pi(a|s)$</span>, i.e. the probability of taking action <span class="math-container">$a$</span> given the agent is in state <span class="math-container">$s$</span>. The "brain" part might include how the agent learns that policy. That could include storing past experience or some summary of past experience in e.g. a neural network. </p>
  
  <p>However, outside of machine learning context, a really simple function containing and if/then statement would also be a policy, if the input to the function was a state of the environment, and the output was an action or probabilities of taking a range of actions. Behaving completely randomly is also a policy, but outside of very specific environments (e.g. Rock/Paper/Scissors) it is usually not the optimal thing to do.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-01T23:04:05.987Z
Answers.Text: Many thanks for your thorough response. I have a couple of follow-up questions:
  
  In a board game environment, how does a model-free learning agent know what the rule of game are - how does it know it can or cannot perform X action?
  
  On Wikipedia, it shows Q-Learning as off-policy, though you have said "a policy is strictly only the mapping from a state to an action". Q-Learning, however, is that, no? You're creating a matrix (a mapping) of which actions to take in which state. Am I missing something crucial?
  
  Thanks
Answers.UserDisplayName: mason7663
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-02T08:07:02.340Z
Answers.Text: @mason7663: If you want details, you will need to ask a separate question. In short, the available actions are a property of the environment and the agent can be informed of them (perhaps on each turn) without knowing the full model. Q-learning is an off-policy method, and it does more than simply contain a way of generating policies. The other things it does, such as the update rule, are important and they are not "the policy"
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-01T18:41:59.090Z
Answers.LastActivityDate: 2020-02-01T19:36:31.777Z
Answers.LastEditDate: 2020-02-01T19:36:31.777Z
Answers.UserDisplayName: Neil Slater
Body: <p>In respect of RL, is model-free and off-policy the same thing, just different terminology? If not, what are the differences? I've read that the policy can be thought of as 'the brain', or decision making part, of machine learning application, where it stores its learnings and refers to it when a new action is required in the new state.</p>
  
Tags: <reinforcement-learning><comparison><terminology><off-policy-methods><model-free-methods>
Title: Are model-free and off-policy algorithms the same?
UserDisplayName: mason7663
ThreadText: # Are model-free and off-policy algorithms the same?
  
  (Asked by: username_0 on 2020-02-01)
  
  In respect of RL, is model-free and off-policy the same thing, just different terminology? If not, what are the differences? I've read that the policy can be thought of as 'the brain', or decision making part, of machine learning application, where it stores its learnings and refers to it when a new action is required in the new state.
  
  **Tags:** reinforcement-learning, comparison, terminology, off-policy-methods, model-free-methods
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-01. Score: 6 | Accepted answer
  
  > In respect of RL, is model-free and off-policy the same thing, just different terminology?
  
  No, they are entirely different terms, with the only thing they have in common is that they are both ways in which an RL agent can vary. An agent is generally either working off-policy or on-policy, and is generally either model-based or model-free. These things can otherwise appear in all four combinations.
  
  > If not, what are the differences?
  
  ### Model-based vs model-free
  
  A model-based learning agent uses knowledge of the environment dynamics in order to make predictions of expected outcomes. A model-free learning agent does not use such knowledge. The model here might be provided explicitly by the developer - that could be code for physics to predict a mechanical system, or it might be the rules of a board game that the agent is allowed to know and query to predict outcomes of actions before taking them. Models can also be learned statistically from experience, although that is harder to make effective.
  
  ### On-policy vs off-policy
  
  An on-policy agent learns statistically about how it is currently acting, and assuming a control problem, then uses that knowledge to change how it should act in future. An off-policy agent can learn statistically from other observed behaviours (including its own past behaviour, or random and exploratory behaviour) and use that knowledge to understand how a different *target* behaviour would perform.
  
  Off-policy learning is a strict generalisation of on-policy learning and includes on-policy as a special case. However, off-policy learning is also often harder to perform since observations typically contain less relevant data.
  
  > I've read that the policy can be thought of as 'the brain', or decision making part, of machine learning application, where it stores its learnings and refers to it when a new action is required in the new state.
  
  That's basically correct when considering how an agent learns how to behave in an environment.
  
  You are assigning a bit too much to the word policy here. A policy is strictly only the mapping from a state to an action (or probability distribution over actions), and often written $\pi(a|s)$, i.e. the probability of taking action $a$ given the agent is in state $s$. The "brain" part might include how the agent learns that policy. That could include storing past experience or some summary of past experience in e.g. a neural network.
  
  However, outside of machine learning context, a really simple function containing and if/then statement would also be a policy, if the input to the function was a state of the environment, and the output was an action or probabilities of taking a range of actions. Behaving completely randomly is also a policy, but outside of very specific environments (e.g. Rock/Paper/Scissors) it is usually not the optimal thing to do.
  
  > **Comments:**
  > **username_0**: Many thanks for your thorough response. I have a couple of follow-up questions:  In a board game environment, how does a model-free learning agent know what the rule of game are - how does it know it can or cannot perform X action?  On Wikipedia, it shows Q-Learning as off-policy, though you have said "a policy is strictly only the mapping from a state to an action". Q-Learning, however, is that, no? You're creating a matrix (a mapping) of which actions to take in which state. Am I missing something crucial?  Thanks  
  > **username_1**: @username_0: If you want details, you will need to ask a separate question. In short, the available actions are a property of the environment and the agent can be informed of them (perhaps on each turn) without knowing the full model. Q-learning is an off-policy method, and it does more than simply contain a way of generating policies. The other things it does, such as the update rule, are important and they are not "the policy"  
  
  ---
  
  