Automationscribe.com
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automation Scribe
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automationscribe.com
No Result
View All Result

Speed up agentic software calling with serverless mannequin customization in Amazon SageMaker AI

admin by admin
April 7, 2026
in Artificial Intelligence
0
Speed up agentic software calling with serverless mannequin customization in Amazon SageMaker AI
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


Agentic software calling is what makes AI brokers helpful in manufacturing. It’s how they question databases, set off workflows, retrieve real-time information, and act on a consumer’s behalf. However base fashions often hallucinate instruments, go dangerous parameters, and try actions when they need to ask for clarification. These failures erode belief and block manufacturing deployment.

You should use Serverless mannequin customization in Amazon SageMaker AI to repair these issues with out managing infrastructure. With Reinforcement Studying with Verifiable Rewards (RLVR), the mannequin generates its personal candidate responses, receives a reward sign indicating high quality, and updates its habits to favor what works. You choose a mannequin, configure a method, level to your information and reward perform, and SageMaker AI handles the remainder. On this put up, we stroll by means of how we fine-tuned Qwen 2.5 7B Instruct for software calling utilizing RLVR. We cowl dataset preparation throughout three distinct agent behaviors, reward perform design with tiered scoring, coaching configuration and outcomes interpretation, analysis on held-out information with unseen instruments, and deployment. By the tip, our fine-tuned mannequin improved software name reward by 57% over the bottom mannequin on eventualities that it didn’t see throughout coaching.

As a result of software calling has a naturally verifiable goal, whether or not the mannequin known as the proper perform with the proper parameters, it maps properly to RLVR. The problem with self-managed reinforcement studying (RL) is the operational overhead. GPU procurement, reminiscence orchestration between rollout and coaching phases, reward infrastructure, and checkpointing add up shortly. Hyperparameter sensitivity provides one other layer of complexity. SageMaker AI takes on that work so you possibly can focus in your mannequin, your information, and your reward perform.

SageMaker AI helps mannequin households together with Amazon Nova, GPT-OSS, Llama, Qwen, and DeepSeek, with strategies together with Supervised Tremendous-Tuning (SFT), Direct Choice Optimization (DPO), RLVR, and Reinforcement Studying from AI Suggestions (RLAIF). Coaching and validation metrics are tracked by means of built-in MLflow.

Why RLVR for software calling

SFT requires labeled examples of every habits that you really want the mannequin to be taught. For software calling, meaning examples of calling a software, asking for clarification, and refusing. However software calling additionally requires the mannequin to determine between these behaviors, and SFT can wrestle to generalize that decision-making past the precise patterns in its coaching information.

RLVR works in another way. For every immediate, the mannequin generates a number of candidate responses (we use eight). A reward perform verifies which of them are right. The mannequin then updates its coverage to favor what labored, utilizing Group Relative Coverage Optimization (GRPO). GRPO compares every candidate’s reward rating in opposition to the imply rating of the group and reinforces responses that rating above common. Over time, the mannequin learns the format of a software name and when to name in comparison with when to ask.

Conditions

To make use of serverless mannequin customization in SageMaker AI, it’s essential to have the next conditions:

Tremendous-tune Qwen 2.5 7B Instruct in SageMaker AI

To get began, we open Amazon SageMaker AI Studio and select Fashions within the left navigation pane to browse the inspiration fashions (FM) which are accessible for personalisation.

Amazon SageMaker Studio Models page showing featured foundation models from Amazon, Meta, and Qwen with a Customize model dropdown menu expanded, revealing options to Customize with UI, AI Agent (Preview), and Code.

Within the Customise mannequin menu, choose Qwen 2.5 7B Instruct, and select Customise with UI. This opens the customization configuration web page the place you choose your approach, level to your coaching information and reward perform, and configure hyperparameters. We chosen Reinforcement Studying from Verifiable Rewards (RLVR) as our customization approach.

