A tool call fine-tuning recipe isn't the same job as a general LLM fine-tuning recipe, even though both start from the same base model and the same LoRA config. The failure mode you're training against is specific: a model that calls a tool when none fits, fills a parameter with the wrong type, or loses track of which argument came from which turn three messages back. Two published fixes close most of that gap without a bigger base model: a dataset built from positive, negative, and multi-turn examples, and masking the function names the model would otherwise just memorize. If you haven't settled on a base model, method, or framework yet, start with how to fine-tune LLMs in 2026 first; this post assumes you have, and covers what's different about training for tool calling specifically, the training-side counterpart to serving function calls at inference time and to grading them with BFCL v4 and tau-Bench, which this post comes back to at the end.
TL;DR: Tool Call Fine-Tuning Recipe
Reliable tool calling comes from the dataset, not a bigger model: add negative examples, mask function names, size the GPU to the model.
- Gain: that fix took Deepseek-Coder-7B-Instruct from 17.65 to 79.09 overall on BFCL, a 61.44-point jump.
- Diversity: a 2026 study on dataset diversity found more diverse synthetic tool-calling data gained 3.8-4.2 points over ToolAce- or APIGen-trained baselines on OOD tool use.
- GPU: 8B fine-tunes with LoRA on one RTX 5090 or A100; 70B needs multi-GPU LoRA, or QLoRA on a single H100.
- Spheron: H100 SXM5 runs $2.65/hr on-demand as of 25 Nov 2026. Compare GPU pricing.
Why Prompting Alone Plateaus on Tool-Call Reliability
Prompt engineering can fix a model that doesn't know your schema. It can't fix a model that was never shown what an unanswerable query looks like. That's a training-data gap, not a wording problem, and no amount of system-prompt tuning closes it.
The evidence is in how models actually fail. Open-weight models trade blows with closed APIs on overall BFCL v4 accuracy, within 3-4 points by early-2026 leaderboard numbers, but every model on that board drops 5-10 points specifically on multi-turn tasks relative to single-turn ones, as this blog's BFCL v4 and tau-Bench benchmarking guide lays out (linked again below, with the harness to reproduce it). That's not a prompting gap you can write your way around with a better system message; it's a gap in what the training data ever showed the model about carrying state across turns.
The same mechanism shows up at the dataset level, independent of model scale. Hammer's own framing is direct: fine-tuning a model purely on positive, correct function calls creates "a concerning inverse relationship between the model's ability to accurately execute function calls" and its ability to detect irrelevance. No system prompt telling the model to only call a tool when one is actually needed overrides a training distribution where a tool call was always the answer. The fix has to happen in the data the model was trained on, which is what the rest of this recipe builds.
Building a Function-Calling Dataset: Positive, Negative, and Multi-Turn Examples
A function-calling dataset for fine-tuning needs more categories than a typical instruction-tuning set. Four kinds of examples do most of the work: schema-grounded positive calls, negative and irrelevance examples, multi-turn examples that carry state, and a masking pass that strips the model's ability to shortcut on memorized tool names. Skip any one of them and a specific, predictable failure mode reappears in your eval, usually the exact category BFCL's breakdown is built to catch.
Positive Examples: Schema-Grounded Calls Across Simple, Parallel, and Nested Cases
Positive examples teach the model to produce the right call given the right tool. The cheap mistake is writing only simple, single-function calls: one tool, one obvious argument, one correct answer. Production agents also need parallel calls, where the model has to decide to call two or three tools in the same turn because the task genuinely needs all of them, and nested calls, where an argument's value comes from a prior tool's output rather than from the user's message directly. A dataset skewed toward simple calls will score well on BFCL's single-turn categories and still fail the moment a real agent needs two tools in one turn.
For generating this volume of schema-grounded examples at scale rather than hand-writing them one at a time, Distilabel, Augmentoolkit, and Nemotron-4 pipelines apply directly to function-calling data: template a tool schema, generate a user query that should trigger it, and have a judge model check the call against the schema before it goes into the training set.
Negative and Irrelevance Examples: Teaching the Model to Not Call a Tool
This is the category most hand-built datasets skip entirely, and it's the one the Hammer paper identifies as the actual cause of a specific, measurable failure. Hammer's fix is a concrete augmentation, not a vague instruction to add more negative examples in general. The dataset "incorporates 7,500 examples sampled from the original training set," in which "the correct functions are deliberately excluded from the candidate list, and the labels are replaced with empty lists." The model sees the same style of query, the same schema format, but the one tool that would have answered it is missing, and the correct output is an empty call.
An ablation in the paper found the best mix held irrelevance-augmented data at "approximately 10%" of the total, not more. Past that point, the extra negative examples start trading away the model's accuracy on the calls it actually does need to make. If your fine-tuning dataset is 100% positive examples right now, this is the single highest-leverage fix in the whole recipe, measured directly in the next section.
Multi-Turn Examples: State Across Calls and Mid-Task Corrections
BFCL and tau-Bench results both show the same pattern across models: multi-turn scores drop relative to single-turn ones. tau-Bench's own failure analysis breaks this into three repeating patterns: the model loses track of state after turn 4, overcorrects an entire task when a user issues a small correction like naming the wrong order number and then fixing it, or drifts toward a similarly-named but wrong tool as a conversation gets longer. None of these are inference bugs. They're gaps in what the model was ever shown during training.
A multi-turn-aware dataset needs full conversation traces, not isolated single-turn pairs: a tool's result from turn 2 that's still the right context to use in turn 5, and a user correction mid-task that should change only the affected step rather than restart the whole plan. A dataset with zero multi-turn examples will reproduce this exact degradation on eval no matter how good the single-turn examples are.
Function Masking: Breaking the Model's Reliance on Familiar Tool Names
The last ingredient addresses a quieter failure: models that appear to understand function calling but have actually just memorized common API shapes (get_weather, search_flights, send_email) from the handful of names that keep reappearing across pretraining and fine-tuning data. Swap in an unfamiliar tool name with an unfamiliar schema and accuracy drops, because the model was pattern-matching on the name, not reading the schema.
Hammer's function masking addresses this directly during training. The model can no longer shortcut to the right answer off a familiar name; it has to read the schema's structure and parameter descriptions every time, which is exactly the skill that generalizes to tools it has never seen named before.
Combined with the irrelevance augmentation above, this recipe moved Deepseek-Coder-7B-Instruct from 17.65 to 79.09 overall on BFCL, a 61.44-point gain, and Deepseek-Coder-1.3B-Instruct from 16.81 to 69.71, a 52.90-point gain. Neither change alone explains a jump that size: the negative examples fix irrelevance detection, the masking fixes generalization to new tool names, and together they move the overall score, not just one category. A separate 2026 study on dataset diversity backs the same conclusion from another angle: models fine-tuned on a more linguistically and argumentatively diverse synthetic function-calling set gained "a lift of 4.2 accuracy points over the ToolAce model on the APIGen test set," and "a 3.8 accuracy points lift over the APIGen model on the ToolAce test set," on out-of-distribution tool-calling evaluation. The gains in this recipe come from what's in the dataset, not from scaling up the base model.
GPU Sizing for the Tool Call Fine-Tuning Recipe, by Model Size
None of the dataset work above changes the VRAM math for fine-tuning. A function-calling SFT job with a well-built positive, negative, multi-turn, and masked dataset still sizes the way any other LoRA or QLoRA job does, by model size and sequence length, not by what the examples contain. The GPU VRAM requirements guide has the full memory tables; this section maps model size straight to a GPU tier for this specific job.
| Model size | Method | Minimum GPU | Spheron on-demand |
|---|---|---|---|
| 7B-8B | LoRA or QLoRA | RTX 5090 (32GB) or A100 80GB | $0.84/hr or $1.43/hr |
| 13B-32B | LoRA | H100 80GB | $2.65/hr |
| 70B | QLoRA (1 GPU) or LoRA (2x GPU) | H100 80GB for QLoRA, 2x H100 SXM5 for LoRA | $2.65/hr per GPU |
Spheron's own catalog covers every tier this table needs in one place, from the RTX 5090 for 7B-8B jobs up to multi-GPU H100 for 70B LoRA, billed per minute after a 20-minute minimum, with spot rates available on most SKUs for a run that can tolerate a checkpointed restart. And if your sizing lands on full fine-tuning across dozens of GPUs rather than LoRA or QLoRA on one or two, that tier isn't on the public pricing page; it's a sales conversation, same as with most providers at that scale.
Pricing fluctuates based on GPU availability. Spheron rates above are live as of 25 Nov 2026; other providers reflect their most recent published rates and may have changed. Check current GPU pricing → for live rates.
If you're iterating across several QLoRA passes on spot to tune the negative-example ratio, attach a persistent volume before you launch and checkpoint often. In one spot training run, a node with no volume and no checkpoints was reclaimed at step 956, 17 minutes in, and the $10.22 it had cost bought nothing resumable, because that provider's spot nodes can't have a volume added after launch. A second node with a 100GB network volume checkpointed every 500 steps in about 55 seconds each, which caps the worst case at redoing 500 steps instead of the whole pass.
7B-8B LoRA/QLoRA: Single Consumer or Data-Center GPU
A 7B-8B function-calling fine-tune, even with the full positive, negative, multi-turn, and masked mix, fits comfortably on a single RTX 5090 or A100 80GB. LoRA at rank 64 on an 8B base needs roughly 20GB; QLoRA needs under 10GB. The extra categories in the dataset add training steps, not VRAM per step, since VRAM scales with model size, batch size, and sequence length, not with how many distinct example types are in the set. The RTX 5090 is the cheapest entry point for this tier, and the right one if you're iterating on dataset mix ratios before committing to a longer run.
13B-32B: LoRA on One H100-Class GPU
At 13B-32B, LoRA's footprint (base weights plus adapter gradients and optimizer states) climbs to roughly 35-76GB depending on exact size, which pushes you off the RTX 5090 and onto an 80GB-class GPU. A single H100 80GB, PCIe or SXM5, is the minimum for the top of this tier, not a comfortable fit: 32B LoRA runs close to 76GB by itself, before the longer multi-turn conversation traces in this recipe's dataset, which run longer sequence lengths than single-turn examples, push the activation-memory budget past what a batch-1 VRAM table assumes. Enable gradient checkpointing at this size, or move up to the RTX PRO 6000 (96GB) if you want real headroom instead of a tight one.
70B: Multi-GPU LoRA, and Why QLoRA on One H100 Is the Practical Default
70B is where the recipe's extra dataset categories start to matter for a different reason: cost, not VRAM. LoRA on a 70B model needs a minimum of 2x H100 SXM5, because the frozen base model alone takes 140GB in BF16, more than one H100 can hold. QLoRA quantizes that same base to 4-bit and fits the whole job, adapters included, on a single H100 80GB at roughly 52GB peak. For a function-calling recipe where you're likely to run several training passes while tuning the negative-example ratio and checking category-level BFCL scores, QLoRA's single-GPU footprint is the practical default: it's the difference between iterating on one GPU and coordinating a 2-GPU FSDP job every time you want to test a new mix ratio.
Our Own LoRA Run: H100 vs A100 Wall-Clock and Cost on an 8B Model
The GPU-choice math for an 8B fine-tune doesn't depend on which examples are in the dataset. It depends on step count, sequence length, and which GPU and region you rent, which makes it measurable on a general instruction set and just as applicable to a function-calling SFT run of the same size. As of November 2026, we ran a one-epoch LoRA fine-tune of Llama 3.1 8B with Unsloth (rank 16, 3,235 steps, on a general-purpose alpaca-cleaned set as the timing proxy, not this post's function-calling mix) on a single H100 80GB PCIe and a single A100 80GB PCIe in Spheron's Montreal 1 region. (See Axolotl vs Unsloth vs TorchTune if you haven't picked a framework yet.)
The H100 finished in 25:18 against 47:19 on the A100, a 1.87x speedup (6,639 vs 3,550 tokens per second), with both GPUs peaking at the same 17.2GB VRAM. But setup-to-saved-adapter cost $1.87 on the H100 and $1.43 on the A100, because the H100 cost 2.38x more per hour in that region. The faster GPU was about 30% more expensive for the same finished adapter, and both runs ended at the same loss, 0.879.
That tradeoff isn't fixed; it moves with regional pricing. At Spheron's Canada 1 region rates the same day, the same two runs would have cost $1.18 on the H100 and $1.17 on the A100, close enough to call a tie. The rule that generalizes: divide the two GPUs' hourly rates against each other, then time a short slice of your actual job on both before committing to a region or a GPU. A 200-step slice of this run (97.6 seconds on the H100, 176.4 seconds on the A100, a 1.81x gap) predicted the full run's 1.87x speedup within 4%, so you don't need to run the whole job twice to make the call, just enough steps to see which ratio you're actually getting.
Pricing fluctuates based on GPU availability. The worked example above is frozen at Spheron rates recorded on 7 November 2026 and is not a live quote. Check current GPU pricing for live rates before budgeting a run.
Measuring the Gain Against BFCL Before You Ship It
A fine-tuning run that doesn't move the needle on a held-out benchmark isn't worth shipping, no matter how good the training loss curve looks. The BFCL v4 and tau-Bench guide covers the self-hosted harness setup in full; this section is about what to check specifically after a tool-calling fine-tune.
Held-Out Test Split and Category Breakdown
Run your fine-tuned model against BFCL v4's full category breakdown, not just the overall score: simple, multiple function, parallel, parallel multiple, and the hallucination and relevance-detection category specifically, which is the one Hammer's negative-example augmentation targets. If overall score improves but the relevance-detection category doesn't move, your negative examples weren't enough or weren't representative of the irrelevant queries your agent will actually see in production. A gain concentrated entirely in the simple and multiple categories while relevance detection stays flat is the specific signature of a positive-only dataset, even one that's otherwise well-built.
Hold out a genuine test split before you start, not just the last few rows of your training file. Function-calling datasets built from a small number of API templates tend to cluster near-duplicates across many examples (the same tool, slightly reworded query), and a held-out split drawn from those same templates will overstate how well the model generalizes.
Checking You Didn't Just Overfit Tool Names
The function masking in the dataset is meant to stop the model from pattern-matching on familiar tool names during training. The way to check it worked is to run the same held-out eval against new tool names and schemas the model has never seen in any form, masked or not, and confirm the accuracy gap between familiar and unfamiliar tool names is small. A model that scores well on BFCL's standard categories but drops sharply when you swap get_weather for a renamed, restructured equivalent schema has learned the names, not the skill.
If your evaluation set reuses the same handful of tool schemas as your training set, just with different user phrasing, you're measuring memorization, not the generalization this recipe is built to produce. Build or borrow an eval set with tools your fine-tuning run never saw, and treat the gap between that score and your training-distribution score as the real measure of whether the recipe worked.
The QLoRA default for a 70B tool-calling fine-tune in this recipe runs on a single GPU, not a cluster, which is the tier Spheron's on-demand catalog is built for.
Frequently Asked Questions
[The Hammer paper's ablation](https://arxiv.org/html/2410.04587v2) found the best mix held irrelevance-augmented examples at approximately 10% of the total training set. Below that share the model under-detects irrelevant queries; push it much higher and accuracy on the calls the model does need to make starts to drop.
Yes, if the training data is all positive examples. The documented fix is adding negative examples where no provided function matches the query and the correct label is an empty call.
It sizes the same as any other LoRA or QLoRA job: an RTX 5090 or A100 for 7B-8B, a single H100 80GB for 13B-32B LoRA, and either QLoRA on one H100 80GB or LoRA on 2x H100 SXM5 for 70B. Spheron's H100 runs $2.65/hr on-demand as of 25 Nov 2026; see current GPU pricing for the full catalog.
Function masking replaces function and parameter names in the training candidates with randomly generated strings and randomizes default parameter values, so the model has to read the schema's structure instead of pattern-matching on familiar API names like get_weather or send_email. It is what lets the gains from fine-tuning generalize to tools the model has never seen named before.







