最新资讯
dev.to Pando:OpenAI 如何通过放宽跨分支一致性,让 Git 支撑 Agent 速度的推送 dev.to 为能花钱或签发的 Agent 做威胁建模 dev.to Linux 本地提权:OpenAI 报告的 948 项发现 unite.ai NVIDIA 以 Vera CPU 对比 x86:聚焦 Agent 速度与能效容量 techmeme.com 消息称 NVIDIA 接触 Apollo,拟将 Brightspeed 的 130 多栋建筑改造为小型数据中心 thenewstack.io Factory 收购 HumanLayer,并称其为一个月内第三起 AI 编程初创收购 blogs.nvidia.com NVIDIA 称 Vera CPU 兼顾高吞吐与最快 Agent 性能 www.youtube.com Netflix 如何评估没有标准答案的 AI 任务 nytimes.com OpenAI 承诺让当地社区在数据中心项目中拥有更多话语权 unite.ai 约 60 万块 NVIDIA H200 因北京进口审批滞留香港 techcrunch.com Meta 称美国用户现可与 Muse AI 头像视频通话 theinformation.com Nvidia 应对数据中心阻力的变通方案:改造旧电话局建筑
多元动态
登录 注册
大模型 aws.amazon.com · @Mijanur Palash

在 Amazon SageMaker HyperPod 上微调 GPT-OSS-20B 实现多语言推理

原文 我的收藏

AWS 博客介绍在 SageMaker HyperPod(EKS 编排、PyTorch TRL)上对 GPT-OSS-20B 做多语言推理微调。基座模型在 50 例测试中仅 22% 用目标语言进行思维链(英语 100%,法/西/意 0%,德 10%);SFT 将推理语言准确率提升至 100%,GRPO 在存在提升空间时带来额外增益。文章还以 Qwen2.5-7B 做对照,讨论 SFT 与 GRPO 的适用边界:SFT 教模型新行为,GRPO 优化模型已能偶尔产生的行为。

AI推荐理由 AWS 官方博客给出具体实验:GPT-OSS-20B 在 50 例多语言推理测试中仅 22% 用目标语言推理(法语、西班牙语、意大利语均为 0%),SFT 后推理语言准确率升至 100%,并对比 GRPO 在存在提升空间时的增益,附 Qwen2.5-7B 对照实验。信息密度高、方法可复现,对微调选型有实际参考价值;局限是单一小规模测试集、效果数字来自厂商自述,未见独立验证。

82

正文

