Verification-Guided Context Optimization for Tool Calling via Hierarchical LLMs-as-Editors

Henger Li, Shuangjie You, Flavio Di Palo, Yiyue Qian, Ayush Jain
12/15/2025
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

Tool calling enables large language models (LLMs) to interact with external environments through tool invocation, providing a practical way to overcome the limitations of pretraining. However, the effectiveness of tool use depends heavily on the quality of the associated documentation and knowledge base context.

Show full abstract

These materials are usually written for human users and are often misaligned with how LLMs interpret information. This problem is even more pronounced in industrial settings, where hundreds of tools with overlapping functionality create challenges in scalability, variability, and ambiguity. We propose Verification-Guided Context Optimization (VGCO), a framework that uses LLMs as editors to automatically refine tool-related documentation and knowledge base context. VGCO works in two stages. First, Evaluation collects real-world failure cases and identifies mismatches between tools and their context. Second, Optimization performs hierarchical editing through offline learning with structure-aware, in-context optimization. The novelty of our LLM editors has three main aspects. First, they use a hierarchical structure that naturally integrates into the tool-calling workflow. Second, they are state-aware, action-specific, and verification-guided, which constrains the search space and enables efficient, targeted improvements. Third, they enable cost-efficient sub-task specialization, either by prompt engineering large editor models or by post-training smaller editor models. Unlike prior work that emphasizes multi-turn reasoning, VGCO focuses on the single-turn, large-scale tool-calling problem and achieves significant improvements in accuracy, robustness, and generalization across LLMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2025verificationguided,
  title  = {Verification-Guided Context Optimization for Tool Calling via Hierarchical LLMs-as-Editors},
  author = {Henger Li and Shuangjie You and Flavio Di Palo and Yiyue Qian and Ayush Jain},
  year   = {2025},
  eprint = {2512.13860},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.13860v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.13860.svg)](https://codeofpaper.com/paper/2512.13860)

Discussion