[Paper Review] Enabling Intelligent Interactions between an Agent and an LLM: A Reinforcement Learning Approach
When2Ask trains an agent to query an LLM only when informative, achieving competitive task success with reduced LLM interaction costs across MiniGrid and Habitat environments.
Large language models (LLMs) encode a vast amount of world knowledge acquired from massive text datasets. Recent studies have demonstrated that LLMs can assist an embodied agent in solving complex sequential decision making tasks by providing high-level instructions. However, interactions with LLMs can be time-consuming. In many practical scenarios, it requires a significant amount of storage space that can only be deployed on remote cloud servers. Additionally, using commercial LLMs can be costly since they may charge based on usage frequency. In this paper, we explore how to enable intelligent cost-effective interactions between a down stream task oriented agent and an LLM. We find that this problem can be naturally formulated by a Markov decision process (MDP), and propose When2Ask, a reinforcement learning based approach that learns when it is necessary to query LLMs for high-level instructions to accomplish a target task. On one side, When2Ask discourages unnecessary redundant interactions, while on the other side, it enables the agent to identify and follow useful instructions from the LLM. This enables the agent to halt an ongoing plan and transition to a more suitable one based on new environmental observations. Experiments on MiniGrid and Habitat environments that entail planning sub-goals demonstrate that When2Ask learns to solve target tasks with only a few necessary interactions with the LLM, significantly reducing interaction costs in testing environments compared with baseline methods. Our code is available at: https://github.com/ZJLAB-AMMI/LLM4RL.
Motivation & Objective
- Motivate reducing costly interactions with LLM planners in embodied agents.
- Develop a Planner-Actor-Mediator framework with a learnable asking policy.
- Demonstrate cost-effective planning in partially observable environments (MiniGrid) and realistic settings (Habitat).
- Provide open-source code to advance research on LLM-assisted RL.
Proposed method
- Utilize a Planner-Actor-Mediator architecture where the planner is a pre-trained LLM.
- Define a mediator with an asking policy trained by PPO to decide when to query the LLM.
- Represent observations as text via a translator to feed the LLM planner.
- Employ predefined option policies (Explore, Go to, Pickup, Toggle) for low-level actions.
- Train the mediator’s asking policy with a reward balancing task performance and interaction cost.
Experimental results
Research questions
- RQ1Can an RL-trained asking policy reduce unnecessary LLM queries without sacrificing task success?
- RQ2Does learning to query the LLM improve robustness under partial observability?
- RQ3How does When2Ask compare to baselines in terms of interaction cost and success rates in MiniGrid and Habitat?
- RQ4Is the approach generalizable across diverse embodied environments and tasks?
Key findings
- The approach reduces the number of LLM interactions while maintaining high task success across environments.
- In MiniGrid, Our approach achieves similar or better success with far fewer LLM interactions compared to Always/Random baselines.
- In ColoredDoorKey and MovingObstacle, the learned mediator enhances robustness against environmental and translator uncertainties.
- The method generalizes from simple grid tasks to visually realistic Habitat tasks, outperforming baselines in success rate.
- Open-source code is provided for reproducibility and further research.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.