GPT-OSS-20B is an open-weight reasoning model that thinks in English. Ask it to reason in French, German, Spanish, or Italian and it acknowledges the instruction, then produces its chain-of-thought in English anyway. On a 50-example multilingual reasoning test, the base model reasoned in the correct target language only 22 percent of the time. That 22 percent was almost entirely the English examples (English 100 percent, French 0 percent, German 10 percent, Spanish 0 percent, Italian 0 percent). For teams deploying reasoning models for non-English users, that gap matters. A user who asks a question in French expects the model to reason and answer in French, not to switch to English mid-thought. Closing that gap is a fine-tuning problem. It raises a question every team faces once they start customizing open-weight models: supervised fine-tuning (SFT), reinforcement learning with Group Relative Policy Optimization (GRPO), or both? In this post, we walk through how we fine-tuned GPT-OSS-20B for multilingual reasoning on Amazon SageMaker HyperPod. We show when SFT alone was sufficient and when GRPO added measurable value on top. To understand more broadly when GRPO helps, we also ran a controlled Qwen2.5-7B experiment across two tasks with different capability gaps. The short answer: SFT does most of the work, GRPO refines when there is headroom to refine, and matching the technique to the capability gap is what decides the outcome. Solution overview This section covers the multilingual reasoning task and dataset, how SFT and GRPO complement each other, and the training stack we ran on Amazon SageMaker HyperPod. The task and dataset The dataset is HuggingFaceH4/Multilingual-Thinking — a chain-of-thought reasoning dataset translated into French, Spanish, German, and Italian alongside English, roughly 949 training and 50 validation examples. The model receives a reasoning language: system-prompt instruction and must both reason and answer in that target language, overriding its strong English prior. The evaluation is 50 test cases: 10 math/logic problems across 5 languages (EN/FR/DE/ES/IT). Two metrics matter: Reasoning-language correct – is the chain-of-thought in the requested language? Answer-language correct – is the final answer in the requested language? How SFT and GRPO fit together The clearest way to think about the two techniques: SFT teaches a behavior the model doesn’t have. GRPO optimizes a behavior the model can already sometimes produce. GRPO works by sampling a group of responses per prompt and pushing the policy toward the above-average ones. If the desired behavior has zero probability in the base distribution, there is very little for GRPO to reinforce. That single idea explains almost every result in this post. The training stack We ran on Amazon SageMaker HyperPod with Amazon Elastic Kubernetes Service (Amazon EKS) orchestration. For the initial SFT and GRPO runs on GPT-OSS-20B, we used the PyTorch TRL library. For the Qwen control experiment, we switched to veRL as the trainer, with Ray and KubeRay for distributed orchestration and vLLM for fast rollout generation. Checkpoints and datasets lived on Amazon FSx for Lustre, and the inter-node fabric used Elastic Fabric Adapter (EFA). All fine-tuning used Low-Rank Adaptation (LoRA), which is parameter-efficient and well-suited to both SFT and GRPO. The following diagram shows the training data path end-to-end. A submission from the user lands on the Amazon EKS control plane of the Amazon SageMaker HyperPod cluster. Amazon EKS schedules a Ray head pod plus worker pods that run the veRL trainer and vLLM rollout workers. Both sets of pods mount Amazon FSx for Lustre for the base model, training data, and checkpoints. Inter-node collectives use EFA. Rollouts stream from vLLM back to the veRL trainer, and the trainer writes checkpoints back to Amazon FSx for Lustre. Figure 1: End-to-end training data path for SFT and GRPO fine-tuning on Amazon SageMaker HyperPod with veRL, Ray, KubeRay, vLLM, and Amazon FSx for Lustre for Qwen control experiments The following describes each hop in more detail. The submitter starts the run from Amazon SageMaker Studio or the AWS Command Line Interface (AWS CLI). The Amazon EKS control plane on Amazon SageMaker HyperPod places pods on GPU nodes and starts a Ray head with worker pods for the veRL trainer and the vLLM rollout workers. Amazon FSx for Lustre provides shared, high-throughput storage for the base model, the training data, and the checkpoints. When training completes, the trainer writes the LoRA adapter back to Amazon FSx for Lustre for downstream evaluation or serving. Prerequisites To follow along, you need: An Amazon SageMaker HyperPod cluster with Amazon EKS orchestration. GPT-OSS SFT used 4× ml.g6e.12xlarge (16× L40S 48GB). The Qwen control used 2× g6e.48xlarge (16× L40S). An Amazon FSx for Lustre file system mounted on the cluster with a PersistentVolumeClaim named fsx-claim at /fsx. EFA-enabled instances and a working NVIDIA Collective Communications Library (NCCL) and aws-ofi-nccl stack for multi-node SFT. A container registry such as Amazon Elastic Container Registry (Amazon ECR) to hold the training image built from the reference repository. A HuggingFace access token for openai/gpt-oss-20b and the HuggingFaceH4/Multilingual-Thinking dataset. The AWS Command Line Interface (AWS CLI), kubectl, docker, and envsubst available on your workstation. Set up the training environment All of the commands, manifests, and scripts referenced below live in the awsome-distributed-ai GitHub repository under 3.test_cases/pytorch/trl/gpt-oss-lora-grpo/. Clone the repository and change into the test case directory: git clone https://github.com/awslabs/awsome-distributed-ai cd awsome-distributed-ai/3.test_cases/pytorch/trl/gpt-oss-lora-grpo Copy the environment template, then edit env_vars to set your ECR registry, image name, tag, and HuggingFace token: cp env_vars.example env_vars source env_vars Build the training image and push it to your registry. The image bundles PyTorch, TRL, HuggingFace Transformers, PEFT, and the training and inference scripts: cd artifacts && ./build_push.sh && cd .. Point kubectl at your cluster and apply the FSx storage manager pod. The storage manager gives you a shell into the shared file system for checkpoint conversion and eval-log inspection: aws eks update-kubeconfig --name --region us-east-2 envsubst '$REGISTRY $IMAGE $TAG $HF_TOKEN' \ > pass@1) to have anything to optimize. No headroom means no gain. Best practices Start with SFT. GRPO cannot teach a behavior with zero base probability. It can only reinforce responses the model already sometimes produces. SFT took reasoning-language from 22 percent to 100 percent, and every GRPO win in this work was built on that SFT checkpoint. Use LoRA for both SFT and GRPO. LoRA r=8/α=16 was parameter-efficient (0.068 percent trainable), and on the Qwen control it stayed numerically stable through GRPO (grad norm 0.23, about 11.7 GB per GPU). It’s a strong default when you want SFT and GRPO to share the same adapter shape. Match the technique to the gap. Use SFT for missing behavior. Use GRPO for refining an existing, sometimes-correct behavior. GRPO’s realistic ceiling here was +6 to +8 points. Check for reward headroom before spending GPU-hours. If most groups are all-correct (GSM8K 90.5 percent base), the group-relative advantage collapses to zero and GRPO gets no gradient. Verify there is headroom (pass@k >> pass@1) before starting a GRPO run. Clean up resources To avoid ongoing charges, delete the workload resources and then the underlying infrastructure: Delete the training and inference pods and jobs: kubectl delete hyperpodpytorchjob lora-hyperpod-elastic --ignore-not-found kubectl delete pod grpo-single inference-base inference-trained inference-grpo \ eval-grpo fsx-storage-manager --ignore-not-found Scale down or delete the Amazon SageMaker HyperPod cluster or its node groups. Delete the Amazon FSx for Lustre file system once you have exported any checkpoints you want to keep. Delete any Amazon Simple Storage Service (Amazon S3) buckets or objects used for training data or checkpoint archives. Conclusion We showed how to fine-tune GPT-OSS-20B for multilingual reasoning on Amazon SageMaker HyperPod, and how to decide between SFT and GRPO. SFT did most of the work: reasoning-language went from 22 percent to 100 percent. GRPO added a real, modest refinement on top (answer 62 percent to 70 percent) where headroom existed. A parallel Qwen2.5-7B control confirmed the pattern. GRPO added +6 percent on multilingual reasoning, where there was room to improve. It added no gain on GSM8K, where the model was already at peak accuracy (90.5 percent). Decision framework: Behavior the model can’t do at all: use SFT. Behavior it does sometimes, with headroom: use SFT then GRPO for a few points more. Model already at peak accuracy, or target has zero base probability: GRPO won’t help. To try this yourself, walk through the test cases in the awsome-distributed-ai repository. For more on Amazon SageMaker HyperPod, see the service detail page and the Amazon SageMaker HyperPod documentation. For a walkthrough of Ray on Amazon SageMaker HyperPod, see the related post Running distributed training on Amazon SageMaker HyperPod with Ray and Amazon SageMaker Studio. The link will be added after that post is published. Share your results in the comments. About the authors Mijanur Palash Mijanur is a Specialist Solutions Architect on the AI/ML Infrastructure team at AWS. He focuses on distributed training and reinforcement learning workloads on Amazon SageMaker HyperPod for automotive, pharmaceutical, and generative AI customers. Outside of work, Palash enjoys hiking and photography. Mark Vinciguerra Mark was a Worldwide Specialist Solutions Architect for Generative AI at AWS, focused on distributed training and inference on Amazon SageMaker HyperPod. He works with strategic customers on large-scale foundation-model workloads across EKS and Slurm orchestration and contributes reference architectures and workshops for HyperPod, Ray, and SageMaker Unified Studio.

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容