The Teaching Dimension of Q-learning

Xuezhou Zhang, Shubham Kumar Bharti, Yuzhe Ma, Adish Singla, Xiaojin Zhu

Abstract

We study the sample complexity of teaching, termed as "teaching dimension" (TDim) in the literature, for the teaching-by-reinforcement paradigm, where the teacher guides the student through rewards. This is distinct from the teaching-by-demonstration paradigm motivated by robotics applications, where the teacher teaches by providing demonstrations of state/action trajectories. The teaching-by-reinforcement paradigm applies to a wider range of real-world settings where a demonstration is inconvenient, but has not been studied systematically. In this paper, we focus on a specific family of reinforcement learning algorithms, Q-learning, and characterize the TDim under different teachers with varying control power over the environment, and present matching optimal teaching algorithms. Our TDim results provide the minimum number of samples needed for reinforcement learning, and we discuss their connections to standard PAC-style RL sample complexity and teaching-by-demonstration sample complexity results. Our teaching algorithms have the potential to speed up RL agent learning in applications where a helpful teacher is available.

Introduction

In traditional Reinforcement Learning (RL), an agent learns through trial and error, which can be prohibitively slow in complex environments. To accelerate this process, researchers often turn to Teaching-by-Demonstration (TbD), where a teacher provides optimal trajectories. However, TbD is often impractical—for instance, a human cannot easily demonstrate the precise joint movements of a specialized robot.

This paper provides the first formal theoretical analysis of Teaching-by-Reinforcement (TbR), a more natural paradigm where a teacher guides a learner using strategic rewards and punishments. The authors address a fundamental question: what is the Teaching Dimension (TDim)—the minimum number of interactions required for a teacher to move a Q-learning agent from an arbitrary initial state to a specific target policy?

Theoretical Framework and Methodology

The authors formalize the problem by defining the TDim for a system consisting of an MDP environment, a Q-learning student, and an omniscient teacher who knows the student's internal state. They categorize teachers into four levels of "power":

  1. Level 1 (Omnipotent): Can force any state transition and any reward.
  2. Level 2: Can generate any transition but cannot override the agent's chosen action.
  3. Level 3: Can only move the agent to states physically reachable in the MDP.
  4. Level 4 (Constrained): Must obey the MDP's natural transition dynamics and can only manipulate rewards.

To establish lower bounds for these levels, the authors construct a synthetic environment called the "Peacock MDP." This MDP features a long "neck" (a chain of states) and a "tail" (a star of states), designed to demonstrate how exploration noise and MDP diameter can drive teaching complexity to exponential levels.

The Peacock MDP used to establish lower bounds for teaching complexity.

For more constrained teachers (Levels 3 and 4), the authors introduce NavTeach (Navigation-then-Teach). This algorithm strategically builds a navigation policy to move the agent to a target state, teaches the desired action, and ensures subsequent steps do not undo previous progress.

Characterizing the Teaching Dimension

The study reveals that teaching complexity is highly sensitive to the agent's autonomy and environmental constraints. A key insight is the "Free Will" Penalty: moving from Level 1 to Level 2 (where the agent chooses its own actions) increases complexity from $S$ (states) to $S(A-1)$ (actions), as the teacher must systematically demote every sub-optimal action.

Furthermore, exploration—a necessity in standard RL—becomes a hurdle in teaching. If an agent is highly stochastic, it may "fall off" the teacher's path, leading to an exponential blow-up in teaching time relative to the MDP's diameter ($D$).

Summary of Teaching Dimension (TDim) results across four levels of teacher control.

The results establish a clear hierarchy of sample efficiency: TbD > TbR > Standard RL. While demonstrations are most efficient, even the weakest TbR teacher (Level 4) can be significantly faster than standard RL algorithms like UCB-B.

Discussion and Future Work

While this work provides a rigorous foundation for TbR, it assumes an omniscient teacher with unbounded reward capabilities. In real-world settings, teachers must often infer the student's state and work within constrained reward ranges (e.g., $[0, 1]$). Future research is needed to extend these bounds to policy gradient or actor-critic methods and to investigate "weakly controllable" learners where rewards cannot immediately change action rankings. Despite these limitations, the paper demonstrates that strategic reinforcement can dramatically accelerate agent learning in human-in-the-loop systems.

Summary updated

Abstract

We study the sample complexity of teaching, termed as "teaching dimension" (TDim) in the literature, for the teaching-by-reinforcement paradigm, where the teacher guides the student through rewards. This is distinct from the teaching-by-demonstration paradigm motivated by robotics applications, where the teacher teaches by providing demonstrations of state/action trajectories. The teaching-by-reinforcement paradigm applies to a wider range of real-world settings where a demonstration is inconvenient, but has not been studied systematically. In this paper, we focus on a specific family of reinforcement learning algorithms, Q-learning, and characterize the TDim under different teachers with varying control power over the environment, and present matching optimal teaching algorithms. Our TDim results provide the minimum number of samples needed for reinforcement learning, and we discuss their connections to standard PAC-style RL sample complexity and teaching-by-demonstration sample complexity results. Our teaching algorithms have the potential to speed up RL agent learning in applications where a helpful teacher is available.
BibTeX
@inproceedings{zhang2021teaching,
  author = {Xuezhou Zhang and Shubham Kumar Bharti and Yuzhe Ma and Adish Singla and Xiaojin Zhu},
  title = {{The Teaching Dimension of Q-learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  url = {https://openreview.net/forum?id=XmTQgxl15F6},
}
Figure