Skip to content
VoidIndex - Alexander Lee
Go back

Open-Source RL Frameworks for LLMs: verl, OpenRLHF, TRL, NeMo RL, ROLL, slime, AReaL

Edit page

Pick TRL to get started, OpenRLHF or verl for a general Ray-based RL stack, slime or NeMo RL for Megatron-scale MoE training, ROLL for agentic RL with heavy resource orchestration, and AReaL for fully asynchronous RL; they all wire a training engine to an inference engine (vLLM/SGLang) and differ mainly in how they schedule GPUs between the two [1][3].

At a glance

verlOpenRLHFTRLNeMo RLROLLslimeAReaL
FromByteDance Seed → communityOpenRLHF communityHugging FaceNVIDIAAlibabaZhipu AI / THUDMAnt Group + Tsinghua
Core ideaHybridFlow dataflowRay + vLLM, simple and scalableTrainer API on TransformersRay, Megatron/DTensorMulti-role resource orchestrationData buffer between SGLang and MegatronFully async rollout service
Training backendFSDP / FSDP2 / MegatronDeepSpeedAccelerate (DeepSpeed / FSDP)DTensor (FSDP2) / MegatronFSDP2 / MegatronMegatronPluggable
Rollout backendvLLM / SGLang / HFvLLMvLLMvLLMvLLM / SGLangSGLangSeparate inference service
Sync / AsyncBothBothMostly syncBothBothBothFully async
Scale sweet spotSmall → very large MoESmall → 70B classSingle node → small clustersLarge clustersLarge clusters, agentsVery large MoELarge async training
Best forGeneral research + productionReadable PPO/GRPO stackLearning, quick experimentsNVIDIA-stack teamsAgentic RLMegatron-scale RLAsync RL research

Exact feature sets move fast; check each repo's latest docs before choosing [5][6][7][8][9][10].

Shared problem

flowchart LR
  P["Prompts"] --> G["Rollout: generate (vLLM / SGLang)"]
  G --> R["Reward: rules / model / environment"]
  R --> A["Advantage: GRPO / PPO"]
  A --> T["Train: FSDP / Megatron / DeepSpeed"]
  T -. "sync new weights" .-> G

Frameworks

verl

What it is: ByteDance Seed's framework, now run by the verl community, and the open-source code behind the HybridFlow paper [3]. The most widely used general-purpose LLM RL framework.

Architecture

flowchart TB
  C["Single controller: RL loop in one Python process"]
  subgraph POOL["Resource pool (shared GPUs)"]
    direction LR
    R["Rollout workers: vLLM / SGLang"]
    A["Actor workers: FSDP / Megatron"]
    REF["Reference + critic workers"]
  end
  RW["Reward: rules / model"]
  C -- "1 generate" --> R
  C -- "2 score" --> RW
  C -- "3 log-probs, values" --> REF
  C -- "4 update" --> A
  A -. "3D-HybridEngine: reshard weights" .-> R

The key part: one brain, many hands (HybridFlow)

Strengths: the widest algorithm list (PPO, GRPO, GSPO, DAPO, REINFORCE++, RLOO, Dr. GRPO); runs from one node to very large MoE; sync, colocate-async, and separate-async modes [2].

Watch out: many config knobs; the async trainer and Omni/VLA support live in experimental modules.

Use it when: you want one framework for both research and production-scale runs.

OpenRLHF

What it is: a community framework built on Ray, DeepSpeed, and vLLM, designed to be easy to read and easy to scale [5].

Architecture

flowchart LR
  subgraph RAY["Ray cluster"]
    direction TB
    V["vLLM engines: generate"]
    ACT["Actor: DeepSpeed ZeRO-3"]
    CRI["Critic: DeepSpeed"]
    RM["Reward model"]
    REF["Reference model"]
  end
  V -- "samples" --> RM
  V -- "samples" --> REF
  V -- "samples" --> CRI
  RM --> ACT
  REF --> ACT
  CRI --> ACT
  ACT -- "broadcast new weights" --> V

