← Back to Paper Radar

Dynamic Tool Dependency Retrieval for Lightweight Function Calling

Bhrij Patel, Davide Belli, Amir Jalalirad, Maximilian Arnold, A. Ermolov, B. Major
Annual Meeting of the Association for Computational Linguistics | 2025
The paper introduces DTDR (Dynamic Tool Dependency Retrieval), a lightweight retrieval method for LLM function-calling agents that conditions tool selection on both the initial query and the evolving multi-step tool-calling plan, rather than relying on a single static query embedding.

Problem Statement

On-device and resource-constrained LLM agents rely on retrieval modules to select a small relevant subset of tools, which improves accuracy and keeps context length manageable. Existing retrievers are static—conditioning only on the initial query—so they fail to capture how tool needs change as a multi-step plan unfolds, causing irrelevant tools to be injected into context, which confuses the agent and degrades both efficiency and downstream task accuracy.

Key Novelty

  • Dynamic retrieval conditioning that updates tool selection based on the evolving tool-calling plan rather than just the initial query
  • Explicit modeling of multi-step tool dependencies learned from function-calling demonstration data
  • A lightweight design intended for on-device/resource-constrained agentic deployment
  • Systematic exploration of strategies for integrating retrieved tools into LLM prompts

Evaluation Highlights

  • 23%–104% improvement in function calling success rate compared to state-of-the-art static retrieval baselines
  • Benchmarked across multiple datasets and LLM backbones on retrieval precision, downstream task accuracy, and computational efficiency

Signal Assessment

5/10 DTDR delivers strong, well-validated empirical gains and addresses a genuine, practically important gap in on-device agent tool retrieval, but conceptually it extends existing retrieval-augmented tool-use paradigms with plan-aware conditioning rather than introducing a fundamentally new mechanism.

Methodology

  1. Learn tool dependency patterns (e.g., co-occurrence and ordering) from function-calling demonstration trajectories
  2. At each step, retrieve candidate tools conditioned jointly on the original user query and the current partial tool-calling plan
  3. Adaptively update the retrieved tool set as the plan evolves across multiple reasoning/action steps
  4. Apply prompt integration strategies to insert retrieved tools efficiently into the LLM context
  5. Evaluate against static retrieval baselines on retrieval precision, task success rate, and computational cost across datasets and LLM backbones

System Components

Tool Dependency Model

Learns relationships between tools (e.g., which tools tend to follow or co-occur with others) from historical function-calling demonstrations

Dynamic Retriever

Selects relevant tools by conditioning on both the initial query and the current state of the evolving multi-step plan

Prompt Integration Module

Determines how retrieved tools/definitions are formatted and inserted into the LLM's prompt context

Evaluation Suite

Benchmarks retrieval precision, end-to-end function-calling accuracy, and computational efficiency across datasets and LLM backbones

Results

Metric/Benchmark Baseline (Static SOTA Retriever) This Paper (DTDR) Delta
Function calling success rate Static retrieval performance Dynamic, plan-conditioned retrieval +23% to +104%
Retrieval precision Lower due to query-only conditioning Higher due to dependency-aware, evolving conditioning Qualitative improvement reported
Computational efficiency Reference cost of static retrievers Comparable/lightweight overhead Maintains lightweight profile suitable for on-device use

Key Takeaways

  • Static, query-only tool retrieval is a bottleneck for multi-step agentic tasks; retrieval should adapt as the tool-calling plan develops
  • Modeling tool dependencies from demonstration data is a practical, lightweight way to reduce irrelevant tool injection without heavy added compute
  • How retrieved tools are integrated into prompts matters and should be tuned alongside the retrieval method itself
  • DTDR is particularly relevant for on-device/edge agent deployments where context length and compute budgets are tightly constrained

Abstract

Function calling agents powered by Large Language Models (LLMs) select external tools to automate complex tasks. On-device agents typically use a retrieval module to select relevant tools, improving performance and reducing context length. However, existing retrieval methods rely on static and limited inputs, failing to capture multi-step tool dependencies and evolving task context. This limitation often introduces irrelevant tools that mislead the agent, degrading efficiency and accuracy. We propose Dynamic Tool Dependency Retrieval (DTDR), a lightweight retrieval method that conditions on both the initial query and the evolving tool calling plan. DTDR models tool dependencies from function calling demonstrations, enabling adaptive retrieval as plans unfold. We benchmark DTDR against state-of-the-art retrieval methods across multiple datasets and LLM backbones, evaluating retrieval precision, downstream task accuracy, and computational efficiency. Additionally, we explore strategies to integrate retrieved tools into prompts. Our results show that DTDR improves function calling success rates between $23\%$ and $104\%$ compared to state-of-the-art static retrievers.

Generated from available metadata and abstract on 2026-07-14 using Claude.