Value Functions and Q Functions
- 37Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the definition of a value function Vπ(s) in reinforcement learning?
The expected sum of future discounted rewards starting from state s and following policy π: Vπ(s)=E[∑t=0∞γtrt∣s0=s,π].
Or swipe the card
37 cards
What is the definition of a value function Vπ(s) in reinforcement learning?
The expected sum of future discounted rewards starting from state s and following policy π: Vπ(s)=E[∑t=0∞γtrt∣s0=s,π].
What is the definition of a Q-function Qπ(s,a)?
The expected sum of future discounted rewards after taking action a in state s and then following policy π: Qπ(s,a)=E[∑t=0∞γtrt∣s0=s,a0=a,π].
In policy gradient methods, how is the policy updated?
By increasing the log-likelihood of actions that lead to higher rewards, often using a baseline to reduce variance: ∇logπ(a∣s)⋅(R−b), where R is the return and b is a baseline.
What is the role of a baseline in policy gradient?
To reduce the variance of the gradient estimate without introducing bias, typically an estimate of the value function.
How does actor-critic combine policy gradient and value function learning?
The actor updates the policy using a gradient that incorporates a Q-function (the critic), which reduces variance compared to REINFORCE.
In value-based RL, how can you derive a policy from a Q-function?
Define a deterministic policy π′(s)=argmaxaQπ(s,a) that picks the action with the highest Q value.
Is the greedy policy derived from Qπ always optimal? Why or why not?
Not necessarily. In the navigation example, the greedy policy only improved in regions where Qπ was non-zero; from starting states, it still followed the original, suboptimal policy.
What does the policy improvement theorem state?
The greedy policy with respect to Qπ is at least as good as π, i.e., Vπ′(s)≥Vπ(s) for all states.
What are the two steps of policy iteration?
Policy evaluation (estimate Qπ) and policy improvement (set π′ to greedy policy w.r.t. Qπ).
How is policy evaluation performed in Q-learning?
By fitting a Q-function using the Bellman equation as a target: Q(s,a)≈r+γEs′[maxa′Q(s′,a′)].
Write the Bellman equation for the Q-function of a policy π.
Qπ(s,a)=r(s,a)+γEs′∼p,a′∼π[Qπ(s′,a′)].
Write the Bellman optimality equation for the optimal Q-function Q∗.
Q∗(s,a)=r(s,a)+γEs′∼p[maxa′Q∗(s′,a′)].
What does the Bellman optimality equation represent?
A condition that uniquely characterizes the optimal Q-function; if Q satisfies it, then the policy π(s)=argmaxaQ(s,a) is optimal.
What is the Q-learning update rule in tabular form?
Q(s,a)←Q(s,a)+α[r+γmaxa′Q(s′,a′)−Q(s,a)].
Is Q-learning an on-policy or off-policy algorithm? Why?
Off-policy, because the update uses the max over actions, which may not correspond to the policy that generated the data.
Under what conditions does tabular Q-learning converge to the optimal Q-function?
If all state-action pairs are visited infinitely often (sufficient exploration) and the learning rate decays appropriately.
Does Q-learning with function approximation always converge? Why or why not?
No, it can diverge, especially with neural networks, because the moving target and max operation create a non-stationary optimization.
What is ϵ-greedy exploration in Q-learning?
With probability ϵ, take a random action; otherwise take the greedy action argmaxaQ(s,a).
What is Boltzmann (softmax) exploration?
Sample actions with probability proportional to exp(Q(s,a)/τ), where τ is a temperature parameter.
Why is exploration important in Q-learning?
To ensure that all actions are sampled enough for the max operation to be accurate; otherwise, overestimation can occur due to noisy Q estimates for unsampled actions.
What is the purpose of a replay buffer in DQN?
To store past transitions (s,a,r,s′) and sample i.i.d. batches during training, reducing correlation between consecutive updates.
What is the purpose of a target network in DQN?
To provide fixed targets for Q-learning updates, making the learning problem stationary and more stable.
How often is the target network updated in DQN?
Periodically, e.g., every C gradient steps (commonly every 100 or 1000 steps).
What is the loss function used in DQN?
Mean squared error: L=E[(r+γmaxa′Qtarget(s′,a′)−Qcurrent(s,a))2].
Why might the Q-learning loss increase during training, even when the policy is improving?
Because Q values scale up as the agent accumulates higher returns, so the magnitude of the loss increases naturally.
What causes overestimation in Q-learning?
The max operation over noisy Q values tends to select actions with inflated estimates, leading to systematic overestimation.
How does double DQN reduce overestimation?
By using the current Q network to select the action and the target network to evaluate it, decorrelating the noise: amax=argmaxaQcurrent(s′,a), then target =r+γQtarget(s′,amax).
In double DQN, which Q network is used to select the action and which is used to evaluate it?
The current (online) network selects the action; the target network evaluates it.
What is the n-step return target for Q-learning?
target=∑i=0n−1γirt+i+γnmaxaQ(st+n,a).
What is a potential issue with using n-step returns in Q-learning when the data is off-policy?
The rewards in the n-step return come from the behavior policy, not the optimal policy, introducing bias.
How is the off-policy issue of n-step returns commonly handled in practice?
Often ignored; alternatives include dynamic n or using only data where actions match the greedy policy.
When is PPO a good choice for reinforcement learning?
When stability and ease of use are priorities and data efficiency is not critical.
When is DQN a suitable algorithm?
For problems with discrete action spaces; it is data-efficient and works well with low-dimensional action spaces.
When is Soft Actor-Critic (SAC) preferred?
When data efficiency is most important, especially for continuous action spaces, though it requires more tuning.
How can Q-learning be applied to continuous action spaces?
By optimizing over actions using methods like sampling, gradient ascent, or cross-entropy method to find maxaQ(s,a).
What was a landmark achievement of DQN in 2013?
Achieving human-level performance on many Atari games using only pixel inputs.
Give an example of Q-learning applied to robotics.
Robot grasping, where a DQN-based system achieved 96% success rate in grasping objects.

Ask anything
We've read this whole study set, so questions about it get the best answers.