arXiv(opens in a new tab)cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.35981

Small agents should know what their tools do

Alexander Kovalenko, Artem Redchych

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Small open language models can call tools, but they do not reason about what a call does: they delete without asking, repeat writes, re-read state they already hold, and issue one call per turn where a short program would do. We introduce EffectWorld, an executable world of effect-typed tools in which every tool declares its effect (pure, read, write or destructive), whether it is idempotent, and which resources it reads and writes. These declarations let a replay verifier decide whether a trace is effect-safe without labels or judge models, let an executor run tool programs of several dependent calls in one turn, and let a compiler-style optimizer turn wasteful traces into verified training signal; together they make EffectWorld a benchmark of effect safety and call efficiency. Low-rank adapters trained on EffectWorld data deliver large gains: on Qwen3-4B, supervised fine-tuning (SFT) raises task success from 53% to 99% in distribution, from 52% to 81% on a held-out split with unseen task kinds and distractor tools, and from 74% to 83% on an unseen online-shopping domain, with about a third of the output tokens. The gains carry over to three model families, lifting Qwen3-1.7B, Phi-4-mini and Falcon3-3B from 4–25% to 69–99% in distribution and by 26 to 55 points on the held-out splits. On the Berkeley Function-Calling Leaderboard (BFCL) the adapter matches the base model's live accuracy and raises multi-turn accuracy from 21.9 to 26.6, and a recipe with near-miss declines lifts the BFCL average above the base model's (70.0 against 68.7) while matching its irrelevance detection. Along the way we uncover and fix a pitfall that in-domain evaluation alone would miss: refusal templates in widely used public tool-use corpora teach a small model not to call tools, cutting BFCL non-live accuracy from 88.0 to 31.4, and filtering them restores 84.8. We also find that positive examples, not negative ones, carry the learning: suppression and preference objectives on the verified negatives add nothing over an SFT-only control, while targeted positives move exactly the behaviour they show. Efficiency transfers to unseen tools out of the box; effect discipline does so only partly, and EffectWorld makes that remaining gap measurable for future work.

1 Introduction

A tool-calling agent is efficient when it reaches the intended final state with few calls, few turns and few generated tokens, and safe when it never takes an irreversible action the user has not approved. Public benchmarks such as the Berkeley Function-Calling Leaderboard (BFCL) mostly score whether a call is well formed (Patil et al., 2024, 2025). They say little about whether an agent re-reads data it already has, serialises independent look-ups, or cancels a meeting without asking. Tool protocols already annotate tools as read-only, destructive or idempotent (Anthropic, 2024; Model Context Protocol contributors, 2025), yet small open models are not trained to act on such annotations, and, as we found in our own first adapters, the annotations often never reach the model at all. The idea is older than agents: type-and-effect systems let a compiler reason about what a piece of code may read or write (Lucassen and Gifford, 1988); we borrow it for tool calls.

∗^{*}Corresponding author.

PREPRINT

We make tool effects first-class during data generation, training and evaluation. We build EffectWorld, an executable tool world with a replay verifier, in which each tool carries an effect type, an idempotence flag and a footprint: the resources it reads and writes, templated by its arguments. Effects let us state policies precisely, for example “confirm before any destructive call” and “never repeat a non-idempotent write”. Footprints let a trace optimizer decide which calls can be removed, merged or reordered without changing the outcome. The optimizer in turn converts every inefficient trace into labelled negative examples.

Negative examples for tool agents are usually mined from model failures or produced by ad-hoc perturbation. Ours differ in one respect: an efficiency negative is a call the optimizer has shown to be unnecessary, because replaying the trace without it reaches the same final state with no new errors. We combine these with rule-based correctness and policy negatives and train adapters to suppress the bad action at the exact prefix where it occurs, keeping the span-localised recipe of LUNE (Liu et al., 2025), which trains only low-rank adapters (LoRA) on negative examples, but replacing its objective with suppression by unlikelihood training (UL; Welleck et al., 2020) or negative preference optimisation (NPO; Zhang et al., 2024a), since for an agent the negative target is an action that must not be produced.

We make five contributions.

  1. EffectWorld, an effect-typed executable tool world with a replay verifier, a scripted user, a training domain and two test-only splits: a hard split with unseen task kinds and distractor tools, and an online-shopping (commerce) domain whose tools never appear in training ( §§3.1−3.4\S\S3.1-3.4).

  2. Tool programs: a minimal $ref convention that lets one assistant turn express a dependency graph of calls inside native tool-call blocks, so existing parsers and benchmarks keep working (§3.2).

  3. A compiler-style trace optimizer with footprint-based legality, and a taxonomy of 19 negative classes derived from its diffs, from rule perturbations and from policy checks, each mapped to the BFCL categories it should affect ( §\S3.5).

  4. A controlled comparison of two suppression objectives (UL, NPO) against direct preference optimisation (DPO) and a supervised fine-tuning (SFT) control, all continued from the same SFT adapter. With correctly localised and scaled objectives none of them beats the control on any held-out split, and we document the three loss-scaling defects that made a first round fail silently ( §\S4.1, §\S5.6).

  5. Two findings about data. Refusal templates in public tool-use data collapse a small model’s willingness to call tools on BFCL while in-domain metrics look perfect, and filtering them fixes it ( §6.1\S6.1). Positives transfer along their cue rather than their label: declining when a tool is absent does not teach declining an off-topic request, declines that show the right cue restore BFCL irrelevance detection at a cost in confirmation, and effect annotations in the schema move confirmation on unseen tools only a little. The pattern holds across three model families ( §§5.7−5.8\S\S5.7-5.8).

References (80)