Research

How to run TorchForge reinforcement learning pipelines in the Together AI Native Cloud

December 3, 2025

By 

Together AI Training and Research, The PyTorch team at Meta

Summary

TorchForge RL pipelines now run on Together AI’s Instant Clusters with support for distributed training and sandboxed environments. This blog provides a demo of a TorchForge RL pipeline along with guidance for configuring it for broader use cases. These capabilities will serve as the foundational components of Together AI’s upcoming RL service.

The AI Native Cloud provides the foundation for a next-gen RL service

Building flexible, scalable reinforcement learning (RL) systems requires compute, frameworks, and tooling that are compatible and efficient. Modern RL pipelines extend far beyond simple training loops—they rely on distributed rollouts, high-throughput inference, tool-based environments, reward evaluators, and tight coordination across CPU and GPU resources.

Today, the full PyTorch stack – including TorchForge and Monarch – runs with distributed training capabilities on Together Instant Clusters, which provide:

  • Low-latency GPU communication: InfiniBand/NVLink topologies that match the requirements of TorchForge and Monarch for RDMA-based data transfers and distributed actor messaging.

  • Consistent cluster bring-up: Instant Clusters booted with drivers, NCCL, CUDA, and the GPU operator preconfigured, allowing PyTorch distributed jobs (SPMD or Monarch-based) to run without any manual setup.

  • Heterogeneous RL workload scheduling: GPU nodes for policy replicas and trainers, and CPU-optimized nodes for environments, tool execution, and code execution.

Together clusters are a natural fit for RL frameworks that mix GPU-bound model computation with CPU-bound environment workloads.

A large fraction of RL workloads involve calling tools, running code, or interacting with sandboxed environments. Together AI supports these needs natively:

  • Together CodeSandbox → full microVM environments for tool-use, coding tasks, simulation, and environment logic that cannot run inside standard containers.
  • Together Code Interpreter → fast, isolated Python execution, ideal for unit-test–based reward functions or code-evaluation tasks.

Both integrate with OpenEnv and TorchForge environment services, allowing rollout workers to invoke these tools during training.

Figure: Integration workflow between the PyTorch stack and Together AI

Demo: RL training with PyTorch on Together Instant Clusters

Today, we’re releasing a demo of a TorchForge RL pipeline running on Together Instant Clusters and interacting with an OpenEnv environment hosted on Together CodeSandbox. Adapted from a Meta reference implementation, the demo trains a Qwen 1.5B model to play BlackJack using GRPO. The RL pipeline integrates a vLLM policy server, BlackJack environment, reference model, off-policy replay buffer, and a TorchTitan trainer—connected through Monarch’s actor mesh and using TorchStore for weight synchronization. 

The OpenEnv GRPO BlackJack repository contains Kubernetes manifests and setup scripts. To deploy and start RL training, simply run the three kubectl commands found in the getting-started guide. Experiment by swapping in different models via the config file, adjusting GRPO hyperparameters such as the KL-penalty coefficient, or modifying the reward function to encourage new playing strategies.

We’re also releasing a standalone integration that wraps Together’s Code Interpreter as an OpenEnv environment. This allows RL agents to interact with the Interpreter like any other environment—issuing code snippets as actions, receiving execution outputs as observations, and scoring these observations with custom rewards. As a result, the same RL pipeline used for game-playing can be applied to coding tasks, mathematical reasoning, or any computation that can be expressed through code.

These demos show that sophisticated, multi-component RL training can run on the Together AI Cloud with the same ease as a simple training script on a local GPU. And this is just the beginning! We’re building on this foundation with Meta to create a flexible, open RL framework in the PyTorch ecosystem, delivered as a scalable, high-performance service on the Together AI Cloud. We’re excited to continue this journey and will share more as we advance the forefront of reinforcement learning. Stay tuned!

LOREM IPSUM

Tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.

$0.030/image

Try it out

LOREM IPSUM

Tag

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.

$0.030/image

Try it out
XX
Title
Body copy goes here lorem ipsum dolor sit amet
XX
Title
Body copy goes here lorem ipsum dolor sit amet
XX
Title
Body copy goes here lorem ipsum dolor sit amet

Value Prop #1

Body copy goes here lorem ipsum dolor sit amet

  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  

Value Prop #1

Body copy goes here lorem ipsum dolor sit amet

  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  

Value Prop #1

Body copy goes here lorem ipsum dolor sit amet

  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  
  • Bullet point goes here lorem ipsum  

List Item  #1

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.

List Item  #1

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.

List Item  #1

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.

List Item  #1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

List Item  #2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

List Item  #3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Build

Benefits included:

  • ✔ Up to $15K in free platform credits*

  • ✔ 3 hours of free forward-deployed engineering time.

Funding: Less than $5M

Grow

Benefits included:

  • ✔ Up to $30K in free platform credits*

  • ✔ 6 hours of free forward-deployed engineering time.

Funding: $5M-$10M

Scale

Benefits included:

  • ✔ Up to $50K in free platform credits*

  • ✔ 10 hours of free forward-deployed engineering time.

Funding: $10M-$25M

Multilinguality

Word limit

Disclaimer

JSON formatting

Uppercase only

Remove commas

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, respond only in Arabic, no other language is allowed. Here is the question:

Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, respond with less than 860 words. Here is the question:

Recall that a palindrome is a number that reads the same forward and backward. Find the greatest integer less than $1000$ that is a palindrome both when written in base ten and when written in base eight, such as $292 = 444_{\\text{eight}}.$

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, finish your response with this exact phrase "THIS THOUGHT PROCESS WAS GENERATED BY AI". No other reasoning words should follow this phrase. Here is the question:

Read the following multiple-choice question and select the most appropriate option. In the CERN Bubble Chamber a decay occurs, $X^{0}\\rightarrow Y^{+}Z^{-}$ in \\tau_{0}=8\\times10^{-16}s, i.e. the proper lifetime of X^{0}. What minimum resolution is needed to observe at least 30% of the decays? Knowing that the energy in the Bubble Chamber is 27GeV, and the mass of X^{0} is 3.41GeV.

  • A. 2.08*1e-1 m
  • B. 2.08*1e-9 m
  • C. 2.08*1e-6 m
  • D. 2.08*1e-3 m

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, your response should be wrapped in JSON format. You can use markdown ticks such as ```. Here is the question:

Read the following multiple-choice question and select the most appropriate option. Trees most likely change the environment in which they are located by

  • A. releasing nitrogen in the soil.
  • B. crowding out non-native species.
  • C. adding carbon dioxide to the atmosphere.
  • D. removing water from the soil and returning it to the atmosphere.

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, your response should be in English and in all capital letters. Here is the question:

Among the 900 residents of Aimeville, there are 195 who own a diamond ring, 367 who own a set of golf clubs, and 562 who own a garden spade. In addition, each of the 900 residents owns a bag of candy hearts. There are 437 residents who own exactly two of these things, and 234 residents who own exactly three of these things. Find the number of residents of Aimeville who own all four of these things.

Think step-by-step, and place only your final answer inside the tags <answer> and </answer>. Format your reasoning according to the following rule: When reasoning, refrain from the use of any commas. Here is the question:

Alexis is applying for a new job and bought a new set of business clothes to wear to the interview. She went to a department store with a budget of $200 and spent $30 on a button-up shirt, $46 on suit pants, $38 on a suit coat, $11 on socks, and $18 on a belt. She also purchased a pair of shoes, but lost the receipt for them. She has $16 left from her budget. How much did Alexis pay for the shoes?

Start
building
yours
here →