TL;DR
GraphPlanner is a novel "agentic" router that moves beyond simply picking an LLM for a task; instead, it dynamically constructs a multi-agent workflow tailored to each query. By leveraging a heterogeneous graph memory (GARNet) and reinforcement learning, it improves accuracy by up to 9.3% while slashing GPU memory requirements from 186 GiB to just 1 GiB.
What Problem Does This Paper Address?
Large Language Model (LLM) routing is the practice of sending a query to the most suitable model to balance cost and performance. However, most existing routers are "static"—they either pick one model for the whole task (single-round) or a simple sequence of models (multi-round).
Real-world problems are rarely that simple. They often require agentic capabilities: decomposing a complex goal into sub-tasks, assigning specialized roles (like a "Planner" or "Summarizer"), and learning from past interactions. Existing routers struggle here because they don't explicitly model collaboration between different LLMs, they ignore the rich "memory" of previous successful workflows, and they face a difficult "credit assignment" problem—knowing which specific step in a multi-step process caused a final failure.
Methods
The authors propose GraphPlanner, which treats routing as a sequential decision-making process formulated as a Markov Decision Process (MDP). At each step, the router doesn't just pick a model; it picks a (Model, Role) pair.
The core innovation is GARNet, a heterogeneous graph neural network that manages two types of memory:
- Workflow Memory ($G_{workflow}$): Tracks the current state of the active task (e.g., which sub-queries have been answered and by whom).
- Historical Memory ($G_{history}$): A "long-term memory" of past interactions across different queries, roles, and responses.
By using "role hub" nodes, GraphPlanner creates a bridge between these two graphs, allowing the router to "remember" that a specific small model is great at summarizing math but terrible at writing code. The entire system is trained using Proximal Policy Optimization (PPO), a reinforcement learning algorithm, with a reward function that explicitly balances task accuracy against computational cost.
Datasets
The researchers evaluated GraphPlanner across 14 diverse tasks spanning 6 domains:
- Math: GSM8K, MATH
- Code: MBPP, HumanEval
- Reasoning: CommonsenseQA, ARC, OpenBookQA
- World Knowledge: NaturalQuestions, TriviaQA
- General Knowledge: MMLU, GPQA
- Zero-Shot/Out-of-Domain: LogicGrid, MGSM, CommonGen
They also tested the system's ability to handle unseen LLMs (models not present during training) and high-difficulty competition math (AIME).
Key Insights and Ideas
- Routing as Architecture: The paper shifts the perspective of routing from "model selection" to "dynamic architecture generation." The router essentially becomes a meta-agent that builds a custom team for every query.
- The Power of Heterogeneity: Treating queries, models, and roles as different types of nodes in a graph allows the model to capture complex relational patterns that simple text embeddings or flat classifiers miss.
- Inductive vs. Transductive Inference: GraphPlanner supports two modes. Inductive mode is lightweight and fast, generating decisions without looking back. Transductive mode allows the router to "consult" its historical memory during inference, yielding higher accuracy at the cost of more compute.
- Zero-Shot Generalization: Because the router learns the relationships between task types and model capabilities rather than just memorizing specific tasks, it generalizes remarkably well to entirely new domains and LLMs.
Key Results
- Superior Performance: In complex workflow generation, GraphPlanner outperformed the best baselines by 9.3% in accuracy.
- Massive Efficiency Gains: Compared to heavy multi-round routers like Router-R1, GraphPlanner reduced training GPU memory costs from 186.26 GiB to 1.04 GiB—a 99% reduction—while maintaining a fast inference latency.
- Robust Generalization: On unseen tasks (like LogicGrid), GraphPlanner achieved 78% average accuracy, which is 20–40% higher than previous state-of-the-art routers.
- Pareto Efficiency: The model consistently stayed on the "Pareto frontier," meaning it provided the best possible accuracy for any given budget.
Limitations and Future Work
While highly effective, the authors note a few areas for growth:
- Role Diversity: The current implementation primarily uses three roles (Planner, Executor, Summarizer). A wider library of specialized agent roles could further improve performance.
- Memory Scaling: As the historical graph grows over millions of queries, managing the $G_{history}$ might require more sophisticated pruning or retrieval mechanisms to maintain efficiency.
- Complex Planning: While it handles nested planning well, extremely deep hierarchies of sub-tasks were not the primary focus and might require further optimization of the MDP transition dynamics.
Summary updated