Abstract: Large Language Models (LLMs) have demonstrated significant success across various domains. However, their application in complex decision-making tasks frequently necessitates intricate prompt engineering or fine-tuning, leading to challenges in unseen downstream tasks and heavy demands on computational resources. Meanwhile, Reinforcement Learning (RL) has been recognized as effective in decision-making problems but struggles in environments with sparse rewards, such as open-world games. To overcome these challenges, we introduce AdaRefiner, a novel framework designed to enhance the synergy between LLMs and RL feedback. The key component of AdaRefiner is a lightweight Adapter Language Model (LM), which automatically refines task comprehension based on feedback from RL agents. This method mitigates the need for intricate prompt engineering and intensive LLM fine-tuning while maintaining the LLMs' generalization abilities and enhancing their decision-making capabilities in downstream tasks. Empirical evaluations of AdaRefiner on 22 diverse tasks within the open-world game Crafter have demonstrated its superior effectiveness, especially in guiding agents towards higher-level and common-sense skills. Our work makes contributions to the automatic self-refinement of LLMs with RL feedback, offering a more adaptable and efficient solution for complex decision-making problems.
Introduction
Large Language Models (LLMs) are excellent at high-level planning but often fail to "ground" their advice in the messy, specific realities of a dynamic environment. Conversely, Reinforcement Learning (RL) agents are great at fine-grained motor control but struggle with "sparse rewards"—situations where they might wander for hours before accidentally doing something "right" (like crafting a specific tool). Current solutions usually involve intricate manual prompt engineering or computationally expensive LLM fine-tuning, which often leads to "catastrophic forgetting."
AdaRefiner addresses this by introducing a lightweight "Adapter Language Model" (LM) between a Decision LLM (like GPT-4) and an RL agent. This creates a closed-loop system where the LLM's guidance evolves as the agent learns.
Methods
The AdaRefiner architecture consists of three main components: a lightweight Adapter LM (Llama2-7B), a Decision LLM (GPT-4), and an RL Agent (PPO).
The Adapter LM acts as a translator, taking raw environment data and the agent's recent history to generate a tailored prompt. It is fine-tuned using QLoRA based on a comprehension score, which measures the cosine similarity (using SentenceBERT) between the LLM’s suggested sub-goals and the agent’s actual trajectory. If the score is low, the Adapter LM realizes the agent "doesn't get it" and adjusts the next prompt to be more descriptive or remedial. The Decision LLM receives this refined prompt to generate high-level sub-goals, which the RL Agent then attempts to execute.
Experimental Setup
The framework was evaluated on Crafter, a 2D open-world survival benchmark. The evaluation covered 22 diverse tasks, such as collecting wood, fighting zombies, and crafting iron tools. These tasks are hierarchical; for instance, a player cannot "Make Iron Pickaxe" without first mastering several prerequisite levels of resource gathering and crafting.
Results
AdaRefiner significantly outperformed state-of-the-art baselines in the Crafter environment, achieving an overall success rate of 28.2%. This nearly doubles the performance of the top RL baseline, DreamerV3 (14.5%), and far surpasses LLM-only methods like Reflexion (11.7%).
Key findings include:
- Task Depth: AdaRefiner was the only method capable of reaching "Level 7" tasks, such as "Make Iron Pickaxe" and "Make Iron Sword."
- Emergent Common Sense: The system developed human-like survival strategies, such as placing stone blocks to build shelters at night to avoid combat, emerging naturally from the synergy of LLM reasoning and RL survival.
- Efficiency: Even with only 1 million training steps, AdaRefiner outperformed models that had access to external domain-specific knowledge.
Conclusion
AdaRefiner demonstrates that a lightweight adapter can effectively bridge the gap between high-level reasoning and low-level execution. By sensing an agent's needs through a comprehension score, the system provides adaptive "scaffolding" that scales with the agent's skill. While extremely long-horizon tasks like "Collect Diamond" remain a challenge, this framework offers a more adaptable and efficient solution for complex decision-making problems in open worlds.
Summary updated