The key part: four models, placed by Ray

Strengths: one repo for SFT, reward model, DPO, and RL (PPO, REINFORCE++, GRPO, RLOO); compact code that many research forks build on; sample packing and LoRA.

Watch out: built on DeepSpeed, so Megatron-style tensor/pipeline parallelism for giant MoE models isn't its focus.

Use it when: you want a readable PPO/GRPO stack for models up to about 70B and expect to modify the code.

TRL

What it is: Hugging Face's post-training library on top of Transformers, Accelerate, and PEFT [6].

Architecture

flowchart TB
  U["Your script: GRPOTrainer(model, reward_funcs, dataset)"]
  U --> T["Trainer loop (Transformers Trainer)"]
  T --> ACC["Accelerate: DeepSpeed / FSDP / DDP"]
  T -- "generate" --> G{"vLLM mode"}
  G -- "server" --> S["trl vllm-serve on separate GPUs"]
  G -- "colocate" --> CO["vLLM inside training process"]
  T --> P["PEFT / LoRA (optional)"]

The key part: a Trainer per method

Strengths: lowest barrier to entry; works with any Hugging Face model; LoRA via PEFT; CLI (trl sft, trl dpo); excellent docs; adds new methods from papers quickly.

Watch out: a single Trainer loop is simpler than a Ray dataflow, so large multi-node RL with separate rollout clusters is harder to tune.

Use it when: learning, quick experiments, or single-node / small-cluster runs.

NeMo RL

What it is: NVIDIA's open-source RL library in the NeMo family [7].

Architecture

flowchart TB
  C["Controller: GRPO / DPO / SFT algorithm"]
  C --> E["Environments: math, code, multi-turn games, tools"]
  C --> GEN["Generation workers: vLLM"]
  C --> POL["Policy workers"]
  POL --> B{"Training backend"}
  B --> DT["DTensor: FSDP2 + TP"]
  B --> MG["Megatron-Core: TP / PP / CP / EP"]
  POL -. "weight refit" .-> GEN
  RAY["Ray: placement + workers"] -.- C

The key part: two training backends behind one interface

Strengths: SFT, DPO, reward models, and GRPO in one library; tuned for NVIDIA hardware; scales to large clusters with Megatron.

Watch out: younger and smaller community than verl or OpenRLHF; fits best if you already use NeMo/Megatron.

Use it when: your team trains on the NVIDIA stack and wants Megatron-scale RL with vendor support.

ROLL

What it is: Alibaba's RL framework for large-scale and agentic training [8].

Architecture

flowchart TB
  PL["Pipeline: RLVR / Agentic / DPO"]
  PL --> SCH["Rollout scheduler: per-sample control"]
  SCH --> ENV["Environment workers"]
  SCH --> INF["Actor-infer: vLLM / SGLang strategy"]
  PL --> TR["Actor-train: Megatron / FSDP2 strategy"]
  PL --> RW["Reward workers: math, code, LLM judge"]
  ADM["AutoDeviceMapping"] -. "assigns GPUs to each role" .-> INF
  ADM -.-> TR
  ADM -.-> RW
  TR -. "sync weights" .-> INF

The key part: roles + strategies + AutoDeviceMapping

Strengths: ready pipelines for multi-domain RLVR and agentic RL; fine-grained GPU placement; async options for throughput.

Watch out: smaller English-language community; the role/strategy config takes time to learn.

Use it when: you need agentic RL or precise control over where each role runs on a large cluster.

slime

What it is: the RL framework from Zhipu AI and Tsinghua (THUDM), used to post-train the GLM-4.5 series [9].

Architecture

