Abstract
Large Language Models (LLMs) are increasingly deployed as autonomous agents for complex task planning. However, they often struggle with limited internal knowledge and poor generalization to novel tasks. We present InstructRAG, a framework that organizes successful historical experiences into an "Instruction Graph." Utilizing a multi-agent meta-reinforcement learning approach, InstructRAG enables agents to synthesize novel planning paths and adapt rapidly to unseen domains. Experimental results show that InstructRAG significantly outperforms existing baselines, achieving up to a 19.2% improvement in task success rates.
Introduction
While LLMs excel at many reasoning tasks, their performance as autonomous agents in dynamic environments (e.g., web navigation, scientific experimentation) is often hindered by two primary challenges:
- Enlargeability: Traditional retrieval systems often fail to combine disparate successful experiences to solve novel problems.
- Transferability: Adapting to a new domain typically requires extensive retraining or fine-tuning, which is computationally expensive.
InstructRAG addresses these limitations by treating past experiences as a searchable, combinable graph of instructions rather than a static list.
Methodology
The InstructRAG framework consists of three core components: an Instruction Graph, an RL-Agent for path synthesis, and an ML-Agent for task adaptation.
Instruction Graph
The Instruction Graph serves as the system's memory. Nodes represent clusters of semantically similar instructions (e.g., "Search for [Topic]"), while edges represent the specific tasks to which these instructions belong. By clustering similar steps from different tasks, the graph creates "junctions" that allow the agent to pivot between known paths, effectively expanding the reachable state space.
RL-Agent for Enlargeability
The RL-Agent utilizes the REINFORCE algorithm to traverse the Instruction Graph. Its objective is to discover candidate instruction paths for a given query. Because the graph connects instructions across different tasks, the RL-Agent can "hallucinate" valid new sequences that have never been explicitly seen before but are logically sound based on the graph's structure.
ML-Agent for Transferability
The ML-Agent employs meta-learning to select the optimal path from the candidates generated by the RL-Agent. It formats the selected path as an in-context learning exemplar to guide the LLM's planning. This meta-learning approach allows the system to adapt to entirely new domains with only a few examples (few-shot learning).
Experimental Evaluation
We evaluated InstructRAG on four benchmarks: HotpotQA (reasoning), ALFWorld (embodied AI), Webshop (e-commerce), and ScienceWorld (scientific reasoning).
Key Results
- Performance Gains: InstructRAG achieved substantial improvements over the state-of-the-art RAP baseline: 19.2% on HotpotQA, 9.3% on ALFWorld, and 6.1% on Webshop.
- Cross-Dataset Generalization: In a zero-shot transfer test from HotpotQA to ScienceWorld, InstructRAG outperformed the best baseline by 10.2%, demonstrating its ability to capture general planning logic.
- Robustness: The system maintained high performance even when 50% of the retrieved paths were intentionally corrupted with noise, showing superior resilience compared to traditional RAG methods.
Discussion
A critical factor in InstructRAG's success is the similarity threshold ($\delta$) used for node clustering. A moderate threshold (found to be approximately 0.4) balances graph connectivity with instruction specificity. While the meta-training phase is computationally intensive, the resulting gains in adaptability and planning accuracy provide a significant advantage for long-term autonomous agents.
Conclusion
InstructRAG introduces a novel way to leverage historical data for LLM task planning. By structuring experiences as a graph and using multi-agent reinforcement learning, it overcomes the traditional barriers of enlargeability and transferability. Future work will focus on optimizing the efficiency of the meta-adaptation phase and expanding the framework to more complex, multi-modal environments.
Summary updated