Manuscript Offprint

arXiv:2610.02330

Choosing Before Acting: Comparative Value Estimation for Long-Horizon Tool-Use Agents

Yu Li, Zheng Zhang, Xin Liu, Shengtian Yang, Guangfeng Cai, Lei Feng

Abstract

Large language models (LLMs) rely on long-horizon tool invocation sequences for complex tasks, where each invocation can alter the task state and condition subsequent decisions. In long-horizon tool use, final-outcome rewards provide weak credit assignment over long interaction traces. Step-level rewards can offer more targeted feedback, but obtaining reliable step supervision often requires human or LLM judgment, or additional rollouts to estimate the downstream effect of an intermediate decision. In this paper, we argue that effective tool-use agents should estimate the long-horizon value of a possible next tool invocation before executing it. This objective requires comparative supervision over alternative invocations under the same context, while logged trajectories only contain the invocation that was actually taken. Therefore, we propose Comparative Inference for Tool-use Agents (CITA). CITA trains a Comparative Inference Model (CIM) from paired signals that combine observed tool behavior, scalable supervision from a Bayesian tool-graph simulator, and semantic judgments from LLM-based comparison. The resulting CIM learns to estimate how likely a possible next tool invocation is to support final task success under the current context. Across three tool-use benchmarks and multiple backbone LLMs, CITA consistently improves Tool F1 and task success. Additional analysis shows that CIM learns accurate step-level value estimates for comparative tool choices.

1 Introduction

Large language models (LLMs) extend their capabilities through external tools, including search engines [1–3], calculators [4–7], code interpreters [8], and application programming interfaces (APIs) [9]. These tools extend LLMs beyond text-only generation and enable agents to interleave reasoning with action in real tool environments [10–13]. As tool use moves from isolated calls to long interaction traces, tool selection becomes a sequential decision problem [14–17]. Each tool invocation updates the task state, and an early choice can enable or block later calls [18–21]. Therefore, the quality of a tool choice cannot be judged only by its local fit to the current instruction. It also depends on whether the choice supports final task success after the remaining interaction [22–24].

This long-horizon dependency makes reinforcement learning (RL) difficult [25–27]. Final-outcome rewards are easy to define, but they provide feedback only after the full trajectory is completed. For long interaction traces, such rewards give little information about which intermediate tool invocations caused success or failure [28, 29]. Step-level rewards can provide more direct feedback, and process reward models have been studied for improving multi-step reasoning [30, 31]. However, reliable

∗^{*}Corresponding author.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

(a) Error accumulation

Figure

(b) Irrecoverable failure

Figure

(c) Ranking reversal

Model rankEmpirical rankSuccess rate
Canvas Homework.step 3get_emailsread_emailread_emailget_emails7/10 (70%)2/8 (25%)
Canvas Art Quiz.step 3create_quizquestionquizquestioncreate_quiz22/23 (96%)12/17 (71%)
Course Schedule.step 3pdf_pagesworkbookmetaworkbookmetapdf_pages2/5 (40%)0/3 (0%)
Apply PhD Email.step 3search_nodesread_graphsearch_nodesread_graph5/6 (83%)4/13 (31%)

39 / 80 fork points reversed (49%)

Figure 1: Pilot analysis on long-horizon tool-use tasks. (a) Task success drops sharply as the required number of tool invocations increases. (b) Most failed trajectories remain unrecoverable even after several backtracking steps. (c) At many fork points, the model-preferred tool is not the tool with the higher empirical success rate under the same context. These patterns motivate comparative value estimation for possible next-tool choices before execution.

step-level supervision is difficult to obtain in tool-use environments. Human annotation does not scale [32, 25, 26], and LLM-based judgments can be unstable [33, 34]. Rollout-based estimation can infer the value of an intermediate decision, but it must continue the interaction from that state and execute additional tool invocations [35, 30]. Since each continuation may update the environment state, the resulting signal is costly and noisy [28].

