A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
Use Programmed Training with Qwen3.8-27B for R2E-Gym when the model must interact with repositories, tools, tests, and iterative environment observations; use Managed Training RFT only if each attempt can be reduced to a prompt, final response, and grader score.
Qwen3.8-27B is currently a preview model supporting both Managed Training RFT and Programmed Training. Its supported training types are Global and Developer, and its deployment option is managed compute, not serverless.^1^
Recommended architecture for R2E-Gym
R2E-Gym is an open-source environment for software-engineering agents; it is not identified as an official MLPerf Training workload in the available MLPerf catalog.^2^^3^
For an environment-driven experiment, split responsibilities as follows:
- R2E-Gym
- Selects a repository task.
- Executes model-proposed actions.
- Returns tool output and observations.
- Runs its hybrid verifier or tests and produces a reward.
- Your Python training driver
- Converts the task and observation history into model input.
- Requests rollouts from Foundry.
- Passes actions to R2E-Gym.
- Converts verifier results into numeric rewards and advantages.
- Controls update cadence, evaluation, and checkpointing.
- Foundry Programmed Training
- Maintains the
Qwen3.8-27BLoRA adapter. - Performs sampling, forward/backward operations, optimizer updates, and checkpoint operations on Foundry-managed training infrastructure.
- Maintains the
Programmed Training exposes exactly these controls: rollouts, rewards, advantages, token masks, gradient accumulation, optimizer updates, and checkpoints.^4^
Getting started with Programmed Training
- Create a Foundry project in a supported region.
Choose a region supporting Programmed Training andQwen3.8-27B. Select Global for faster queueing where data residency is not required, or Developer for lower-cost experimentation without latency, SLA, or data-residency guarantees.^1^ - Request Programmed Training access.
It is a preview requiring explicit approval. Submit the preview sign-up form linked from the Programmed Training documentation and wait for approval before creating a session.^4^ - Establish an evaluation baseline.
- Hold out R2E-Gym tasks that training never sees.
- Run the base model on that set.
- Record task success, verifier reward, tool-call validity, number of steps, and token usage.
- Test reward behavior on known successful and unsuccessful trajectories before updating weights.
- Start from Microsoft’s Programmed Training quickstart and RL recipe.
Replace its example task generator and reward calculation with an R2E-Gym adapter. The core iteration should:- Refresh sampler weights.
- Generate several rollouts per task.
- Execute each rollout in an isolated R2E-Gym environment.
- Score it using the verifier.
- Compute prompt-group advantages.
- Call
forward_backwardwith an RL loss such asimportance_sampling. - Call
optim_step. - Evaluate and save checkpoints.^4^
- Mask non-learning tokens.
Train on the model’s selected action or assistant tokens; exclude prompts, repository contents, tool results, and environment observations from the loss unless the experiment intentionally trains those tokens.
Microsoft’s documentation does not provide a ready-made R2E-Gym connector, so the environment adapter between R2E-Gym’s task/reset/step/verifier interfaces and Foundry’s sampling/update primitives must be implemented in the training driver.
When Managed Training RFT is sufficient
Choose Managed RFT instead when R2E-Gym can be represented as independent examples where Foundry generates one response and a grader can reliably score that response. Managed RFT accepts separate training and validation JSONL files and supports string, similarity, model, Python, and multi-graders.^5^
A Python grader has this basic form:
def grade(sample, item):
expected = item["reference_answer"]
actual = sample["output_text"]
return float(actual == expected)
That route becomes a poor fit when grading requires cloning a repository, applying patches, running tests, or returning observations for another model turn: Python graders run in a constrained runtime without network access.^5^ Those requirements favor Programmed Training with R2E-Gym running beside your driver.
Deploying the resulting LoRA adapter
Managed compute is the serving target, not the compute you provision for Programmed Training. After training:
- Ensure the adapter is registered and visible under Build → Models.
- Select the adapter and choose Deploy.
- Select or create a compatible
Qwen3.8-27Btarget deployment using a LoRA-enabled template. - Choose its accelerator and deploy the target.
- Give the adapter deployment a separate name and deploy it.
- Test using the adapter deployment name, not the base target deployment name.
LoRA adapter deployment to managed compute is preview, requires a compatible template and regional quota, and currently supports only adapters produced by Foundry fine-tuning.^6^
References
- Training in Microsoft Foundry
- GitHub - R2E-Gym/R2E-Gym: [COLM 2025] Official repository for R2E-Gym: Procedural Environment Generation and Hybrid Verifiers for Scaling Open-Weights SWE Agents · GitHub
- MLCommons MLPerf Training Benchmark
- What is Programmed Training (preview) in Microsoft Foundry?
- Fine-tune a model with reinforcement fine-tuning in Microsoft Foundry
- Deploy fine-tuned LoRA adapters to managed compute (preview) - Microsoft Foundry | Microsoft Learn