1
$\begingroup$

Why do we learn the action-value function $Q(s,a)$ rather than the (just state) value function $V(s)$? At least for deterministic environments?

$V$ is much smaller than $Q$, and they are trivially related—just scan over all possible actions and simulate to the next states to arrive at the $Q$ (which is what the Q learning algo must do anyway). I.e. $Q(s,a)=V(s')$ where $s'$ is the next state from $s$ after doing $a$.

So why not just learn the $V$s? Is the main reason because of stochastic environments?

Related: What is the Q function and what is the V function in reinforcement learning?

$\endgroup$

1 Answer 1

1
$\begingroup$

$V(s)$ is a total function, with a value defined for any thoroughly explored state $s$. It abstracts away the details of exploring the state space.

$Q(s, a)$ is a partial function, which reveals our current ignorance. When the MDP encounters state $s$, it is free to explore or exploit. Early on we may be better off systematically exploring the action space from that state. As we learn a greater portion of $Q$, we might favor "exploit", in order to navigate to some promising $s'$ state.

While not inherent in the theoretic problem formulation, it is often the case that real world problems are drawn from smoothly differentiable spaces and exhibit a cluster of adjacent "dead end" states. Given a limited exploration budget, telling the MDP to avoid states known to have low values for some actions may well be prudent, despite the possibility of a large reward for exploring some novel action from a given state.


Consider a blind robot tailor that must thread a needle. It has a thread gripper mounted on a linear actuator with a range of one meter, similar to what you might find in a 3D printer. A stationary needle is present somewhere, perhaps connected to a loom. We get unit reward for threading the needle.

Action space: move gripper a distance X to the left, then 1 cm up which will hopefully thread the needle. We treat those movements as a single atomic action.

After a while an external agent evaluates whether the attempt succeeded.

The state space is very small, as there is exactly one initial condition, with gripper starting at origin, from which an experienced tailor will always achieve unit reward.

Rather than continuous, we might choose to view the $Q$ space as discretized to millimeter increments of the X motion. Looking at $Q$ gives us a burn-down list of actions we should explore. Looking at $V$'s constant unit reward doesn't really assist with the learning goal.

Some real world situations are not smoothly differentiable, such as this one. Sometimes we find that much of the space is smooth, yet we must locate one or a sequence of nonlinear regions to obtain a reward. This is where we can draw the strongest contrast between $V$ and $Q$, when the state space has not yet been fully explored.

$\endgroup$
5
  • $\begingroup$ Why is v total while q partial? In q learning, for example, these are both just tables of values that we iteratively update, so I think I'm not seeing the profound distinction. As for telling the mdp to avoid states known to have low values for some actions, that is inherent in the tentative v(s') value being low, and doesn't require q. Perhaps this would be most productive: are you able to convey your point using a simple example with respect to, say, grid world? $\endgroup$
    – xyzzyrz
    Commented Mar 22 at 18:30
  • $\begingroup$ It is total because there's different assumptions: "... with a value defined for any thoroughly explored state" In contrast 𝑄 is of interest while we're still exploring, and it makes explicit our very partial knowledge (so far) of the world. I confess there may be better terms for this situation than {"partial", "total"}, and would be happy to accept proposals. $\endgroup$
    – J_H
    Commented Mar 22 at 19:17
  • $\begingroup$ Thanks for the example. However the state space here is not just the initial condition, right? Let's say there are 10 distinct millimeters that you can move left before attempting to thread. This means there are up to 11 next (terminal) states. So in this world, you can simply evaluate the reward from each of those states instead of each action emerging from the initial state. $\endgroup$
    – xyzzyrz
    Commented Mar 24 at 20:03
  • $\begingroup$ You reduced the 1m range (thousand positions) to 1cm (ten positions); that's cool. I had contemplated a "single move universe" for simplicity, where failing to thread is a fatal error, similar to a single life Pitfall Harry falling down a hole. Maybe I should have added that the atomic action is {move left X, move up 1cm, gripper releases thread, return to origin by moving right X}. Now it's starting to resemble a carnival game or a single-bullet FPS. We agree that Q and V each have their uses. $\endgroup$
    – J_H
    Commented Mar 24 at 20:14
  • $\begingroup$ I think I see the problem. In RL, the environment rewards based on actions (conditioned on state), and not simply arriving in a state. So my initial assumption that Q(s,a)=V(s') is incorrect. In other words, two different states that transition to the same next state can have different rewards, despite arriving at the same next state. Thank you. $\endgroup$
    – xyzzyrz
    Commented Mar 25 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.