Abstract
Large Language Models (LLMs) demonstrate remarkable reasoning capabilities but often lack the persistent memory required for complex, multi-step robotic tasks. This paper introduces RAG-Modulo, a framework that augments LLM-based agents with an interaction-level memory and a bank of automated critics. By retrieving relevant past experiences and validating actions through syntax, semantics, and low-level policy checks, RAG-Modulo enables agents to learn from both successes and failures in real-time. Evaluated on BabyAI and AlfWorld benchmarks, the system significantly outperforms existing baselines, achieving a 54% success rate on unseen tasks without the need for expensive fine-tuning.
Introduction
While LLMs excel at high-level planning, they typically operate as "memoryless" agents in robotic contexts. If an agent fails a task—such as attempting to open a locked door without a key—it often repeats the same error in subsequent attempts because it lacks a mechanism to store and recall specific failures. Traditional solutions like manual few-shot prompting are labor-intensive and unscalable, while fine-tuning is computationally prohibitive for real-time adaptation.
RAG-Modulo addresses this by creating a searchable database of an agent's own interactions. This allows the robot to "learn" from its history, effectively building a non-parametric knowledge base that informs future decision-making.
The RAG-Modulo Framework
The RAG-Modulo architecture integrates an LLM with two core components: Interaction Memory and a Bank of Critics.
Interaction Memory and Retrieval
Every interaction—comprising the goal, observation, action, and feedback—is stored in a vector database. During task execution, the system uses OpenAI’s text-embedding-3-large to retrieve the $K$ most relevant past experiences. These are injected into the LLM's prompt as context, providing "hints" derived from previous successes and corrected failures.
The Bank of Critics
To ensure reliability, proposed actions must pass through three specialized critics before execution:
- Syntax Critic: Validates command formatting.
- Semantics Critic: Checks logical consistency (e.g., ensuring the agent isn't trying to pick up an item while its hands are full).
- Low-level Policy Critic: Verifies physical feasibility within the environment (e.g., checking for obstacles).
If an action is rejected, the critic's feedback is returned to the LLM for immediate correction. Successful paths are then committed to memory, creating a self-improving feedback loop.
Experimental Evaluation
The framework was tested on two major embodied AI benchmarks:
- BabyAI: A 2D grid-world requiring complex, multi-step navigation and manipulation (Synth and BossLevel tasks).
- AlfWorld: A 3D household simulation where agents perform natural language tasks in both seen and unseen environments.
Key Results
RAG-Modulo demonstrated substantial improvements over state-of-the-art baselines like ProgPrompt and LLM-Planner:
- Success Rates: In AlfWorld-Unseen tasks, RAG-Modulo achieved a 54% success rate, tripling the performance of LLM-Planner (17%).
- Operational Efficiency: The agent showed higher decisiveness. In BabyAI-BossLevel, the number of illegal actions (In-Executability) dropped to 3.74, compared to 13.98 for LLM-Planner.
- Ablation Analysis: Removing the memory component led to a significant performance drop (from 0.57 to 0.37 success rate on BabyAI-BossLevel), confirming that historical recall is the primary driver of success.
Insights and Discussion
The research highlights several critical aspects of LLM-based robotic learning:
- Non-Parametric Learning: Agents can "learn" effectively without backpropagation by populating a database of experiences.
- Interaction Granularity: Retrieving individual steps from diverse tasks is more effective than retrieving entire trajectories, as it allows the LLM to synthesize solutions from modular "hints."
- Context Limits: There is a "Goldilocks" zone for retrieval; performance peaks at 5–10 interactions. Excessive context introduces noise that can distract the model.
- Learning from Failure: Storing negative feedback followed by successful corrections allows the agent to learn what not to do, which is often as valuable as knowing the correct path.
Conclusion and Future Work
RAG-Modulo provides a scalable path for robotic agents to improve through experience. Future work will focus on transitioning from simulation to physical platforms, which will require handling noisier sensor data. Additionally, the authors aim to explore trainable retrieval models and hierarchical learning to integrate high-level strategy with low-level motor skill acquisition.
Summary updated