Code Velocity
Alati za programere

SageMaker AI: Ubrzavanje pozivanja agentskih alata sa serverless prilagođavanjem modela

·5 min čitanja·AWS·Originalni izvor
Podeli
Interfejs Amazon SageMaker AI Studio koji prikazuje opcije za serverless prilagođavanje modela i pozivanje agentskih alata.
{
  "prompt": [
    {"role": "system", "content": "You are a helpful assistant. When using tools, respond with: [...]"},
    {"role": "user", "content": "Get the weather"}
  ],
  "reward_model": {
    "ground_truth": "To provide you with the weather information, could you please specify the location?"
  }
}

Fino podešavanje Qwen 2.5 7B Instruct modela sa SageMaker AI

Proces finog podešavanja modela kao što je Qwen 2.5 7B Instruct unutar Amazon SageMaker AI Studija je pojednostavljen i intuitivan. Nakon što se uvere da su ispunjeni neophodni preduslovi (AWS nalog, IAM uloga, SageMaker AI domen, S3 bucket), korisnici mogu da odu na odeljak Models u SageMaker AI Studiju.

Odatle, odabir Qwen 2.5 7B Instruct i izbor Customize with UI otvara posvećenu stranicu za konfiguraciju. Ovaj interfejs omogućava:

  • Odabir tehnike: Eksplicitno odabir Učenja potkrepljivanjem sa proverljivim nagradama (RLVR) iz padajućeg menija.
  • Unos podataka: Pokazivanje na pripremljene podatke za obuku pohranjene u Amazon S3 bucket-u.
  • Funkcija nagrađivanja: Konfigurisanje mehanizma za ocenjivanje na više nivoa koji definiše kako se kandidatski odgovori ocenjuju u odnosu na ground_truth.
  • Konfiguracija hiperparametara: Podešavanje parametara kao što je veličina batch-a, mada SageMaker AI često automatski upravlja optimalnim postavkama.

SageMaker AI podržava raznolik spektar familija modela, uključujući Amazon Nova, GPT-OSS, Llama, Qwen i DeepSeek, pored različitih tehnika kao što su Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), RLVR i Reinforcement Learning from AI Feedback (RLAIF). Integrisano MLflow praćenje pruža uvid u metrike obuke i validacije, pojednostavljujući praćenje performansi i iteraciju. Ova jednostavnost korišćenja dramatično ubrzava životni ciklus razvoja za programere koji grade sofisticirane github-agentske-radne-tokove.

Evaluacija i uspeh implementacije

Efikasnost našeg fino podešenog Qwen 2.5 7B Instruct modela je rigorozno evaluirana na zadržanim podacima, uključujući scenarije sa potpuno neviđenim alatima—što je ključan test za generalizaciju. Rezultati su bili ubedljivi: fino podešeni model je postigao izvanredno poboljšanje od 57% u nagradi za poziv alata u poređenju sa baznim modelom. Ovaj značajan skok u performansama u scenarijima koje nije susreo tokom obuke naglašava moć RLVR-a u podučavanju modela robusnim sposobnostima donošenja odluka za interakciju sa alatima.

Ova poboljšana pouzdanost direktno se prevodi u veće poverenje i sigurnost u implementaciju AI agenata u proizvodna okruženja. Minimiziranjem slučajeva haluciniranja alata, netačnih parametara i neprikladnih radnji, preduzeća mogu iskoristiti AI agente za kritičnije i osetljivije zadatke. Sa SageMaker AI koji upravlja složenošću implementacije modela i upravljanja infrastrukturom, programeri mogu bez problema preći sa finog podešavanja na produkciju, ostvarujući pun potencijal svojih agentskih AI rešenja. Ova sposobnost se usklađuje sa širom vizijom operacionalizacije agentske AI za uticaj u stvarnom svetu.

