RadixArk's TOP Makes AI Training Bit-Exact at a 10% Speed Cost
SGLang and Miles make the rollout engine and trainer produce bit-identical log-probabilities, eliminating hidden off-policy drift in RL training.
Takeaways
- RadixArk's Miles team achieves bit-exact log-probabilities between SGLang rollouts and trainer, eliminating hidden off-policy drift.
- Verified across DeepSeek-V4/V4.1, GLM-5.2/5.3, and Qwen3 families on Hopper and Blackwell GPUs.
- Standard kernels disagree on 94-98% of tokens per batch, with 0.006-0.0095 log-prob difference at equal weights.
- Whole-step throughput runs at 0.90-0.93x standard on 64 H200s; tensor parallelism not yet supported.
- Uncapped importance weights stay stable with TOP plus routing replay, blow up with standard kernels.
- An agent ported DeepSeek-V4.1 support end-to-end in under 8 hours using the model-support skill.
RadixArk’s Miles team has introduced True On-Policy RL (TOP), a system designed to make reinforcement-learning rollouts and training numerically identical at equal weights. Built on deterministic SGLang work, TOP reportedly produces identical FP32 log-probability bytes for every token across complete training runs.
Rollout engines sample tokens, while trainers recompute their probabilities and update model weights. Those components often use different kernels, batch shapes, reduction orders, precisions, and device layouts. In mixture-of-experts (MoE) models, which route each token to a subset of specialized feed-forward networks, a small numerical difference can change the selected experts and propagate through later layers.
Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO) assume that sampled trajectories came from the policy recorded during rollout. At equal weights, the trainer should assign each token the same probability as the rollout engine. Conventional stacks frequently violate that assumption before policy staleness or optimizer updates enter the calculation.
One operation, one numerical contract
TOP defines numerical contracts for individual operations, including linear projections, attention, MoE routing, and recurrent updates. SGLang applies those contracts during rollout, and Miles applies them during training.
| Contract dimension | Fixed behavior | Drift addressed |
|---|---|---|
| Batch shape | Kernel tiles and reduction order | A token’s result changing with its batch neighbors |
| Serving schedule | Compute order across prefill, decode, prefix-cache hits, and retracted requests | Request scheduling changing floating-point results |
| Placement | Expert combination order across device layouts | Expert-parallel size changing MoE outputs |
Existing correction methods operate after divergence appears. R3 makes the trainer replay the rollout engine’s MoE routing decisions. Truncated importance sampling (TIS) limits the influence of tokens whose recomputed probabilities have drifted. TOP targets the equal-weight divergence that causes those corrections to absorb numerical noise.
Parity across dense, MoE, and recurrent models
The team reports bitwise forward parity through the full depth of every tested model, including runs with speculative decoding. Speculative decoders propose several tokens at once and verify them against the main model, adding another execution path that must preserve the contract.
| Model family | Verified variants | Precision |
|---|---|---|
| DeepSeek | V4-Flash and V4.1-Flash | FP8 |
| GLM | 5.2, 5.3, and 5.3-Flash | FP8 for 5.2 and 5.3; BF16 for 5.3-Flash |
| Qwen | Qwen3 dense, Qwen3.5 family, and Qwen3.8-Flash-Next | BF16 |
Testing covered Nvidia Hopper and Blackwell GPUs. The FP8 configuration uses blockwise quantization with power-of-two scales. DeepSeek-V4.1’s MXFP4 experts are converted to FP8 during loading because Hopper GPUs lack native FP4 execution.
Async RL exposes the gain
Asynchronous reinforcement learning trains on trajectories sampled by older model weights. Its trainer-rollout gap combines policy lag with equal-weight numerical mismatch, and standard importance weights absorb both sources. TOP reduces the reported equal-weight mismatch to zero, allowing measured asynchronous divergence to track policy lag.
In the standard arm, equal-weight trainer and rollout calculations differed by 0.006 to 0.0095 log-probability units per token. That gap measured roughly one-tenth to one-half of the weight-lag term. Between 94% and 98% of tokens produced non-identical log-probability values at the byte level.
- Uncapped TOP and standard execution with R3 produced importance weights in the thousands and lost accuracy during training.
- Combining TOP with R3 kept the run stable by pairing bit-exact operations with replayed expert routing.
- Routing changes caused by stale weights dominated TOP’s remaining tail, making routing replay important for uncapped importance sampling.
- Importance-weight caps can therefore encode a system’s tolerance for policy lag without also compensating for equal-weight kernel drift.
Exactness takes 7% to 10% of step throughput
Fixed tiles, reduction orders, and execution schedules can select slower kernels than the standard serving path. On 64 H200 GPUs, TOP reduced complete-step throughput by 7% to 10%. Rollout-only throughput fell by 12% to 21%.
| Model | Whole-step throughput | Rollout-only throughput |
|---|---|---|
| DeepSeek-V4-Flash | 0.90× standard | 0.79× standard |
| GLM-5.2 | 0.93× standard | 0.88× standard |
Operation-level profiling identifies attention, MoE matrix multiplication, and recurrent execution as the main latency sources.
| Cost source | Reported impact |
|---|---|
| GLM-5.2 decode attention | Adds 2.2 to 2.8 ms per iteration because decode uses the prefill sparse-attention kernel |
| Qwen3.6 MoE matrix multiplication | Adds 1.3 to 1.7 ms per iteration |
| Qwen3.6 recurrent layers (GDN) | Adds 0.5 ms with one request and 2.0 ms with 128 requests |
| Tensor parallelism | Unsupported in the reported implementation, limiting single-request latency optimization |
The operation breakdown labels one profiled model as Qwen3.6, while the published parity list names Qwen3, Qwen3.5, and Qwen3.8-Flash-Next. The project materials will need to resolve that naming discrepancy for reproducible comparisons.
FP8 training needs a shifted grid
FP8 checkpoints introduce a quantization problem when higher-precision master weights begin at the center of their rounding cells. Small optimizer updates can accumulate without moving a re-quantized weight into the next FP8 value, causing the effective FP8 model to remain unchanged for multiple steps.
TOP applies a one-time deterministic offset to each master weight while keeping it inside the same initial rounding cell. The represented FP8 checkpoint value remains unchanged at initialization, and subsequent updates cross quantization boundaries sooner.
An agent completed a model port in 7 hours 51 minutes
The operation-level contract also turns model integration into a sequence of explicit implementation and verification tasks. In one case study, Claude Opus 5.5 at high effort added DeepSeek-V4.1 from its release checkpoint during a single session on one eight-GPU H200 node.
The agent implemented every operation and the model-family binding, matched rollout log probabilities exactly, and verified the full checkpoint with DSpark. DSpark is the model’s speculative decoder, so the test also covered candidate-token acceptance and verification.
The port used a written skill file and took 7 hours 51 minutes. The agent had no access to internal notes or web search. Human intervention was limited to two skill-file updates after the run exposed missing checks: one for gradients through quantized forward passes and another for speculative-decoding acceptance length. Those checks were then retained for later ports.
A cleaner boundary for RL systems
TOP gives reinforcement-learning pipelines a way to separate implementation drift from policy staleness. That distinction is especially relevant to asynchronous training, MoE systems where routing changes can cascade, and long-horizon agent runs where small per-token probability differences accumulate across many turns.
Weight staleness, reward variance, estimator variance, optimizer behavior, and routing changes caused by updated weights remain part of the training problem. TOP isolates the numerical disagreement created by running the same weights through different execution paths.
The team says the code, model-support skill, and launch recipes will ship through SGLang branches and the Miles repository. The reported implementation still carries measurable throughput costs, lacks tensor parallelism, and has been validated only on the named model families and GPU generations. Broader adoption will depend on the release artifacts and independent reproduction of the bit-exact results.