Amazon SageMaker Studio model customization form for Qwen2.5-7B-Instruct showing the Customization technique dropdown with Reinforcement Learning with Verifiable Rewards (RLVR) selected, along with options for reward functions, dataset upload, S3 output location, and batch size.

Put together your coaching information

A software calling dataset wants to show greater than right API invocations. Manufacturing brokers face three distinct conditions:

  1. The consumer supplies sufficient data, and the mannequin ought to name a software.
  2. The consumer’s request is lacking required parameters, and the mannequin ought to ask for clarification.
  3. The request is dangerous or out of scope, and the mannequin ought to refuse.

We generated 1,500 artificial coaching examples from our software schemas (climate, flights, translation, foreign money conversion, statistics) utilizing Kiro, the Amazon AI-powered IDE, to supply prompts with lifelike variation in phrasing and specificity throughout the three behaviors. Right here’s an instance of the immediate we used:

Generate 1,500 JSONL coaching examples for RLVR tool-calling

fine-tuning throughout 5 software schemas: get_weather_forecast,

search_flights, translate_text, currency_convert, and

get_statistics.

Every line should comply with this format:

{"immediate": [{"role": "system", "content": "..."}, {"role": "user", "content": "..."}], "reward_model": {"ground_truth": "..."}}

Distribute examples throughout three behaviors:

1. Execute (60%): Consumer supplies all required params → ground_truth is the software name JSON

2. Make clear (25%): Consumer is lacking required params → ground_truth is a clarifying query

3. Refuse (15%): Request is dangerous or out of scope → ground_truth is a well mannered refusal

Fluctuate phrasing between formal, informal, and terse.

Output legitimate JSONL solely, no commentary.

This can be a sensible path for groups that don’t but have manufacturing logs to attract from. For organizations already operating agentic workflows, actual consumer prompts and power calls from manufacturing will yield even higher-quality coaching information.

Every coaching instance incorporates a immediate (a system instruction and consumer request) and a floor reality within the reward_model discipline that the reward perform scores in opposition to. Listed below are examples of every habits.

Execute when the consumer supplies all the pieces the software wants:

{
  "immediate": [
    {"role": "system", "content": "You are a helpful assistant. When using tools, respond with: [...]"},
    {"function": "consumer", "content material": "Get climate for San Francisco"}
  ],
  "reward_model": {
    "ground_truth": "[{"name": "get_weather_forecast", "arguments": {"city": "San Francisco"}}]"
  }
}

Make clear when a required parameter is lacking:

{
  "immediate": [
    {"role": "system", "content": "You are a helpful assistant. When using tools, respond with: [...]"},
    {"function": "consumer", "content material": "Get the climate"}
  ],
  "reward_model": {
    "ground_truth": "To give you the climate data, might you please specify the situation?"
  }
}

Execute with a number of parameters:

{
  "immediate": [
    {"role": "system", "content": "You are a helpful assistant. When using tools, respond with: [...]"},
    {"function": "consumer", "content material": "Convert 50 EUR to USD"}
  ],
  "reward_model": {
    "ground_truth": "[{"name": "currency_convert", "arguments": {"amount": 50, "from": "EUR", "to": "USD"}}]"
  }
}

Discover the distinction between “Get climate for San Francisco” (software name) and “Get the climate” (clarification). That is the sort of distinction GRPO learns properly. For every immediate, the mannequin generates eight candidates, the reward perform scores them, and the scores are averaged throughout the group. Candidates above the imply get strengthened, and over time the mannequin picks up when to name and when to ask.

Outline your reward perform

The reward perform defines what right means for our use case. We write it as a Python perform that receives the mannequin’s response and the bottom reality from the coaching information and returns a numerical rating. Ours extracts software calls from the mannequin’s response, parses them as JSON, and compares in opposition to the bottom reality.

The total perform handles response extraction, versatile parsing for different codecs throughout early coaching, and edge instances round JSON kind mismatches. Right here is the core scoring logic:

