Inside Miles v0.1: The Production-Grade RL Post-Training Architecture for Trillion-Parameter MoE Models
An architectural deep dive into Miles v0.1 by LMSYS and RadixArk: scaling asynchronous RL post-training for 700B+ MoE models using SGLang rollouts, Rollout Routing Replay (R3), and Megatron-LM.
By Manoranjan Mishra · 21 Aug 2026 · 5 min read

Inside Miles v0.1: The Production-Grade RL Post-Training Architecture for Trillion-Parameter MoE Models
In August 2026, the artificial intelligence landscape experienced a quiet but monumental shift: while frontier labs release massive open-weight models weekly, the real engineering battleground has shifted from pre-training to post-training Reinforcement Learning (RL). Aligning 700B+ Mixture-of-Experts (MoE) models via multi-turn terminal feedback, compiler checks, and self-play reasoning requires running asynchronous policy updates across hundreds of GPUs.
However, training massive MoE models with RL has historically suffered from a fatal systems flaw: training-inference divergence. Subtle numerical discrepancies between the high-throughput inference engine (rollout) and the distributed training framework cause expert routing decisions to flip during backward passes, distorting gradient updates and destabilizing policy optimization.
To solve this, LMSYS Org and RadixArk released Miles v0.1—a production-grade reinforcement learning post-training framework that seamlessly unifies SGLang for async multi-turn rollouts, NVIDIA Megatron-LM (and PyTorch FSDP2) for distributed training, and Ray for cluster orchestration.
Here is an architectural deep dive into Miles v0.1, its Rollout Routing Replay (R3) mechanism, and how it enables asynchronous RL on trillion-parameter models.
1. The Miles RL Post-Training Architecture
Miles restructures the traditional RL loop into an asynchronous pipeline optimized for long-horizon agentic trajectories:
flowchart TD
TaskEnv(["Agentic Environment: Terminal Sandbox / Compiler Verification"]) --> RolloutFleet
subgraph SGLangRolloutFleet["Asynchronous Rollout Engine (SGLang)"]
RolloutFleet["1. SGLang Inference Fleet (Prefix-Cache Reuse > 96%)"]
RolloutFleet --> TrajectoryCapture["2. Token-In-Token-Out (TITO) & Trajectory Buffer"]
TrajectoryCapture --> R3_Record["3. Record Exact Expert Routing Indices"]
end
R3_Record --> RayBuffer["4. Shared Ray Memory Queue (Async Sample Shuffling)"]
subgraph TrainingEngine["Distributed Training Engine (Megatron-LM / FSDP2)"]
RayBuffer --> R3_Replay["5. Rollout Routing Replay (R3) Gradient Execution"]
R3_Replay --> NVMeStreaming["6. NVMe / CPU Optimizer State Bucket Streaming"]
NVMeStreaming --> LossBackward["7. PPO / GRPO Policy Gradient Computation"]
end
LossBackward --> WeightBroadcast["8. Non-Blocking Live Weight Synchronization"]
WeightBroadcast --> RolloutFleet
- Rollout (SGLang): Generates multi-turn agent interactions in sandboxed environments, leveraging RadixAttention to achieve over 96% prefix-cache hit rates.
- R3 Capture: Records the exact expert gating choices made by SGLang for every token.
- Training (Megatron-LM): Consumes trajectory batches, replays the exact recorded routes, and computes policy updates without routing divergence.
- Weight Sync: Streams updated policy weights back to the SGLang fleet asynchronously without stalling in-flight agent sessions.
2. Solving MoE Divergence: Rollout Routing Replay (R3) & TITO
In dense model RL, slight numerical variations between rollout and training engines are often tolerated. In sparse MoE models, however, a tiny difference in router logits flips the top-$k$ expert assignment:
- Gradient Misallocation: Gradients intended for Expert 4 get applied to Expert 12.
- Catastrophic Policy Drift: The training engine updates expert weights that were never used during the rollout pass.
sequenceDiagram
autonumber
actor Env as Sandboxed Terminal Agent
participant SGLang as SGLang Rollout Worker
participant Ray as Ray Buffer (Shared Memory)
participant Trainer as Megatron-LM Trainer (GB300 Node)
Env->>SGLang: Multi-Turn Python Debugging Trace (Turn 4)
SGLang->>SGLang: Route Tokens to Experts [4, 18] via Top-2 Softmax
SGLang->>Ray: Push Trajectory + Exact Route Indices `[4, 18]` + Raw Token IDs (TITO)
Ray->>Trainer: Dequeue Batch (65K Sequence Length)
Trainer->>Trainer: Replay Exact Routes `[4, 18]` (Zero Routing Drift)
Trainer->>Trainer: Compute Policy Loss & Stream Optimizer Buckets from NVMe
Trainer-->>SGLang: Broadcast Synchronized Policy Weights
A. Rollout Routing Replay (R3)
Miles records SGLang's expert routing choices during the forward rollout pass and replays them directly in Megatron-LM, ensuring bit-exact alignment between the model that experienced the reward and the model receiving gradients.
B. Token-In-Token-Out (TITO)
Miles preserves raw token IDs generated by the model rather than de-tokenizing to text. This eliminates chat-template re-serialization bugs that alter token boundaries between agent turns.
3. Mathematical Optimization: Memory Scaling & NVMe Streaming
Training a 744B-parameter MoE asynchronously across multiple nodes creates massive GPU High-Bandwidth Memory (HBM) pressure:
$$\mathcal{M}{\text{total}} = \mathcal{M}{\text{weights}} + \mathcal{M}{\text{gradients}} + \mathcal{M}{\text{optimizer_states}} + \mathcal{M}_{\text{activations}}$$
For a 744B model in FP8, Adam optimizer states alone consume over 2.9 Terabytes of memory.
Miles implements Asynchronous NVMe Bucket Streaming:
- Optimizer states are offloaded to node-local NVMe SSDs or host CPU memory.
- During each optimizer step, parameter buckets are streamed to GPU SRAM on-demand and flushed back immediately:
$$\mathcal{M}{\text{GPU_resident}}^{\text{optimizer}} = \frac{1}{B{\text{buckets}}} \times \mathcal{M}{\text{total_optimizer}} \ll \mathcal{M}{\text{HBM_capacity}}$$
In reference benchmarks, this optimization saves 30+ GB of HBM per GPU, allowing an asynchronous training engine for a 744B model to fit on just 32 NVIDIA GB300 GPUs.
4. Reference Benchmark: Training GLM-5.2 (744B MoE) on Terminal Tasks
LMSYS verified Miles v0.1 by training a 744B-parameter GLM-5.2 model on terminal coding workflows across a 64x NVIDIA GB300 cluster (32 GPUs for SGLang rollout, 32 GPUs for Megatron-LM training):
| Benchmark Vector | Standard RL Frameworks | Miles v0.1 Production RL | Advantage |
|---|---|---|---|
| MoE Routing Divergence Rate | 4.2% – 8.7% (Routing Flips) | 0.0% (Via R3 Replay) | Bit-Exact Alignment |
| Rollout Prefix-Cache Hit Rate | ~40% (Unbalanced Schedulers) | 96.0% (SGLang Session Routing) | 2.4x Faster Rollout |
| GPU Requirement (744B MoE) | 128+ Enterprise GPUs | 64 GPUs (32 Rollout / 32 Train) | 50% Infrastructure Savings |
| Step Time Stability | High Variance / Stalls | ~4.5 min / step (Fully Async) | Deterministic Convergence |
| Hardware Support | NVIDIA CUDA Only | NVIDIA (Blackwell/Hopper) + AMD (ROCm MI355X) | Cross-Vendor Parity |
5. Frequently Asked Questions (FAQ)
What is the relationship between Miles and slime?
Miles v0.1 was developed as a production fork of THUDM's slime, restructuring the codebase for trillion-parameter MoE scale, SGLang rollout integration, and low-precision Blackwell recipes.
Can Miles run on AMD Instinct GPUs?
Yes. Miles includes native AMD ROCm support (MI300X and MI355X) via HIP and RCCL, running the identical training and SGLang rollout pipeline verified under continuous integration.
6. Conclusion
As frontier artificial intelligence advances toward self-improving reasoning agents, the infrastructure that powers post-training reinforcement learning is just as critical as pre-training superclusters. Miles v0.1 by LMSYS and RadixArk establishes the open-source industry standard for scaling stable, verified, and low-precision RL to trillion-parameter models.
(Cover Image Courtesy: Unsplash / High-Density Datacenter Supercomputing & GPU Interconnect)
- #Reinforcement Learning
- #LMSYS
- #Miles
- #SGLang
- #AI Infrastructure
- #MoE
- #Machine Learning
Manoranjan Mishra
Written by the team at Lobhari, a software development company in Bhubaneswar building web, mobile and AI products. Meet the team.
Need help with your own build? Explore custom software development or get an estimate.
Related posts

Engineering
Google Gemini 3.8 Flash & 3.8 Flash Cyber: Deep Dive into Architecture, Benchmarks & Autonomous Cyber Defense
An in-depth technical analysis of Google's Gemini 3.8 Flash and Gemini 3.8 Flash Cyber: 73.7% DeepSWE scores, recursive agentic diligence, 86.2% CyberGym vulnerability discovery, and 1M-token context engineering.
2 Sept 2026 · 8 min read

Engineering
GLM-5.3 & The Rise of Cyber-Capable AI: Automated Vulnerability Discovery & Defensive Architecture
An architectural deep dive into Zhipu AI's GLM-5.3: a 743B open-weight foundation model scoring 84.5% on CyberGym, automating zero-day vulnerability discovery, and reshaping enterprise DevSecOps.
21 Aug 2026 · 4 min read

Engineering
DeepSeek V4-Pro GA & V4-Flash: Inside the 1.6T MoE Architecture, 384K Output Limits & Agent Economics
An architectural deep dive into DeepSeek V4-Pro GA (1.6T MoE) and V4-Flash: 384K output token limits, 87.9% Terminal-Bench scores, and peak/off-peak agent pricing economics.
21 Aug 2026 · 4 min read