Code Velocity
เครื่องมือสำหรับนักพัฒนา

SageMaker AI: เร่งการเรียกใช้เครื่องมือของ Agentic ด้วยการปรับแต่งโมเดลแบบไร้เซิร์ฟเวอร์

·5 นาทีอ่าน·AWS·แหล่งที่มา
แชร์
ส่วนต่อประสานผู้ใช้ของ Amazon SageMaker AI Studio แสดงตัวเลือกสำหรับการปรับแต่งโมเดลแบบไร้เซิร์ฟเวอร์และการเรียกใช้เครื่องมือของ Agentic
{
  "prompt": [
    {"role": "system", "content": "คุณเป็นผู้ช่วยที่เป็นประโยชน์ เมื่อใช้เครื่องมือ ให้ตอบกลับด้วย: [...]"},
    {"role": "user", "content": "รับสภาพอากาศ"}
  ],
  "reward_model": {
    "ground_truth": "เพื่อให้ข้อมูลสภาพอากาศแก่คุณ โปรดระบุตำแหน่ง"
  }
}

การปรับแต่ง Qwen 2.5 7B Instruct ด้วย SageMaker AI

กระบวนการปรับแต่งโมเดลอย่าง Qwen 2.5 7B Instruct ภายใน Amazon SageMaker AI Studio นั้นง่ายและใช้งานง่าย หลังจากตรวจสอบให้แน่ใจว่าได้ปฏิบัติตาม ข้อกำหนดเบื้องต้น ที่จำเป็นแล้ว (บัญชี AWS, บทบาท IAM, โดเมน SageMaker AI, บักเก็ต S3) ผู้ใช้สามารถไปยังส่วน Models ใน SageMaker AI Studio ได้

จากนั้น การเลือก Qwen 2.5 7B Instruct และเลือก Customize with UI จะเปิดหน้าการกำหนดค่าเฉพาะ อินเทอร์เฟซนี้ช่วยให้:

  • การเลือกเทคนิค: เลือก Reinforcement Learning with Verifiable Rewards (RLVR) จากเมนูแบบเลื่อนลงอย่างชัดเจน
  • อินพุตข้อมูล: ชี้ไปยังข้อมูลการฝึกอบรมที่เตรียมไว้ซึ่งเก็บไว้ในบัคเก็ต Amazon S3
  • ฟังก์ชันรางวัล: กำหนดค่ากลไกการให้คะแนนแบบแบ่งระดับที่กำหนดว่าการตอบสนองของผู้สมัครจะถูกประเมินเทียบกับ ground_truth อย่างไร
  • การกำหนดค่าไฮเปอร์พารามิเตอร์: ปรับพารามิเตอร์เช่นขนาดแบตช์ แม้ว่า SageMaker AI มักจะจัดการการตั้งค่าที่เหมาะสมที่สุดโดยอัตโนมัติ

SageMaker AI รองรับตระกูลโมเดลที่หลากหลาย รวมถึง Amazon Nova, GPT-OSS, Llama, Qwen และ DeepSeek พร้อมด้วยเทคนิคต่างๆ เช่น Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), RLVR และ Reinforcement Learning from AI Feedback (RLAIF) การติดตาม MLflow ในตัวช่วยให้มองเห็นเมตริกการฝึกอบรมและการตรวจสอบความถูกต้อง ทำให้การตรวจสอบประสิทธิภาพและการวนซ้ำง่ายขึ้น ความง่ายในการใช้งานนี้ช่วยเร่งวงจรการพัฒนาอย่างมากสำหรับนักพัฒนาที่สร้าง github-agentic-workflows ที่ซับซ้อน

ความสำเร็จในการประเมินและการนำไปใช้งาน

ประสิทธิภาพของโมเดล Qwen 2.5 7B Instruct ที่ได้รับการปรับแต่งของเราได้รับการประเมินอย่างเข้มงวดบนข้อมูลที่ไม่ได้ใช้ในการฝึกอบรม ซึ่งรวมถึงสถานการณ์ที่มี เครื่องมือที่ไม่เคยเห็น มาก่อนเลย—ซึ่งเป็นการทดสอบที่สำคัญสำหรับการสรุปผลลัพธ์ ผลลัพธ์ที่ได้นั้นน่าทึ่ง: โมเดลที่ได้รับการปรับแต่งสามารถเพิ่มประสิทธิภาพในการเรียกใช้เครื่องมือได้ถึง 57% เมื่อเทียบกับโมเดลพื้นฐาน การก้าวกระโดดที่สำคัญในประสิทธิภาพในสถานการณ์ที่ไม่เคยพบเจอระหว่างการฝึกอบรมนี้ ตอกย้ำพลังของ RLVR ในการสอนโมเดลให้มีความสามารถในการตัดสินใจที่แข็งแกร่งสำหรับการโต้ตอบกับเครื่องมือ

ความน่าเชื่อถือที่เพิ่มขึ้นนี้ส่งผลโดยตรงต่อความไว้วางใจและความมั่นใจที่สูงขึ้นในการนำ เอเจนต์ AI ไปใช้ในสภาพแวดล้อมการผลิต ด้วยการลดเหตุการณ์ที่เครื่องมือเกิดภาพหลอน พารามิเตอร์ไม่ถูกต้อง และการกระทำที่ไม่เหมาะสม ธุรกิจสามารถใช้ประโยชน์จากเอเจนต์ AI สำหรับงานที่สำคัญและละเอียดอ่อนยิ่งขึ้น ด้วย SageMaker AI ที่จัดการความซับซ้อนของ การนำโมเดลไปใช้งาน และ การจัดการโครงสร้างพื้นฐาน นักพัฒนาสามารถย้ายจากการปรับแต่งไปสู่การผลิตได้อย่างราบรื่น ตระหนักถึงศักยภาพสูงสุดของโซลูชัน AI ของ agentic ความสามารถนี้สอดคล้องกับวิสัยทัศน์ที่กว้างขึ้นของ การนำ Agentic AI มาใช้งานจริง เพื่อผลกระทบในโลกจริง

โดยสรุป การรวมกันของ การปรับแต่งโมเดลแบบไร้เซิร์ฟเวอร์ ของ Amazon SageMaker AI และความสามารถในการเรียนรู้ที่แข็งแกร่งของ RLVR มอบหนทางที่มีประสิทธิภาพในการสร้างระบบ การเรียกใช้เครื่องมือของ agentic ที่น่าเชื่อถือสูง แนวทางที่เป็นนวัตกรรมนี้ช่วยเร่งการพัฒนา ลดภาระการปฏิบัติงาน และท้ายที่สุดก็ส่งมอบเอเจนต์ AI ที่ทำงานด้วยความแม่นยำและความน่าเชื่อถือที่ไม่เคยมีมาก่อน

คำถามที่พบบ่อย

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 ล่าสุดในกล่องจดหมายของคุณ

แชร์