ToolGraph as a Q-Function for Test-Time Scaling of Tool-Use Agents

Ke Shen, Ankita Bhaumik, Li Dong, Shengjie Liu, Shuzhen Li, Naveed Ahmed JanvekararXiv 2026 · arXiv

TL;DR

LLM agents often struggle with "long-horizon" tasks that require chaining multiple tools together in a specific order. This paper introduces ToolGraph, a pre-compiled dependency map of a tool catalog that acts as a multi-step $Q$-function, guiding agents by estimating the downstream utility of an action rather than just its immediate relevance.

What Problem Does This Paper Address?

While modern LLMs are decent at calling a single tool, they frequently fail at tool chaining—discovering how the output of one tool (like an order_id) serves as the required input for another (like track_shipment).

Standard documentation is often too sparse for models to infer these dependencies reliably; studies show models only identify these relations with 42–70% accuracy from descriptions alone. Existing solutions usually treat this as a retrieval problem (finding the right tool) or a one-step prediction. This paper tackles the challenge of test-time scaling: how can we use external structural knowledge to help an agent "see" several steps ahead to reach a goal?

Methods

The authors propose a pipeline to move from a static catalog to a goal-conditioned agent:

  1. ToolGraph Construction: They build a directed, weighted graph where nodes are tools and edges represent dependencies. Edges are proposed via parameter matching (type checking) and interventional probes (using an LLM to "experiment" by running tool sequences to see if one actually enables another).
  2. Multi-Step Value Estimation: Instead of just ranking tools by similarity, they derive a $Q$-value—$Q(s, a, g)$—representing the expected utility of action $a$ given state $s$ and goal $g$. They test three estimators:
  3. $Q_{dp}$: An analytic solver using dynamic programming over a simplified "entity-set" version of the state.
  4. $Q_{emb}$: A GraphSAGE neural network distilled from $Q_{dp}$ for faster, inductive inference.
  5. $Q_{llm}$: A "state-aware" LLM scorer that receives the graph evidence and the $Q_{dp}$ value as a prior, then reconciles it with the actual conversation history.
  6. Natural Language Feedback: Rather than forcing the agent to follow a mathematical argmax, a "verbalizer" translates the top-scored actions and their graph-based rationales into natural language hints for the agent.

Datasets

The researchers evaluated their approach across two major tool-use benchmarks using three different model backbones (Ministral 3 8B, Gemma 4 31B, and DeepSeek V3.2 685B):

  • ToolComp: A benchmark focused on multi-tool reasoning and process supervision.
  • $\tau^2$-Bench: A challenging benchmark for conversational agents in complex domains like retail, airlines, and telecommunications.

Key Insights and Ideas

  • The "Argument Blindness" Ceiling: Purely structural estimators (like $Q_{dp}$) have a hard limit. They can tell you that Tool B needs an order_id from Tool A, but they can't tell if the agent is currently using the correct order_id from the conversation.
  • Composition vs. Relevance: Simply knowing a tool is "relevant" to a query (like PageRank) is often safer than a multi-step plan if that plan is based on a flawed understanding of the current state.
  • State-Awareness is Non-Negotiable: Multi-step value composition only pays off when the estimator can read the concrete state. The $Q_{llm}$ approach succeeded because it combined the "global" map of the ToolGraph with the "local" context of the specific user request.
  • One-Time Cost: Graph construction is a significant upfront investment (millions of tokens for large catalogs), but it is a one-time cost that can be amortized over thousands of user requests.

Key Results

  • Consistent Gains: The $Q_{llm}$ estimator outperformed personalized PageRank (a strong retrieval baseline) in every single benchmark-backbone combination, providing an average boost of 8.3 points.
  • Beating Reflection: ToolGraph-guided agents outperformed "Reflexion" (a popular self-correction baseline) by 6.7 points on average, suggesting that external structural guidance is more effective than internal self-reasoning for complex tool use.
  • Efficiency Knobs: The authors identified a "knee" in the evidence budget—providing the agent with a subgraph radius of $h=1$ and specific node annotations (N1) provided the best balance of success versus token cost.

Limitations and Future Work

  • Delete-Free Assumption: The current $Q$-estimators use a "delete-free relaxation," meaning they assume resources (like money or inventory) aren't consumed by actions. This makes the math easier but fails in "resource-depletion" scenarios.
  • Static Probing: The interventional probes are currently conducted against a static catalog. Probing stateful or irreversible APIs (like those that actually charge a credit card) remains a challenge.
  • Future Direction: The authors suggest that the next major leap will come from lifting the "entity-set" abstraction to a full "argument-level" state representation, allowing the graph to reason about specific data values rather than just data types.

Summary updated

Abstract

Tool-use agents must chain interdependent calls, yet which outputs satisfy which later inputs in a deployed catalog is not something a general-purpose language model reliably infers from tool descriptions alone. We compile that structure once into a reusable external representation. ToolGraph is a directed, weighted dependency graph over a tool catalog: parameter matching and interventional probes, which execute a candidate chain with and without its proposed predecessor, propose edges whose evidence is combined into an edge confidence. Prior work uses such graphs to retrieve tools, search for tool paths, or score the next call. We ask instead whether the same structure can supply a \emph{multi-step} value by composing graph paths into a goal-conditioned action value \(Q(s,a,g)\). We study three estimators (dynamic programming over entity sets, a GraphSAGE estimator distilled from it, and an LLM scorer conditioned on graph evidence) plus a verbalizer that returns action--goal feedback to the agent, which keeps final action selection. Across two tool-use benchmarks and three backbones, we compare value ranking against personalized-PageRank retrieval over the identical graph, and against direct and reflective agents. Composition pays off only when the estimator also reads the concrete state: the LLM estimator improves on PageRank in every benchmark--backbone setting, by \(8.3\) points on average, while the two purely structural estimators fall below it, because a value defined over tool types cannot separate a correct tool called with a wrong argument. Graph construction is a one-time cost; we report it separately rather than assume it amortized away (at our scale it is comparable to request-time cost) and sweep four knobs controlling how much graph evidence to expose against success and tokens.
BibTeX
@misc{shen2026toolgraph,
  author = {Ke Shen and Ankita Bhaumik and Li Dong and Shengjie Liu and Shuzhen Li and Naveed Ahmed Janvekar},
  title = {{ToolGraph as a Q-Function for Test-Time Scaling of Tool-Use Agents}},
  year = {2026},
  eprint = {2611.20569},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.20569},
}
Figure