How Many Tools Should an LLM Agent See? A Chance-Corrected Answer
This paper introduces a chance-corrected metric called Bits-over-Random (BoR) to dynamically optimize the number of tools presented to LLM agents, demonstrating through reinforcement learning that adaptive shortlists significantly improve tool selection accuracy and coverage compared to fixed-size approaches across diverse benchmarks.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a chef (the AI agent) trying to cook a specific dish (answer a user's question). You have a massive pantry (the tool registry) with thousands of ingredients (tools). Before you can start cooking, a sous-chef (the retrieval system) has to decide which ingredients to hand you.
The big question this paper asks is: How many ingredients should the sous-chef put on your counter?
- If they hand you too many: You get overwhelmed, confused, and might grab the wrong spice.
- If they hand you too few: You might not have the one specific ingredient you actually need, and the dish fails.
Most kitchens today use a fixed rule: "Always hand the chef exactly 5 ingredients," no matter how easy or hard the recipe is. This paper argues that this is a bad idea and proposes a smarter, self-adjusting system.
Here is the breakdown of their solution using simple analogies:
1. The Problem with "Fixed Rules"
Imagine a library where you need to find one specific book.
- The Fixed Rule: The librarian always hands you a stack of 5 books.
- Easy query: You needed a book about "Apples." The librarian hands you 5 books, and the first one is about Apples. Great! But you wasted time reading the other 4.
- Hard query: You needed a book about "18th-century rare fungi." The librarian hands you 5 books, but the right one is the 12th book in the library. You get 0 correct books.
The paper says we need a way to measure if the librarian is doing a good job, not just by how many books they hand you, but by how much better they are than if they were just grabbing books at random.
2. The Solution: "Bits-over-Random" (BoR)
The authors introduce a metric called Bits-over-Random (BoR). Think of this as a "luck score."
- The Random Baseline: If the librarian just grabbed books blindly from the shelf, what are the odds they'd get the right one?
- The BoR Score: This measures how much better the librarian is doing compared to that blind luck.
- If the librarian hands you 1 book and it's the right one, that's a huge win (because random chance would rarely get it right with just 1 try).
- If the librarian hands you 100 books and the right one is in there, that's a smaller win (because random chance would likely have found it anyway with 100 tries).
The Magic Trick: The paper uses this "luck score" as a reward for a learning robot (an RL agent).
- If the robot stops early and finds the tool, it gets a big reward (because it beat the odds easily).
- If the robot keeps adding more tools to the list, the reward naturally shrinks (because finding the tool in a huge pile is less impressive; it's easier to get lucky).
This means the robot learns to stop adding tools as soon as it's confident it has the right one, without needing a human to tell it, "Stop at 5!"
3. The Results: The Smart Sous-Chef
The researchers tested this "Smart Sous-Chef" against the "Fixed Rule" (always 5 tools) on three different test kitchens:
The Small Kitchen (BFCL - 370 tools):
- Fixed Rule: Always shows 50 tools to be safe. It finds the right tool 90.8% of the time.
- Smart Chef: Shows only 7 tools on average. It still finds the right tool 90.3% of the time.
- Result: The Smart Chef saves a massive amount of "counter space" (tokens) with almost no loss in success.
The Giant Warehouse (ToolBench - 3,251 tools):
- Fixed Rule: Always shows 5 tools. It finds the right tool 64.7% of the time.
- Smart Chef: Shows about 4.4 tools on average. It finds the tool 61.9% of the time.
- The Twist: On the really hard questions (where the right tool is buried deep in the warehouse), the Fixed Rule finds 0% of them. The Smart Chef, realizing the first few tools aren't working, digs a little deeper (showing 5.7 tools) and finds 16.7% of those hard ones. The Fixed Rule gives up too early.
4. Why Less is More (The "Clutter" Effect)
The paper also tested what happens when the AI actually tries to pick the tool.
- The Finding: When the AI is shown a huge list of tools (like 50), it gets confused and picks the wrong one more often.
- The Analogy: If you ask a friend, "Which of these 50 photos is my dog?" they might guess wrong because there are too many options. If you show them just 2 photos, they are much more likely to pick the right one.
- The Proof: When the Smart Chef showed fewer tools, the AI picked the correct tool 93.1% of the time. When forced to look at 5 tools (the Fixed Rule), it only picked correctly 87.1% of the time.
Summary
This paper proves that we don't need a "one-size-fits-all" number for how many tools to show an AI.
- Old Way: "Show 5 tools." (Too few for hard tasks, too many for easy ones).
- New Way: Use a "Luck Score" (BoR) to teach the system to stop adding tools the moment it has a good chance of success.
- Benefit: It saves computing power, reduces confusion for the AI, and actually helps the AI find the right answer on difficult questions that fixed rules miss.
The authors built a simple "probe" robot to test this idea, not a full production system, but the results suggest that letting the AI decide how much to look at is much smarter than forcing it to look at a fixed amount.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.