TL;DR
This paper introduces Relign, a framework designed to stop Large Language Models (LLMs) from "hallucinating" when using external tools—either by picking the wrong tool or misusing a correct one. By expanding the model's action space to include "indecisive" actions like asking for clarification or switching tools, and training with a new reliability-focused alignment strategy, the authors significantly improve task success and interaction efficiency.
What Problem Does This Paper Address?
As LLMs evolve into autonomous agents (like AutoGPT), they increasingly rely on external APIs and tools to interact with the world. However, these models often suffer from tool hallucinations. Unlike a simple text error, a tool hallucination—such as calling a database deletion API with the wrong ID—can have tangible, destructive real-world consequences.
The authors identify a fundamental gap: most current research focuses on making models better at selecting tools from a fixed list, but fails when the necessary information is missing or the available tools simply don't fit the task. In these "boundary" cases, models often default to guessing, leading to fabricated parameters or irrelevant tool calls.
Methods
The researchers tackle this problem through three main contributions:
- Taxonomy & Evaluation: They categorize tool hallucinations into two main types: Selection (wrong tool or wrong timing) and Usage (wrong format or fabricated content). They developed an automated evaluation pipeline that uses a hybrid of rule-based checks and LLM-based semantic reasoning.
- Reliability Metrics: They propose the Reliable Pass Rate (RePR), which discounts successful tasks if they involved any hallucinated tool calls. They also introduced Benefit-cost Utility, a metric that penalizes both hallucinations and excessive, redundant tool calls.
- Relign Framework: This is the core mitigation strategy. It introduces an indecisive action space, giving the model the ability to invoke
ChangeToolsorTalkToUserwhen it lacks sufficient information. The training process involves: - Reliable SFT (Supervised Fine-Tuning): Training the model on curated traces where it correctly uses these new indecisive actions.
- Reliable DPO (Direct Preference Optimization): A two-step alignment process where the model learns to prefer correct tool calls over indecisive actions, and indecisive actions over hallucinations ($A_{correct} > A_{indecisive} > A_{hallucinated}$).
Datasets
The study utilizes three primary datasets:
- ToolBench: A large-scale dataset of 120,000 samples scraped from RapidAPI.
- StableToolBench: A subset of solvable samples with a stable evaluation environment.
- RelyToolBench (New): The authors' specialized benchmark derived from StableToolBench. It includes two challenging new subsets:
- Missing Parameter Subset: Tasks where crucial information is hidden to see if the model seeks clarification.
- Unmatched Tools Subset: Tasks where the provided tools are irrelevant, testing if the model can identify the mismatch.
Key Insights and Ideas
- The "Decisive" Trap: Standard LLM tool-use training forces models to choose a tool. When no tool fits, the model is essentially "forced" to hallucinate. Providing an "indecisive" exit ramp (like asking the user) is critical for reliability.
- Scaling vs. Data Size: Interestingly, increasing the amount of training data from 1k to 5k samples improved general performance but didn't necessarily reduce hallucination rates, likely due to overfitting on "happy path" trajectories. However, scaling model size (from 1.5B to 14B parameters) showed a clear reduction in hallucinations, as larger models better capture complex task dependencies.
- Hallucinations Mislead Success: The authors found that standard "Pass Rate" metrics are often inflated because models reach the correct answer through "lucky" hallucinations that don't reflect true reliability. RePR provides a much more rigorous "truth" for agent performance.
Key Results
- Hallucination Reduction: Relign significantly reduced tool hallucination rates across multiple models (Llama 3.1, Qwen 2.5, ToolLLaMA). For example, on Llama 3.1, the hallucination rate dropped from over 50% to roughly 14.6%.
- Improved Reliability: The Reliable Pass Rate (RePR) saw substantial gains. On the challenging "Unmatched Tools" subset, Relign-aligned models achieved nearly 90% RePR compared to the baseline's ~54%.
- Efficiency Gains: Because the model learns to avoid redundant or incorrect calls, the average number of tool calls per task decreased, leading to lower computational costs and faster execution.
Limitations and Future Work
- Timing Hallucinations: While Relign excels at fixing content and type hallucinations, "Timing Hallucinations" (calling the same tool repeatedly with identical inputs) remain harder to mitigate. This suggests that learning long-term sequential dependencies in tool-use history is still a challenge.
- Real-world Complexity: The training data (ToolBench) consists of well-structured trajectories. Future work is needed to see how these models handle the "messy" edge cases of real-world API failures and non-deterministic environments.
Summary updated