# After extracting and parsing software calls from mannequin response and floor reality:

# Examine software names
pred_names = {software.get('title', '') for software in pred_tools}
gt_names = {software.get('title', '') for software in gt_tools}

if pred_names == gt_names:
    # Proper perform(s) - test if arguments additionally match
    perfect_match = True
    for pred_tool in pred_tools:
        for gt_tool in gt_tools:
            if pred_tool.get('title') == gt_tool.get('title'):
                if pred_tool.get('arguments') != gt_tool.get('arguments'):
                    perfect_match = False
    rating = 1.0 if perfect_match else 0.5
elif pred_names & gt_names:
    # Partial overlap in perform names
    rating = 0.5
else:
    # Flawed perform solely
    rating = 0.0

The three tiers (1.0, 0.5, and 0.0) give GRPO a richer studying sign. If a number of of the eight candidates get the perform proper however miss a parameter, the 0.5 rating distinguishes them from fully mistaken solutions. This helps the mannequin acknowledge that it’s heading in the right direction.

For clarification and refusal instances the place the bottom reality is pure language (no TOOLCALL tags), the reward perform checks whether or not the mannequin additionally prevented calling a software. An pointless API name when the mannequin ought to have requested a query earns 0.0.

Configure and launch coaching

On the customization configuration web page, we level to our coaching dataset and reward perform, then set our hyperparameters. We use a batch dimension of 128, studying fee of 5e-6, 3 epochs, and eight rollouts per immediate.

The rollouts setting is the core GRPO mechanism. For every coaching immediate, the mannequin generates eight totally different responses, the reward perform scores every one, and responses that rating above the group common get strengthened. Coaching and validation metrics are logged to MLflow. On this instance, coaching takes roughly 40 minutes.

Coaching outcomes

Performance dashboard displaying five RLVR training metric charts: Train Reward Statistics trending upward from 0.28 to 0.70, Train Episode Length Distribution fluctuating between 30 and 35, Policy Entropy declining from 0.19 to 0.12, Gradient Norm decreasing from 0.10 to near 0.00, and Mean Advantage Estimate recovering from -0.08 to near 0.00 over 30 training steps. Long description: Screenshot of a dark-themed

Prepare Reward Statistics (high left) is the chart to concentrate on. The imply reward throughout the roll outs began round 0.28 and climbed to 0.65–0.68 over 30 steps, greater than doubling. The steepest positive factors occur within the first 10 steps because the mannequin learns the fundamental software calling format and choice construction. It then flattens after step 20 because it converges.

The opposite charts affirm wholesome coaching:

  • Coverage Entropy decreases, which means the mannequin is getting extra assured slightly than guessing.
  • Gradient Norm stabilizes, which means updates are getting smaller and extra refined.
  • Imply Benefit Estimate converges towards zero, indicating that the mannequin’s coverage is stabilizing and the typical response high quality is aligning with the reward baseline.

Consider the fine-tuned mannequin

After the coaching job is full, you possibly can see the fashions that you simply created within the My Fashions tab. To increase the main points, select View particulars on certainly one of your fashions.

Amazon SageMaker Studio My Models page showing the Logged tab with two fine-tuned model cards: example-name-2lt4op at version v3 and example-name-2lt4o with no versions found, both created 4 days ago with View details buttons.

You may select Proceed customization to iterate additional by adjusting hyperparameters or coaching with a special approach. Select Consider to check your personalized mannequin in opposition to the bottom mannequin.

We consider on a separate check set of 300 examples that have been excluded from coaching. The analysis dataset covers the identical three behaviors however contains instruments, phrasings, and eventualities that the mannequin hasn’t seen. It checks search_restaurants, get_stock_price, and calculate_standard_deviation, none of which appeared throughout coaching. It additionally contains refusal instances for dangerous requests like producing violent content material or creating malware, testing whether or not the mannequin generalizes secure habits to new threats.

