Amazon SageMaker AI enables SFT & DPO to boost agent tool-calling accuracy
Fine-tune Qwen3 1.7B with SFT and DPO for reliable multi-step automation
Amazon SageMaker AI now provides a streamlined pipeline for improving AI agent tool-calling accuracy using Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO). The solution is built around Qwen3 1.7B, a small language model (SLM) that can be fine-tuned to autonomously select the correct tools and format parameters for multi-step workflows. SageMaker AI training jobs handle the compute infrastructure, including distributed multi-GPU and multi-node clusters that spin up on demand and shut down automatically when training completes. Metrics from both the infrastructure and training loop are sent to MLflow, allowing developers to compare base models against several fine-tuned variants.
SFT teaches the model tool-specific language and constraints using curated datasets with explicit examples of correct tool calls. DPO then refines those interactions by incorporating human preferences directly into the training loop—using a "chosen” vs. “rejected” response format—without needing separate reward functions or reinforcement learning models. Together, these techniques create a robust framework for building agents that reliably interact with external APIs and databases, reducing error rates, task completion times, and support costs. The post also walks through prerequisites like an AWS account, IAM roles, and SageMaker Studio setup, making it practical for teams moving agentic applications from pilot to production.
- Amazon SageMaker AI training jobs automate infrastructure for fine-tuning Qwen3 1.7B with SFT and DPO.
- DPO uses a 'chosen/rejected' format to optimize tool-calling preferences without reward models, cutting training time.
- MLflow integration tracks model performance metrics, enabling data-driven comparisons between base and fine-tuned models.
Why It Matters
Reliable tool calling is critical for production AI agents—this approach reduces errors and costs at scale.