Self-Training Large Language Models for Tool-Use Without Demonstrations

Ne Luo, Aryo Pradipta Gema, Xuanli He, Emile van Krieken, Pietro Lesci, Pasquale Minervini

Abstract

Large language models (LLMs) remain prone to factual inaccuracies and computational errors, including hallucinations and mistakes in mathematical reasoning. Recent work augmented LLMs with tools to mitigate these shortcomings, but often requires curated gold tool-use demonstrations. In this paper, we investigate whether LLMs can learn to use tools without demonstrations. First, we analyse zero-shot prompting strategies to guide LLMs in tool utilisation. Second, we propose a self-training method to synthesise tool-use traces using the LLM itself. We compare supervised fine-tuning and preference fine-tuning techniques for fine-tuning the model on datasets constructed using existing Question Answering (QA) datasets, i.e., TriviaQA and GSM8K. Experiments show that tool-use enhances performance on a long-tail knowledge task: 3.7% on PopQA, which is used solely for evaluation, but leads to mixed results on other datasets, i.e., TriviaQA, GSM8K, and NQ-Open. Our findings highlight the potential and challenges of integrating external tools into LLMs without demonstrations.

Introduction

Teaching Large Language Models (LLMs) to use external tools like calculators or search engines typically requires expensive, human-curated "gold" demonstrations. Often, researchers rely on distilling these traces from massive proprietary models like GPT-4. This study explores a more autonomous alternative: can we teach open-weights LLMs to use tools entirely through self-training, without any oracle demonstrations?

Methodology

The proposed self-training pipeline leverages the inherent instruction-following capabilities of models like Llama-3-8B-Instruct. The process consists of three primary stages:

  1. Zero-Shot Prompting: The model is provided with a system prompt describing available tools (Calculator, Wikipedia Search, Machine Translator) and a required output format (Thought, Action, Rationale, Answer). No few-shot examples are given.
  2. Data Generation & Filtering: The LLM attempts to solve questions from TriviaQA and GSM8K. If the final answer is correct, the intermediate tool-use trace is considered valid and saved into a synthetic dataset.
  3. Model Training: The model is fine-tuned on this synthetic data using two approaches: Supervised Fine-Tuning (SFT) on either pure tool data or a mixture of tool and no-tool data, and Preference Fine-Tuning (PFT) via Direct Preference Optimization (DPO).
The proposed self-training pipeline for tool-use, moving from zero-shot prompting to synthetic data generation and model training.

Experimental Setup

The models were trained on synthetic traces generated from subsets of TriviaQA and GSM8K. Evaluation was conducted across four benchmarks: the training sets (TriviaQA, GSM8K) and two held-out sets to test generalization—NQ-Open (real-world search queries) and PopQA (long-tail, obscure entities).

Key Results and Insights

The "How" vs. "When" Dilemma

Zero-shot prompting demonstrates that modern LLMs can understand tool syntax without examples. However, they struggle with when to invoke them. Models often use tools unnecessarily, leading to errors from irrelevant search results or formatting mistakes. For instance, on TriviaQA, simply prompting the model to use tools dropped accuracy from 77.9% to 75.8%.

The Importance of Data Mixtures

Training exclusively on successful tool-use traces (SFT tools data) proved detrimental, as it taught the model to always use tools, even for facts it already knew. This "over-reliance" tanked performance on general knowledge tasks. However, SFT on a mixture of tool and no-tool data successfully recovered performance, highlighting that models must learn to discern when tools are actually needed.

Performance comparison across various systems and datasets, showing the impact of SFT and DPO on accuracy and exact match (EM) metrics.

Success in the Long-Tail

The most significant gains were observed in PopQA, which focuses on obscure facts likely missing from the model's parametric memory. The SFT model trained on mixed data achieved a 3.7% accuracy improvement (35.3%) over the no-tool baseline (31.6%). This suggests that self-trained tool use is most effective at the edges of a model's knowledge distribution.

Challenges in Preference Tuning

Applying DPO to multi-turn tool-use conversations yielded mixed results. Because the DPO loss is calculated over the entire conversation—including noisy tool outputs—it can be less stable than standard SFT. Optimizing only the model's final response proved more effective than optimizing the entire multi-turn trace.

Conclusion

This research demonstrates that LLMs can indeed learn to use tools without human demonstrations through self-training. While over-reliance remains a challenge on common knowledge tasks, the approach provides a clear path for improving model performance on long-tail knowledge and complex reasoning without the need for expensive manual data curation.

Summary updated

BibTeX
@inproceedings{luo2025self,
  author = {Ne Luo and Aryo Pradipta Gema and Xuanli He and Emile van Krieken and Pietro Lesci and Pasquale Minervini},
  title = {{Self-Training Large Language Models for Tool-Use Without Demonstrations}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.69},
}
Figure