TGRL: An Algorithm for Teacher Guided Reinforcement Learning

Idan Shenfeld, Zhang-Wei Hong, Aviv Tamar, Pulkit Agrawal

Abstract

Reinforcement Learning (RL) offers a path to optimal behavior through trial and error but often suffers from extreme sample inefficiency. Imitation Learning (IL) accelerates training by mimicking a teacher but is frequently limited by teacher sub-optimality and the "information gap"—a scenario where teachers possess privileged information unavailable to the student. We present Teacher Guided Reinforcement Learning (TGRL), a framework that dynamically balances RL and IL objectives through constrained optimization. By maintaining a reward-only auxiliary policy as a performance baseline, TGRL automatically adjusts the teacher's influence via a Lagrange multiplier. This allows students to leverage guidance when beneficial and ignore it when detrimental. Our results across diverse tasks, including high-dimensional robotic manipulation, demonstrate that TGRL consistently outperforms standard baselines and can even surpass the performance of the teacher.

Introduction

In the development of autonomous agents, two paradigms dominate: Reinforcement Learning (RL) and Imitation Learning (IL). While RL is capable of discovering optimal strategies in complex environments, it is notoriously data-hungry and slow to converge. IL provides a shortcut by providing a teacher's demonstrations, yet it falls into two primary traps. First, the Sub-optimality Trap ensures that a student's performance is capped by the quality of the teacher. Second, the Information Gap occurs when a teacher relies on privileged information—such as exact object coordinates or "god-view" maps—that the student cannot access in a real-world or partially observed setting. Blindly mimicking such a teacher often leads to failure.

Existing hybrid methods attempt to balance these objectives using a fixed hyperparameter ($\alpha$). However, finding the optimal balance usually requires exhaustive manual tuning for every new task. TGRL addresses this by treating the balance as a dynamic, principled optimization problem.

Methodology

TGRL is formulated as a constrained optimization problem. Rather than simply summing reward and imitation objectives with a static weight, the algorithm follows a specific constraint: maximize the combined objective only as long as the resulting policy performs at least as well as a policy trained solely on task rewards.

The Dual-Policy Architecture

To implement this, TGRL maintains two distinct policies:

  1. The Main Policy ($\pi$): This policy learns from both the environmental rewards and the teacher's demonstrations.
  2. The Auxiliary Policy ($\pi_R$): This policy learns strictly from environmental rewards, serving as a "shadow" baseline.

Dynamic Balancing via Lagrangian Dual

The algorithm employs the Dual Lagrangian method to manage the teacher's influence. It introduces a Lagrange multiplier ($\lambda$) that functions as a dynamic "volume knob." If the Main Policy's performance drops below the reward-only Auxiliary Policy, the algorithm automatically reduces $\lambda$, decreasing the teacher's influence. Conversely, if the teacher is providing useful guidance that improves performance beyond the reward-only baseline, the influence is increased.

This mechanism allows the agent to "trust" the teacher during the early stages of training to overcome the sparse reward problem, while gradually "ignoring" the teacher if the teacher's privileged strategies fail to translate to the student's limited observations.

Experimental Setup

The efficacy of TGRL was evaluated across several environments designed to test the limits of imitation and observation:

  • Tiger Door: A puzzle where the teacher knows the goal location, but the student must first interact with a button to reveal it.
  • Lava Crossing & Memory: Grid-world tasks where the teacher has a global view, while the student has a restricted field of vision.
  • Light-Dark Ant: A Mujoco-based locomotion task where the agent must navigate noisy sensors by detouring through a "light" area to recalibrate.
  • Shadow Hand Pen Reorientation: A high-dimensional task involving a robotic hand reorienting a pen using only tactile sensors. The teacher has access to the pen's exact pose, whereas the student must rely on touch.

Key Insights

The Counterfactual Baseline

The most significant contribution of TGRL is the use of the reward-only auxiliary policy as a reality check. By constantly asking, "Is the teacher actually helping me get more reward than I could get on my own?", the agent avoids the performance plateaus common in traditional IL.

Surpassing the Teacher

Because TGRL prioritizes the final task reward over pure imitation, it is not tethered to the teacher’s maximum performance. In the Shadow Hand task, the TGRL agent eventually achieved a higher success rate than the imitation-only baseline, demonstrating that the student can indeed outshine the instructor.

Zero-Tuning Robustness

Unlike prior methods such as COSIL or ADVISOR, which require specific tuning for different environments, TGRL utilized the same hyperparameters across all tested domains. This robustness suggests that the constrained optimization approach is a generalizable solution for hybrid learning.

Results

  • Robotic Dexterity: In the Shadow Hand task, vanilla RL failed to converge, and pure imitation reached only ~54% success. TGRL achieved ~73% success, approaching the privileged teacher's ~78% success rate despite the massive information gap.
  • Resilience to Sub-optimal Teachers: When paired with a teacher that succeeded only 40% of the time in the Tiger Door task, TGRL still reached 100% success. Standard imitation learning remained trapped at the teacher's 40% threshold.
  • Data Efficiency: TGRL proved significantly more efficient than learning from scratch, successfully bridging the gap between the speed of imitation and the optimality of reinforcement learning.

Limitations and Future Work

While TGRL represents a significant step forward, some challenges remain. The algorithm can occasionally fall into local minima if the imitation objective provides a reward that is better than the current auxiliary policy but still sub-optimal. Additionally, the current balancing coefficient ($\lambda$) is updated globally. Future iterations may explore state-dependent balancing, allowing the agent to trust the teacher in specific scenarios while relying on its own experience in others. Finally, in environments where the teacher is exceptionally poor, the reward-only policy might fail to find any signal, potentially requiring additional exploration incentives.

Summary updated

BibTeX
@inproceedings{shenfeld2023tgrl,
  author = {Idan Shenfeld and Zhang-Wei Hong and Aviv Tamar and Pulkit Agrawal},
  title = {{TGRL: An Algorithm for Teacher Guided Reinforcement Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=Hk3m8Nh7mn},
}
Figure