flowchart LR
  subgraph TRAIN["Training: Megatron"]
    M["Actor (TP / PP / EP)"]
  end
  subgraph BUF["Data buffer"]
    D["Prompts + finished rollouts"]
  end
  subgraph ROLL["Rollout: SGLang"]
    S["SGLang servers + router"]
    F["Custom rollout function"]
  end
  D -- "prompts" --> F
  F --> S
  S -- "samples + rewards" --> D
  D -- "training batch" --> M
  M -- "update weights" --> S

The key part: a data buffer between Megatron and SGLang

Strengths: small, hackable codebase; proven on very large MoE with Megatron's full parallelism; native SGLang server features.

Watch out: Megatron-only training means checkpoint conversion and parallel configs — more setup than FSDP tools.

Use it when: you train very large MoE models with Megatron and want a lean RL loop.

AReaL

What it is: a fully asynchronous RL system from Ant Group and Tsinghua IIIS [10].

Architecture

flowchart LR
  subgraph GEN["Rollout workers (never stop)"]
    G["Generate"]
  end
  subgraph TRN["Trainer workers"]
    T["Decoupled PPO update"]
  end
  G -- "finished samples + policy version" --> Q["Sample queue with staleness filter"]
  Q --> T
  T -- "new weights, loaded mid-generation" --> G
  RW["Reward service"] --> Q
  G --> RW

The key part: generation never waits

Strengths: highest GPU use when answer lengths vary a lot (long reasoning, agents); AReaL-lite offers a small algorithm-first API.

Watch out: async RL is harder to debug and tune; loose staleness limits can hurt stability.

Use it when: generation time dominates your RL steps and you want fully async training.

Key optimizations

These ideas show up across all the frameworks. Each gets one line to remember, then what it actually does.

Async rollout

don't wait for the slowest one

In sync RL, a batch finishes only when its longest answer finishes; the other GPUs sit idle. Async rollout lets finished samples move on to reward and training while long ones keep generating.

Partial rollout

cut the long tail, finish it next round

Very long generations are stopped at a budget, saved, and resumed in the next step instead of blocking this one. A little less freshness for much less waiting.

Rollout server

rollout as a service

The inference engine runs as a server and the trainer calls it like an API. This fits multi-turn agents and tool calls, where one sample needs many back-and-forth generations.

Colocate vs Separate

share the desk or get two desks

GPU placement

seat assignment for roles

A resource pool is a named set of GPUs. Placement decides which role (actor, critic, reference, reward) sits on which pool, and which roles share GPUs.

Resharding

same weights, change clothes

The weights stay the same; only how they are cut across GPUs changes between training and generation. Doing it in place avoids a second full copy and shortens the switch.

Weight sync

send the new playbook to the players

After each update, new weights go to the rollout engine, converted between formats (e.g. Megatron → vLLM). Faster sync means fresher rollouts and shorter pauses.

Model parallelism

split big models so they fit

FSDP2 shards parameters, gradients, and optimizer state; Megatron adds tensor and pipeline parallelism; expert parallelism spreads MoE experts across GPUs.

Memory savers

save memory three ways

Staleness control

a conveyor belt with an expiry date

Samples ride a queue from rollout to trainer. A staleness limit caps how many policy versions old a sample may be; older ones are dropped or down-weighted.

Engine features

borrow, don't rebuild

CUDA Graphs, KV cache management, and continuous batching come from vLLM/SGLang; the RL framework reuses them.

References

  1. verl on GitHub
  2. verl documentation
  3. HybridFlow: A Flexible and Efficient RLHF Framework (arXiv 2409.19256)
  4. verl contribution guide
  5. OpenRLHF on GitHub
  6. TRL on GitHub
  7. NeMo RL on GitHub
  8. ROLL on GitHub
  9. slime on GitHub
  10. AReaL on GitHub
  11. AReaL: A Large-Scale Asynchronous Reinforcement Learning System for Language Reasoning (arXiv 2505.24298)

Edit page
Share this post:

Previous Post
NVIDIA Data Center GPUs from Pascal to Blackwell
Next Post
Parallelism Strategies in Distributed Computing