REINFORCEMENT LEARNING · INTERVIEW QUESTION
Explain Q-Learning in detail. What is the update rule and why is it 'off-policy'?
🟡 intermediate · Value-Based Methods
Hint: Q-table, temporal difference update, and learning optimal policy regardless of behavior policy.
Answer
Q-Learning is a model-free, off-policy RL algorithm that learns the optimal action-value function Q*(s,a). Update rule: Q(s,a) ← Q(s,a) + α[r + γ·max_a' Q(s',a') - Q(s,a)].
Components: α = learning rate, r = immediate reward, γ = discount factor, max_a' Q(s',a') = best possible future value. Off-policy: the update uses max (optimal action) regardless of what action the agent actually took (behavior policy). This means it learns the optimal policy even while following an exploration strategy like ε-greedy.
Model-free: doesn't need to know transition dynamics . Convergence: guaranteed for tabular Q-learning with sufficient exploration (visit every state-action pair infinitely often) and decreasing learning rate. Limitation: works well for small, discrete state/action spaces but becomes impractical for large/continuous ones due to the curse of dimensionality — this motivated Deep Q-Networks (DQN).
Related questions
- What are the key improvements in Rainbow DQN over vanilla DQN?
- What is a Deep Q-Network (DQN)? What key innovations made it work?
- Explain the Bellman equation. How is it used in Q-learning?
- Explain PPO (Proximal Policy Optimization). Why is it preferred over vanilla policy gradient?
- What is reinforcement learning, and how does it differ from supervised and unsupervised learning?