The analysis runs normal NLP metrics alongside our customized reward perform in opposition to the held-out set.

Evaluation metrics comparison table showing the custom RLVR-trained model outperforming the base model across all metrics: Rouge1 (65.21% vs 49.48%), Rouge2 (51.45% vs 35.12%), RougeL (59.19% vs 45.78%), Em (21% vs 11%), F1 (56.63% vs 42.19%), F1 Score Quasi (64.60% vs 45.98%), Bleu (100.00 vs 92.58), Tool Call Reward (0.55 vs 0.35), and Aggregate Reward Score (0.55 vs 0.35), evaluated on 300 documents.

Instrument Name Reward is our customized metric and essentially the most direct measure of what we educated for. It jumped from 0.35 to 0.55, a 57% enchancment. In sensible phrases, because of this the fine-tuned mannequin makes the proper software calling choice considerably extra typically. It calls the proper perform with the proper parameters when it ought to, asks for clarification when data is lacking, and refuses when applicable.

F1 Rating Quasi, Rouge1, and RougeL all improved by 14–19 share factors, reflecting higher era of right perform names, parameter keys, and values throughout the board.

Precise Match doubled from 11% to 21%. This metric requires character-for-character output matching, so even small formatting variations rely as a miss. The 21% actual match alongside 64.6% F1 means that the mannequin typically will get the semantics proper even when floor formatting differs barely.

These outcomes are all on held-out information with instruments and eventualities that the mannequin didn’t see throughout coaching. The enhancements carry over to new instruments, which implies the mannequin picked up common software calling patterns slightly than memorizing the coaching set.

Listed below are responses from the fine-tuned mannequin on prompts that it didn’t see throughout coaching:

Instrument execution:

> Immediate: “What’s the inventory worth of AMZN?” > > Mannequin response: [{"name": "get_stock_price", "arguments": {"ticker": "AMZN"}}]

Clarification:

> Immediate: “Discover me a restaurant close by” > > Mannequin response: “I’d be completely happy that can assist you discover a restaurant! May you please present the delicacies kind or location you’re thinking about?”

Close to-miss:

> Immediate: “What’s the usual deviation of 10, 20, 30, 40, 50?” > > Mannequin response: [{"name": "calculate_standard_deviation", "arguments": {"numbers": "10, 20, 30, 40, 50"}}]

Within the near-miss case, the mannequin chosen the proper software however handed the numbers as a string as an alternative of an array. This earns a 0.5 reward rating (proper perform, mistaken parameter format) and represents the sort of error that you simply’d goal within the subsequent iteration by means of extra coaching information or reward perform refinement.

Deploy the fine-tuned mannequin

With analysis confirming enchancment, deploy the fine-tuned mannequin immediately from the mannequin particulars web page. Select Deploy, and choose your deployment goal: both a SageMaker AI endpoint or Amazon Bedrock. You may also obtain the mannequin weights from Amazon S3 for self-managed deployment.

Amazon SageMaker Studio training details page for an RLVR Tool Calling model (v1) based on Qwen2.5-7B-Instruct, showing completed training status with RLVR customization technique, a Deploy dropdown menu with SageMaker AI and Bedrock options, and hyperparameters including batch size 128, max epochs 3, and learning rate 0.000005.

Conclusion

On this put up, we fine-tuned Qwen 2.5 7B Instruct for agentic software calling utilizing RLVR and GRPO by means of serverless mannequin customization in Amazon SageMaker AI. We ready a dataset spanning three tool-calling behaviors (execute, make clear, refuse), outlined a tiered reward perform, educated the mannequin in about 40 minutes, evaluated on held-out information with unseen instruments and eventualities, and deployed. The fine-tuned mannequin improved software name reward by 57% over the bottom mannequin.

