Answers.Body: <blockquote>
  <p>Q-learning uses the maximizing value at each step,</p>
  </blockquote>
  <p>Mostly true. The <em>target</em> policy that Q-learning learns the action values of is the one with the maximum value. While training, Q-learning will take one action randomly (typically with a high probability of taking the action with maximum value), whilst it makes updates to value estimates assuming it will always take the maximising action next.</p>
  <blockquote>
  <p>which implies that there is a probability distribution and it happens to choose the one with the highest probability.</p>
  </blockquote>
  <p>Not true. This is not implied at all. The action values that Q-learning estimates are not probabilities, but expected sums of future reward. The probability distribution for <em>exploring</em> actions is added outside of the Q table or Q function estimate. There is no implied probability distribution of actions in the target policy. When implementing the target policy, you may decide to break ties randomly, but that is not an important detail.</p>
  <p>It is worth noting that even <em>if</em> you were working with a table of action probabilities, then an agent that always chose the one with the maximum probability would be deterministic. A list of numbers from a table or non-stochastic function (which is how a Q table or Q function is implemented, and also how policy functions are implemented for methods that do process probabilities), even if it represents probabilities, cannot be random in itself. Instead, it must be interpreted by a process that decides how to use them. A process that includes a random number generator can use the numbers to generate a probability distribution that it samples from.</p>
  <p>In Q-learning, the process that updates the Q table estimates does not include a random number generator, so as a consequence it is deterministic. However, the choice of which actions to explore is often random, and it is sometimes the case that the environment includes randomness in state transitions or reward values. So Q-learning taken as a whole is a random process.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-30T16:36:41.887Z
Answers.Text: Based on the last paragraph, is it sufficient to conclude whether or not a policy is stochastic or deterministic depends on how the TD target ( max Q for Q learning) is updated, and not depends on behavior policy?
Answers.UserDisplayName: Aung Khant
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-30T18:00:07.860Z
Answers.Text: @AungKhant You should read and understand any RL method you want to understand in detail, as the functions used vary a lot. As a rule of thumb most RL control methods will converge towards deterministic policies, but many will represent a *current* target policy which is stochastic. Q learning and other off-policy value-based methods have target policies which are not random, but are instead deterministic greedy action choice over the current value estimates.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-30T07:59:37.230Z
Answers.LastActivityDate: 2020-11-30T20:41:44.133Z
Answers.LastEditDate: 2020-11-30T20:41:44.133Z
Answers.UserDisplayName: Neil Slater
Body: <p>Q-learning uses the maximizing value at each step, which implies that there is a probability distribution and it happens to choose the one with the highest probability. There is no direct mapping between a particular state to ONLY a particular action but a bunch of actions with varying probabilities. I don't understand.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-30T20:50:33.763Z
Comments.Text: "which implies that there is a probability distribution", what implies that? Probability distribution over what? What does "maximization" have to do with a probability distribution? Q-learning, to compute the target, chooses the value associated with the action of the highest value (i.e. it computes the target as if you assumed that you will take the greedy action). This post is very confusing. Please, next time, before drawing or making possibly wrong assumptions and conclusions, ask a question about what you don't know. That's better than asking a question that is based on wrong assumptions.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-30T21:01:35.027Z
Comments.Text: @nbro: I think that the OP is honestly confused about what the Q values represent and where probabilities come into it. I am not sure we will get a better description of the issue.
Comments.UserDisplayName: Neil Slater
Tags: <reinforcement-learning><q-learning>
Title: Why is the policy implied by Q-learning deterministic, when it always chooses the action with highest probability?
UserDisplayName: Aung Khant
ThreadText: # Why is the policy implied by Q-learning deterministic, when it always chooses the action with highest probability?
  
  (Asked by: username_0 on 2020-11-29)
  
  Q-learning uses the maximizing value at each step, which implies that there is a probability distribution and it happens to choose the one with the highest probability. There is no direct mapping between a particular state to ONLY a particular action but a bunch of actions with varying probabilities. I don't understand.
  
  **Tags:** reinforcement-learning, q-learning
  > **Comments:**
  > **username_1**: "which implies that there is a probability distribution", what implies that? Probability distribution over what? What does "maximization" have to do with a probability distribution? Q-learning, to compute the target, chooses the value associated with the action of the highest value (i.e. it computes the target as if you assumed that you will take the greedy action). This post is very confusing. Please, next time, before drawing or making possibly wrong assumptions and conclusions, ask a question about what you don't know. That's better than asking a question that is based on wrong assumptions.  
  > **username_2**: @nbro: I think that the OP is honestly confused about what the Q values represent and where probabilities come into it. I am not sure we will get a better description of the issue.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-11-30. Score: 3 | Accepted answer
  
  > Q-learning uses the maximizing value at each step,
  
  Mostly true. The *target* policy that Q-learning learns the action values of is the one with the maximum value. While training, Q-learning will take one action randomly (typically with a high probability of taking the action with maximum value), whilst it makes updates to value estimates assuming it will always take the maximising action next.
  
  > which implies that there is a probability distribution and it happens to choose the one with the highest probability.
  
  Not true. This is not implied at all. The action values that Q-learning estimates are not probabilities, but expected sums of future reward. The probability distribution for *exploring* actions is added outside of the Q table or Q function estimate. There is no implied probability distribution of actions in the target policy. When implementing the target policy, you may decide to break ties randomly, but that is not an important detail.
  
  It is worth noting that even *if* you were working with a table of action probabilities, then an agent that always chose the one with the maximum probability would be deterministic. A list of numbers from a table or non-stochastic function (which is how a Q table or Q function is implemented, and also how policy functions are implemented for methods that do process probabilities), even if it represents probabilities, cannot be random in itself. Instead, it must be interpreted by a process that decides how to use them. A process that includes a random number generator can use the numbers to generate a probability distribution that it samples from.
  
  In Q-learning, the process that updates the Q table estimates does not include a random number generator, so as a consequence it is deterministic. However, the choice of which actions to explore is often random, and it is sometimes the case that the environment includes randomness in state transitions or reward values. So Q-learning taken as a whole is a random process.
  
  > **Comments:**
  > **username_0**: Based on the last paragraph, is it sufficient to conclude whether or not a policy is stochastic or deterministic depends on how the TD target ( max Q for Q learning) is updated, and not depends on behavior policy?  
  > **username_2**: @AungKhant You should read and understand any RL method you want to understand in detail, as the functions used vary a lot. As a rule of thumb most RL control methods will converge towards deterministic policies, but many will represent a *current* target policy which is stochastic. Q learning and other off-policy value-based methods have target policies which are not random, but are instead deterministic greedy action choice over the current value estimates.  
  
  ---
  
  