LgTS: Dynamic Task Sampling using LLM-generated Sub-Goals for Reinforcement Learning Agents

Yash Shukla, Wenchang Gao, Vasanth Sarathy, Alvaro Velasquez, Robert Wright, Jivko Sinapov

TL;DR

LgTS (LLM-guided Teacher-Student learning) is a novel framework that uses off-the-shelf Large Language Models to generate a "roadmap" of sub-goals for Reinforcement Learning (RL) agents. By treating the LLM's advice as a directed graph and using a Teacher-Student learning strategy, the agent can efficiently learn complex, long-horizon tasks without the need for LLM fine-tuning or pre-existing skills.

What Problem Does This Paper Address?

While Large Language Models (LLMs) are excellent at high-level reasoning and planning, translating those plans into physical actions for a robot or an artificial agent remains a major hurdle. Current approaches often suffer from three main issues:

  1. Heavy Assumptions: They often require fine-tuning the LLM on specific datasets or assume the agent already possesses a library of pre-trained "skills" (policies) to execute the plan.
  2. Brittleness: LLM plans are often static. If the environment changes or the LLM "hallucinates" an impossible step, the agent fails.
  3. Sample Inefficiency: RL agents typically struggle with "sparse rewards" (only getting a "good job" signal at the very end of a long task). Without guidance, they might spend millions of steps wandering aimlessly.

The authors address these gaps by asking: How can we use imperfect, off-the-shelf LLM advice to help an RL agent learn from scratch in an unknown environment while minimizing wasted interactions?

Methods

The LgTS framework operates in three main phases:

  1. LLM-Generated Sub-goals: Instead of asking for one perfect plan, the researchers query an LLM (like Llama 2 or GPT-4) to provide multiple feasible paths to a goal using symbolic descriptions (e.g., "pick up Key1," "unlock Door").
  2. DAG Construction: These paths are converted into a Directed Acyclic Graph (DAG). Nodes represent symbolic states (sub-goals), and edges represent sub-tasks the agent needs to learn.
  3. Teacher-Student Learning:
    • The Student: A low-level RL agent (using Proximal Policy Optimization, or PPO) that tries to learn the specific skills required to traverse the edges of the graph.
  4. The Teacher: A high-level algorithm that decides which sub-task the student should practice next. It prioritizes tasks where the student shows "promise" (learning progress) and prunes paths that are found to be unpromising or redundant.

This "Teacher" ensures the agent doesn't waste time on sub-goals that are too difficult or don't lead to the final objective.

Datasets

The authors evaluated LgTS on two primary environments:

  • DoorKey Domain (MiniGrid): A grid-world where an agent must find a key, navigate to a door, unlock it, and reach a goal while avoiding lava. They also tested versions of this with "distractor" objects (useless items like plates or apples) and modified prompts (using synonyms like "Code" for "Key").
  • Search and Rescue Domain: A more complex environment requiring a 7-step plan: find a key, open a door, retrieve a fire extinguisher, put out a fire, and rescue survivors. This task features a much larger state space (24 distinct transitions).

Key Insights and Ideas

  • Redundancy is a Strength: By querying the LLM for multiple paths, the framework becomes robust. If one path suggested by the LLM is sub-optimal or impossible in the current environment, the agent can discover this through experience and switch to a better path in the DAG.
  • Pruning the Search Space: The Teacher-Student framework acts as a dynamic curriculum. Once the agent learns a successful path to the goal, the Teacher stops sampling other redundant sub-tasks, drastically saving training time.
  • Common Sense over Fine-Tuning: The paper demonstrates that off-the-shelf LLMs have enough "common sense" about physical tasks (e.g., you need a key to open a door) to provide useful guidance without any domain-specific fine-tuning.
  • Robustness to Language: The system performed well even when the prompt used synonyms. This suggests the method isn't just memorizing specific keywords but is leveraging the LLM's underlying semantic understanding.

Key Results

The results show that LgTS is significantly more efficient than standard RL approaches:

  • Success Rate: In the DoorKey domain, LgTS achieved a 92% success rate using roughly 4 million interactions.
  • Failure of Baselines: Traditional "Learning from Scratch" (LFS) and standard Reward Shaping (LgRS) failed to solve the task even after 50 million interactions (0% success rate).
  • Oracle Comparison: LgTS performed nearly as well as an "Oracle" (AgTS) that was given the perfect, ground-truth task structure by a human expert.
  • Complex Tasks: In the Search and Rescue task, LgTS maintained a 76% success rate, whereas all non-graph-based baselines failed completely.

Limitations and Future Work

  • The Labeling Function: The system currently assumes access to a "labeling function" that tells the agent when a symbolic state (like "Holding Key") has been reached. In real-world robotics, this would require sophisticated computer vision.
  • Predefined Entities: The agent needs to know which objects and predicates exist in the environment beforehand.
  • Future Directions: The authors suggest automating the entity identification process using object detectors and implementing a "closed-loop" system where the RL agent's failures are fed back to the LLM to generate even better revised plans.

Summary updated

BibTeX
@inproceedings{shukla2024lgts,
  author = {Yash Shukla and Wenchang Gao and Vasanth Sarathy and Alvaro Velasquez and Robert Wright and Jivko Sinapov},
  title = {{LgTS: Dynamic Task Sampling using LLM-generated Sub-Goals for Reinforcement Learning Agents}},
  booktitle = {AAMAS},
  year = {2024},
  url = {https://openreview.net/forum?id=1mbFTCjtsu},
}
Figure