To push accuracy additional, you possibly can increase your coaching information with extra instruments, edge instances, and multi-turn conversations to cowl extra of the eventualities that your brokers encounter in manufacturing. You may also refine your reward perform to penalize particular failure modes, just like the string-vs-array parameter problem proven within the earlier part, or add partial credit score for different near-miss patterns. If you happen to’re operating agentic workflows, your manufacturing logs are a high-quality supply of coaching information that may make the mannequin much more efficient to your particular use case. Past software calling, RLVR applies to different reasoning duties the place correctness is verifiable, similar to multi-step planning, structured information extraction, or code era.

Whereas this put up walks by means of the UI workflow, an SDK for programmatic entry can also be accessible. To be taught extra, see the SageMaker AI mannequin customization documentation.

To get began, attempt serverless AI mannequin customization in Amazon SageMaker AI with your individual use instances.


In regards to the authors

Lauren Mullennex

Lauren Mullennex

Lauren is a Senior GenAI/ML Specialist Options Architect at AWS. She has over a decade of expertise in ML, DevOps, and infrastructure. She is a broadcast creator of a guide on laptop imaginative and prescient. Outdoors of labor, yow will discover her touring and mountaineering together with her two canine.

Eric Saleh

Eric is a Senior GenAI Specialist at AWS, specializing in basis mannequin coaching and inference. He’s partnering with high basis mannequin builders and AWS service groups to allow distributed coaching and inference at scale on AWS and lead joint GTM motions with strategic clients. Earlier than becoming a member of AWS, Eric led product groups constructing enterprise AI/ML options, which included frontier GenAI providers for fine-tuning, RAG, and managed inference. He holds a grasp’s diploma in Enterprise Analytics from UCLA Anderson.

Surya Kari

Surya is a Senior Generative AI Information Scientist at AWS, specializing in creating options leveraging state-of-the-art basis fashions. He has intensive expertise working with superior language fashions together with DeepSeek-R1, the LLama household, and Qwen, specializing in their fine-tuning and optimization for particular scientific purposes. His experience extends to implementing environment friendly coaching pipelines and deployment methods utilizing AWS SageMaker, enabling the scaling of basis fashions from improvement to manufacturing. He collaborates with clients to design and implement generative AI options, serving to them navigate mannequin choice, fine-tuning approaches, and deployment methods to realize optimum efficiency for his or her particular use instances.

Tags: AccelerateagenticAmazonCallingcustomizationModelSageMakerServerlesstool
Previous Post

The Geometry Behind the Dot Product: Unit Vectors, Projections, and Instinct

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular News

  • Greatest practices for Amazon SageMaker HyperPod activity governance

    Greatest practices for Amazon SageMaker HyperPod activity governance

    405 shares
    Share 162 Tweet 101
  • How Cursor Really Indexes Your Codebase

    404 shares
    Share 162 Tweet 101
  • Construct a serverless audio summarization resolution with Amazon Bedrock and Whisper

    403 shares
    Share 161 Tweet 101
  • Speed up edge AI improvement with SiMa.ai Edgematic with a seamless AWS integration

    403 shares
    Share 161 Tweet 101
  • Unlocking Japanese LLMs with AWS Trainium: Innovators Showcase from the AWS LLM Growth Assist Program

    403 shares
    Share 161 Tweet 101

About Us

Automation Scribe is your go-to site for easy-to-understand Artificial Intelligence (AI) articles. Discover insights on AI tools, AI Scribe, and more. Stay updated with the latest advancements in AI technology. Dive into the world of automation with simplified explanations and informative content. Visit us today!

Category

  • AI Scribe
  • AI Tools
  • Artificial Intelligence

Recent Posts

  • Speed up agentic software calling with serverless mannequin customization in Amazon SageMaker AI
  • The Geometry Behind the Dot Product: Unit Vectors, Projections, and Instinct
  • Construct AI-powered worker onboarding brokers with Amazon Fast
  • Home
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

© 2024 automationscribe.com. All rights reserved.

No Result
View All Result
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us

© 2024 automationscribe.com. All rights reserved.