Ukratko, kombinacija serverless prilagođavanja modela Amazon SageMaker AI-a i robusnih mogućnosti učenja RLVR-a pruža moćan put ka izgradnji izuzetno pouzdanih sistema pozivanja agentskih alata. Ovaj inovativni pristup ubrzava razvoj, smanjuje operativni teret i konačno isporučuje AI agente koji rade sa neviđenom preciznošću i pouzdanošću.

Često postavljana pitanja

What is agentic tool calling and why is it crucial for AI agents?
Agentic tool calling is the mechanism that empowers AI agents to perform real-world actions like querying databases, initiating workflows, fetching real-time information, and executing tasks on a user's behalf. It's crucial because it bridges the gap between language understanding and practical application, allowing AI agents to move beyond just generating text to actually interacting with external systems and data sources, thereby making them genuinely useful in production environments.
What are the common challenges AI agents face when performing tool calls?
AI agents frequently encounter challenges such as hallucinating tools that don't exist, passing incorrect parameters to valid tools, or attempting actions when they should instead seek clarification from the user. These failures lead to unreliable agent behavior, eroding user trust and posing significant hurdles to the successful deployment of AI agents in critical production systems, ultimately limiting their real-world utility.
How does Amazon SageMaker AI address the challenges of agentic tool calling?
Amazon SageMaker AI addresses these challenges through its serverless model customization capabilities, particularly using Reinforcement Learning with Verifiable Rewards (RLVR). This approach allows developers to fine-tune large language models (LLMs) to improve their tool-calling accuracy without managing complex infrastructure. SageMaker AI handles the operational overhead of GPU provisioning, memory management, and reward infrastructure, letting users focus on data, reward functions, and model behavior.
What is Reinforcement Learning with Verifiable Rewards (RLVR) and how does it work?
RLVR is a powerful fine-tuning technique where the model generates multiple candidate responses for a given prompt. A predefined reward function then evaluates these candidates, providing a signal about their quality and correctness. The model subsequently updates its internal policy to favor responses that received higher reward scores, using methods like Group Relative Policy Optimization (GRPO), thereby iteratively learning to produce more accurate and desired outputs for specific tasks like tool calling.
Why is RLVR considered more effective than Supervised Fine-Tuning (SFT) for tool calling tasks?
While SFT requires meticulously labeled examples for every desired behavior (e.g., calling a tool, clarifying, refusing), RLVR operates differently. SFT can struggle to generalize decision-making between these behaviors. RLVR, by contrast, allows the model to learn the optimal decision boundary by generating multiple candidates and receiving immediate feedback via a reward function, enabling it to better understand *when* to execute a tool call versus *when* to ask for more information or refuse a request.
How is training data prepared for RLVR in Amazon SageMaker AI for agentic tool calling?
Training data for RLVR in SageMaker AI is prepared as JSONL files, where each entry contains a prompt (system and user messages) and a `ground_truth` within a `reward_model` field. This `ground_truth` is what the reward function scores against. To ensure robust agent behavior, datasets are typically designed to cover three distinct scenarios: executing a tool call when all parameters are present, clarifying when information is missing, and refusing requests that are out of scope or harmful. Synthetic data generation tools like Kiro can be used for this purpose.
What agent behaviors are critical for building robust and reliable tool-calling AI agents?
Building robust tool-calling AI agents requires them to master three critical behaviors. First, they must `Execute` a tool call accurately when all necessary information is provided by the user. Second, they need to `Clarify` by asking follow-up questions when essential parameters are missing from a user's request. Third, they must `Refuse` gracefully when a request is out of scope, harmful, or cannot be fulfilled. Training models across these behaviors ensures comprehensive and trustworthy agent performance.
What prerequisites are needed to use serverless model customization in SageMaker AI?
To leverage serverless model customization in Amazon SageMaker AI, users must have an active AWS account, an AWS IAM role configured with the necessary permissions for SageMaker, a SageMaker AI domain providing Studio access for development, and an Amazon Simple Storage Service (Amazon S3) bucket to store training data and model outputs securely. These components ensure a secure and functional environment for fine-tuning models.

Будите у току

Примајте најновије AI вести на имејл.

Podeli