Interestana
Home/News/Fine-Tuning LLMs for Tool-Calling With XYZ-Aquila-SFT and Qwen3
MarkTechPost4 min read

By Interestana AI Editorial — AI-drafted, human-overseen. How we report

Fine-Tuning LLMs for Tool-Calling With XYZ-Aquila-SFT and Qwen3

A comprehensive tutorial has been released detailing an end-to-end supervised fine-tuning (SFT) pipeline designed to enable large language models (LLMs) to effectively call external tools. This process leverages the XYZ-Aquila-SFT dataset, the Hugging Face Transformers library, PyTorch, and the Parameter-Efficient Fine-Tuning (PEFT) library. The pipeline guides users through streaming and inspecting the dataset, parsing multi-turn tool-use trajectories, and extracting structured tool calls. It also covers the analysis of corpus characteristics, ensuring the preservation of embedded reasoning and observation patterns crucial for effective tool utilization.

The tutorial further elaborates on converting tool schemas between message-embedded and structured formats, a critical step for interoperability. It demonstrates how to render Qwen-compatible ChatML, specifically employing assistant-only loss masking to focus the training on generating appropriate tool calls. The process involves preparing a custom PyTorch dataset and collator, tailored for efficient training. The core of the fine-tuning process utilizes the Qwen3-0.6B model, a relatively small but capable LLM, with the LoRA (Low-Rank Adaptation) technique for parameter-efficient fine-tuning.

Key configuration parameters for the fine-tuning process are outlined, including the repository for the dataset (XYZAILab/XYZ-Aquila-SFT), the language (English), the number of samples to stream (400), and the number of evaluation samples (40). The model ID specified is "Qwen/Qwen3-0.6B", with a maximum sequence length of 2048 tokens and a length policy set to "truncate". The training run is enabled, with a maximum of 30 training steps and a gradient accumulation setting of 8. The learning rate is set to 1e-4, LoRA's rank (r) is 16, and the evaluation run is also enabled, with 24 evaluation probes. The output directory is specified as "/content/aquila_out", and the random seed is set to 0 for reproducibility.

Before and after the fine-tuning process, the tutorial emphasizes evaluating tool-call prediction accuracy. This evaluation is vital for quantifying the improvement gained from the SFT pipeline. Finally, the process concludes with exporting both the transformed dataset and corpus statistics. These exported assets are intended to facilitate further experimentation and research into LLM tool-calling capabilities. The tutorial also notes the device used for computation, defaulting to CUDA if available and supporting BF16 precision, and prints the PyTorch version.

Original source — read the full reporting at the publisher:

Read on MarkTechPost

Get the weekly AI digest

AI news + new model releases, weekly. Drafted by our agents, reviewed by humans.

Read next