These concerns are visible in our pilot analysis, as shown in Figure 1. The error accumulation analysis shows that task success drops sharply as the required number of tool invocations increases, indicating that errors accumulate across long interaction traces and make local tool selection unreliable. The failure recoverability analysis shows that 95%95\% of failed trajectories remain unrecoverable after one step of backtracking, and 76%76\% remain unrecoverable after four steps. This suggests that final feedback often arrives too late to guide the intermediate decisions that caused failure. The first two results indicate that a tool-use agent should evaluate a possible next tool invocation before execution. The remaining question is whether the agent's own local preference can serve as this evaluation signal. Our preference misalignment analysis shows that, at 49%49\% of fork points, the tool ranked higher by the model has a lower empirical success rate than an alternative under the same context. This mismatch suggests that local preference alone is not sufficient for next-tool selection.

These observations shift the objective from following local preference to estimating the downstream value of each possible next tool invocation. We define this signal as the long-horizon value under the current context, which measures whether a candidate invocation is likely to support final task success. Since this value is meaningful for decision making only relative to available choices, the agent must learn to compare alternative invocations under the same context. A practical obstacle is that logged trajectories only contain the invocation that was actually selected, leaving the values of unselected alternatives unobserved [36–38]. This missing comparison signal motivates a comparative inference model that learns from paired evidence over alternative tool choices.

To instantiate this idea, we propose Comparative Inference for Tool-use Agents (CITA). CITA trains a Comparative Inference Model (CIM) to estimate and compare the long-horizon values of candidate next-tool invocations under the current context. Given a tool-use context and a candidate invocation, CIM predicts whether this choice is likely to support final task success. To make this comparative value signal learnable, we construct paired training signals that expose alternative choices under related or shared contexts from three complementary sources: (1) Real trajectories supply pairs by matching similar decision contexts, comparing different next tools, and using their downstream outcomes as supervision. (2) A Bayesian simulator over the tool transition graph supplies scalable pairs in a sandbox, where synthetic tool success probabilities and transition reliability probabilities are sampled from Bayesian priors. This source creates controlled fork-point comparisons without executing real APIs. (3) LLM-based comparison supplies semantic pairs by comparing the factual tool choice with a plausible alternative under the same context. These complementary signals train CIM to estimate the long-horizon value of a possible next tool invocation under the current context.

CITA uses CIM as both a rollout guide and a training signal. During policy optimization training, the policy samples a set of possible next tool invocations at each decision step, and CIM selects the call with the highest predicted success value under the current context. This process produces complete trajectories guided by step-level value estimates. After execution, CIM scores the realized tool sequence by estimating V(st,at)V(s_t, a_t) at each step, and the aggregated scores form a comparative reward. This reward is combined with a task-level matching reward to compute group-relative advantages for policy optimization. At inference, CITA reuses the same CIM-guided selection process without policy updates. This design enables CIM to guide local tool choices during trajectory construction and provide long-horizon value feedback during policy learning.

We evaluate CITA on Toolathlon, TOUCAN, and TRAJECT-Bench with multiple backbone LLMs. CITA improves Tool F1 and end-to-end task success across benchmarks. We also evaluate CIM directly and show that it produces accurate step-level value estimates under comparative tool choices.

Our contributions are summarized as follows:

• We design a Comparative Inference Model (CIM) for long-horizon tool use and train it with a three-source data construction strategy. The strategy builds paired signals from real trajectories, a Bayesian tool-graph simulator, and LLM-based comparison.

• We propose Comparative Inference for Tool-use Agents (CITA), a framework that uses CIM to guide policy optimization training. CIM scores sampled next-tool invocations during rollout generation and provides dense step-level comparative rewards after rollout completion.

• We show that CITA improves Tool F1 and end-to-end task success on three tool-use benchmarks, and that CIM learns effective step-level value estimates.

References (56)