Problem Definition: Multilingual Limitations of English-Centric Inference Models
GPT-OSS-20B is an open-weight inference model that performs its internal reasoning (Chain-of-Thought) in English. Even when asked to infer in French, German, Spanish, or Italian, it was observed that the model continues to reason in English after recognizing the instructions. In the 50 example multilingual inference tests published on the AWS Machine Learning blog, the base model had a target language inference rate of only 22%. The detailed figures by language are as follows.
| Language | Inference Language Accuracy |
|---|---|
| English | 100% |
| French | 0% |
| German | 10% |
| Spanish | 0% |
| Italian | 0% |
This gap leads to a catastrophic user experience degradation when deploying services to non-English speaking users. When a user asks a question in French, they expect the model to think and respond in French, but the model exposes or mixes English reasoning. Solving this issue was the core challenge of this fine-tuning project.
Dataset and Evaluation Framework: Multilingual-Thinking Benchmark
The experiment utilized the HuggingFaceH4/Multilingual-Thinking dataset. This dataset consists of reasoning problems translated into English, French, Spanish, German, and Italian, containing the reasoning process (Chain-of-Thought).
- Training Data: Approximately 949 examples
- Validation Data: 50 examples
- Test Set: 5 languages × 10 math/logical problems = 50 cases
The evaluation metrics were divided into two categories.
- Reasoning-language correct: Was the reasoning process written in the requested language?
- Answer-language correct: Was the final answer written in the requested language?
The model receives a 'reasoning language' instruction as a system prompt and must overcome its strong English prior knowledge to perform reasoning and answering in the target language.
Role Distribution of SFT and GRPO: Behavior Learning vs Behavior Optimization
The AWS team defined the difference between the two techniques as follows.
SFT teaches behaviors that the model does not possess. GRPO optimizes behaviors that the model can already generate occasionally.
GRPO (Group Relative Policy Optimization) samples multiple responses per prompt and pushes the policy toward the higher average group. If the probability of the desired behavior converges to 0 in the base distribution, there is no signal for GRPO to reinforce. The authors stated that this principle explains almost all results of this experiment.
In other words, it is a structure where SFT plants the 'seed' of target language inference behavior, and GRPO 'grows' that seed. Significant improvements are possible with SFT alone, and GRPO adds value when there is headroom after SFT.
Learning Infrastructure: Distributed Fine-Tuning Stack Based on SageMaker HyperPod
The entire training pipeline was built on Amazon SageMaker HyperPod. The main components are as follows.
Hardware Configuration
- GPT-OSS-20B SFT/GRPO: 4× ml.g6e.12xlarge (16× L40S 48GB)
- Qwen2.5-7B Control Experiment: 2× g6e.48xlarge (16× L40S)
Software Stack
| Component | GPT-OSS-20B Experiment | Qwen2.5-7B Control Experiment |
|---|---|---|
| Orchestration | Amazon EKS | Amazon EKS + Ray + KubeRay |
| Trainer | PyTorch TRL | veRL |
| Rollout Generation | Built-in TRL | vLLM |
| Distributed Strategy | FSDP Full-Shard | Ray Distributed |
| Storage | Amazon FSx for Lustre | Amazon FSx for Lustre |
| Interconnect | Elastic Fabric Adapter (EFA) | Elastic Fabric Adapter (EFA) |
| Precision | bf16 | bf16 |
| Parameter Efficiency | LoRA (r=8, α=16) | LoRA |
All fine-tuning was conducted using LoRA (Low-Rank Adaptation) to ensure parameter efficiency. Checkpoints and datasets are stored in a persistent volume mounted on Amazon FSx for Lustre (`/fsx`), and collective communication between nodes is handled by the EFA + NCCL + aws-ofi-nccl stack.
End-to-End Data Flow
- user submission
- EKS control plane
- Ray head/worker pod scheduling
- FSx for Lustre mount
- veRL trainer + vLLM rollout
- EFA-based inter-node communication
- checkpoint FSx storage
1. User submits execution via SageMaker Studio or AWS CLI 2. The EKS control plane of HyperPod places pods on GPU nodes 3. The Ray head pod and worker pods (veRL trainer, vLLM rollout worker) are launched 4. All pods mount FSx for Lustre to share the base model, training data, and checkpoints 5. vLLM rollout streams to veRL trainer, which records checkpoints to FSx
Experimental Results and Implications: Is SFT Sufficient, or is GRPO Necessary?
GPT-OSS-20B Base Model Baseline
- Inference Language Accuracy: 22% (11/50)
- English 100%, French 0%, German 10%, Spanish 0%, Italian 0%
SFT Settings and Results
- LoRA Settings: r=8, α=16
- Training Steps: 1,000 steps
- Distribution: FSDP Full-Shard, bf16, Gradient Checkpointing
- Job Management: Elastic HyperPodPyTorchJob managed by Kueue, executed with `hyperpodrun`
During SFT training, loss and gradient norm are output at each step, and normal execution shows a stable decrease in loss. After training completion, FSDP checkpoints are converted to PEFT format for inference and evaluation.
Generalization Observed through Qwen2.5-7B Control Experiment
The AWS team conducted control experiments with Qwen2.5-7B on two tasks to validate the criteria for technique selection based on 'capability gap'.
- Task A (Large Gap): Significant improvement with SFT alone, limited additional effect from GRPO
- Task B (Small Gap): After establishing a base with SFT, GRPO contributes meaningful additional enhancement
Conclusion: SFT performs most of the heavy lifting, while GRPO adds value when refining behaviors that the model can already occasionally succeed at. Matching techniques to the capability gap of the task determines the results.
Practical Application Guide: Environment Setup and Checklist for Reproduction
The following prerequisites must be met.
- SageMaker HyperPod Cluster (EKS orchestration)
- Amazon FSx for Lustre file system, mounted to `/fsx` with `fsx-claim` PVC
- EFA-enabled instances + functioning NCCL and aws-ofi-nccl stack
- Container Registry (e.g., Amazon ECR) — store training images built from reference repositories
- HuggingFace Access Token — for access to `openai/gpt-oss-20b`, `HuggingFaceH4/Multilingual-Thinking`
- Workstation Tools: AWS CLI, kubectl, docker, envsubst
Summary of Reproduction Steps
1. `awsome-distributed-ai` le