Learning Library

← Back to Library

Fine-Tuning Agentic AI Systems

Key Points

  • Fine‑tuning is presented as the next step to improve the performance, reliability, and domain alignment of agentic AI systems that combine large language models with specialized toolkits.
  • Current agent designs suffer from token‑inefficient, heavyweight prompts, high execution costs, and error‑propagation across multi‑step tasks, leading to poor decision‑making and increased failure rates.
  • Without deep, domain‑specific knowledge, agents may misuse tools or make decisions misaligned with organizational goals, highlighting the need for tighter integration between the language model and its toolkit.
  • Effective fine‑tuning requires a structured data‑collection strategy that separates tool‑specific usage data from general reasoning, planning, and decision‑making examples to systematically address these shortcomings.

Full Transcript

# Fine-Tuning Agentic AI Systems **Source:** [https://www.youtube.com/watch?v=aQuCTWhiiPg](https://www.youtube.com/watch?v=aQuCTWhiiPg) **Duration:** 00:09:13 ## Summary - Fine‑tuning is presented as the next step to improve the performance, reliability, and domain alignment of agentic AI systems that combine large language models with specialized toolkits. - Current agent designs suffer from token‑inefficient, heavyweight prompts, high execution costs, and error‑propagation across multi‑step tasks, leading to poor decision‑making and increased failure rates. - Without deep, domain‑specific knowledge, agents may misuse tools or make decisions misaligned with organizational goals, highlighting the need for tighter integration between the language model and its toolkit. - Effective fine‑tuning requires a structured data‑collection strategy that separates tool‑specific usage data from general reasoning, planning, and decision‑making examples to systematically address these shortcomings. ## Sections - [00:00:00](https://www.youtube.com/watch?v=aQuCTWhiiPg&t=0s) **Fine‑Tuning Agentic AI Systems** - The segment explains the need to fine‑tune autonomous AI agents to overcome current design limitations, align tool use with organizational goals, and provides practical data‑collection strategies for effective model customization. - [00:03:14](https://www.youtube.com/watch?v=aQuCTWhiiPg&t=194s) **Fine‑Tuning Agents with Tool Data** - The speaker outlines how early mistakes can cascade into agent failures and recommends collecting two types of training data—tool‑specific examples that teach when and how to invoke each tool, and general reasoning/decision‑making samples—to fine‑tune models for more effective, domain‑aligned decisions. - [00:06:24](https://www.youtube.com/watch?v=aQuCTWhiiPg&t=384s) **Iterative Policy Alignment via Data** - The speaker outlines how to align an AI agent with organizational policies by leveraging documentation, case studies, execution trace analysis, role‑specific data, and iterative fine‑tuning to improve decision‑making. ## Full Transcript
0:00So you have built an agentic AI system, 0:02but you're looking to boost its performance and reliability. 0:06Today, we'll explore how model fine tuning can be your next step in supercharging your AI agents capabilities. 0:14In this video, we'll explore key considerations for customizing your models 0:19within your agentic system of different levels of autonomy. 0:24We will discuss the shortcomings of current system designs 0:28and how we can systematically address these challenges through fine tuning. 0:34And most importantly, we will focus on practical design tips for data collection that can enable effective fine tuning. 0:43Keep in mind that this is a continuously evolving field with a changing terminology. 0:50First, why agentic systems? 0:52Agentic systems are purpose built to address complex multi-step problems that require degrees of autonomy and creativity. 1:06This allows the systems to adapt and make context aware decision making. 1:15What grounds this approach is the use of the toolkit. 1:22The unique blend of large language models generalization capabilities with domain alignment of the toolkit, 1:34allows agenetic systems to tackle the problems where traditional automation falls short. 1:42However, this flexibility comes with the trade off. 1:44Without the deep domain specific knowledge your large language model may fail to use the tools correctly. 1:52Furthermore, it might make decisions that are not aligned with your organization's unique objectives and constraints. 2:01This calls for the deeper integration between the large language model and the toolkit. 2:05So what are the key limitations of the current designs? 2:09First one is high token and efficiency. 2:12Instead of using tokens to solve your problem, you use token heavy prompt that agents require just for the setup. 2:23Limiting the number of tokens the agent can use for execution actually making the decision and trying to solve your problem. 2:33Furthermore, it draws the focus away from the problem that you're trying to solve. 2:40Second one is the high cost of the execution. 2:45Every time you're running your agent, you're embedding the same amount of token, 2:53which has computational overhead and results in higher costs. 3:00And the most important problem that with agentic systems, 3:04since they are working with multi step complex problems, there is an issue of error propagation. 3:14So if the agent makes incorrect decision 3:19in the beginning of the execution, trace all the following decisions might not lead to the correct answer, 3:26which can lead to the agent's fail rate go up and agents stuck in the feedback loops and not achieving the task successfully. 3:36So over time you're running into the higher cost 3:40just because your model has a shallow understanding that doesn't allow it 3:46to make more effective domain aligned decisions. 3:50If fine tuning can address this challenges, how should we approach data collection? 3:55Well, let's split this conversation into two parts. 3:59One, we're going to talk about the tool specific data, 4:02and another one is going to be general reasoning, decision making or planning capabilities. 4:09So for the tool collection, the most important thing to explain to the model 4:15is when to use the tool, how to call it, and what to do with the output. 4:20So for the first part, you're trying to explain the context. 4:24Let's say you have two very similar tools for search, but they have different context where they should be applied. 4:33Focus on creating the examples that highlight these differences, 4:38annotated with explanations, and try to provide the model with as much information as possible. 4:46How to use the tool, 4:48Is the opportunity to teach the model how to properly configure the core parameters that at all. 4:56Where should this reasoning come from 4:59and how to use the tool effectively to achieve the specific task that the model is trying to solve, 5:07and what to do with the output is defining the expectations for the model. 5:11For example, is the tool that go trying to use deterministic, can you trust the output? 5:17Do we have to do any of the post-processing when you get the output from the tool? 5:23One thing that I would like to focus on is write tools specifically. 5:29Write tools are the tools that modify your environment. 5:32So make sure to be extra careful when you provide the guidelines for those tools. 5:39As a general approach, we reserve to fine tune it here, because we want to show the full range of capabilities. 5:47So focus on the edge cases and make sure 5:51to provide annotations to your model so it can reason better about each of the tool use steps. 5:59This is especially important if you are building your agentic workflow 6:04using custom tools that model may not reason well about by default. 6:11Building on the principles that we use for data collection for more effective tool use, 6:16we can talk about how we can enhance models, reasoning, planning and decision making capabilities. 6:24First, we should treat this as an opportunity to get the model aligned with your organization's specific policies and objectives. 6:33You can do that through the use of documentation. 6:36If you structure and use that as a training data, 6:39this will give the model a great background to rely on when making the decisions. 6:46Furthermore, you can use case studies and showcase how the decisions are made within their organizations. 6:52Which policies in which scenarios are being consulted? 6:56So the model has this understanding when it is trying to make decisions on its own. 7:02And most importantly, since your agent is already running, you can collect, analyze the execution traces. 7:11Then you can help the model with annotating successful and unsuccessful decisions, 7:18explaining why in certain scenarios it is more beneficial to proceed one route over the other one. 7:26Additionally, if your system has any role specific components, for example, you have judges, validators or optimizers, 7:37you can collect raw specific data and improve the robustness of your system 7:42by highlighting how these decisions should be made, 7:47when these decisions are made within the context of the specific role. 7:51As with any AI system, agentic system thrive 7:55on iterative improvement by collecting, analyzing 7:58and inspecting your execution data, you can find the failure modes of your AI system. 8:05These lessons can be incorporated either into your prompt and techniques, 8:09but also these failure modes could be a great source for fine tuning data. 8:14As with all the fine tuning data that you're going to collect, 8:18whether it's going to be regarding the tool use or the general decision making capabilities of the model, 8:24make sure to provide very detailed annotations. 8:27You can use React or other structured reasoning frameworks 8:32to help model process this annotations and become more effective, robust and reliable. 8:41Remember, the ultimate goal of fine tuning is creating a system that is more aligned with your unique challenge. 8:51It comes with additional benefits as reducing cost and making the system more efficient, 8:57but most importantly, it transforms your agentic system from a novel solution to a trusted and reliable partner. 9:04Applying techniques that we discussed today for data collection 9:08can hopefully help you customize your agentic workflow better.