Datacurve traces 12% agent RL token-probability drift to MoE summation order
Datacurve traced 12% token-probability drift in long-horizon agent RL to MoE summation order. Its revised Qwen training stack reduced batch waits and raised held-out pass@1 from 34% to 42%.

TL;DR
- Identical trainer forwards changed sampled-token probabilities by 12% on average; Datacurve traced the drift to nondeterministic MoE summation and made repeated passes bitwise identical.
- Starting the next rollout batch on idle engines nearly halved the wait between batch completions, while preserving the one-policy-update staleness limit.
- After the infrastructure fixes, held-out repository pass@1 rose from 34% to 42% over 27 updates, according to Datacurve's results.
One agent deleted /tmp and its command supervisor's state. A sparse-attention selector silently returned the wrong history blocks at 200k tokens.
MoE summation order
Datacurve finetuned Qwen3.8-Flash-Next, a 176B-parameter hybrid MoE, at 256k context on 128 H200 GPUs for its long-horizon software experiments. On a fixed 200k-token trajectory, repeated trainer forwards disagreed even with identical weights, tokens and expert choices.
The technical report identifies the reduction that combines weighted expert outputs:
- Original implementation: Megatron used BF16 atomic adds, with summation order determined by GPU scheduling. About 6% of the combine operation's output values changed between calls.
- Forward fix: Stably sort expert outputs, accumulate in FP32, then round to BF16.
- Backward fix: Replace atomic adds with gathers.
Determinism was cheap here: repeated forwards matched bit-for-bit with a 0.6% slowdown in the forward pass.
Rollout scheduling and recovery
Datacurve bounded rollout staleness to one policy update to limit confounding in its environment experiments. Long-running episodes left much of the serving fleet idle.
Its scheduling and recovery changes addressed two sources of wasted time:
- Stragglers: The longest rollout group generated 99% of its tokens within two hours, then needed another 51 minutes. GPU utilization fell to 1.8% during that tail.
- Early starts: Freed engines began next-batch episodes up to 81 minutes before the current batch finished. Datacurve estimates this advanced the next batch's completion by 50 minutes, preserving complete trajectories and fixed batch membership.
- Infrastructure faults: Only the affected episode was regenerated, under its original sampling policy. Across a projected 50-update run, this added about 2.5 hours, versus 10 to 20 hours for checkpoint restarts.
Policy-caused failures, including exhausting sandbox memory or time limits, remained in the batch. Replacing those failures would bias training toward shorter episodes.
LoRA merging
Datacurve trained separate adapters on each MoE expert, totaling about 5.5B trainable parameters, as described in its training write-up. Serving and synchronizing those adapters exposed another precision trap:
- Unmerged serving: In earlier 30B-model experiments, stock SGLang adapter serving nearly doubled rollout time relative to the base model.
- Merged serving: Folding adapters into base weights restored speeds near the baseline.
- Incremental BF16 merges: Updates averaged 40 times smaller than the spacing between neighboring representable weights. About 78% failed to change the served weight.
- Revised synchronization: Rebuild merged weights from a pristine base copy at every sync, then use FP16 training and inference kernels to preserve smaller changes.
FP16 supplies three additional mantissa bits, giving eight times finer spacing, but a narrower exponent range. That trade-off resurfaced in backpropagation.
Sparse-attention selection
At 200k tokens, compressed history could contain roughly 65,000 blocks. SGLang's fast selector used a 4,096-entry radix buffer and silently discarded candidates, according to Datacurve's investigation.
The replacement progressed through two implementations:
- Crop each query to its visible prefix and use
torch.topk, restoring numerical correctness at a performance cost. - Implement bufferless, GPU-only masked top-k, matching the corrected scores and restoring CUDA graphs.
At batch size eight, decode throughput rose from 50 to 275 tokens/s, a 5.5× improvement over the corrected eager implementation.
Gradient underflow
Policy entropy still collapsed over roughly a dozen updates after forward repeatability and trainer-sampler agreement improved. Datacurve tested gradient linearity by splitting a fixed batch into four sets, zeroing advantages outside each set, and summing the resulting partial gradients.
Their sum differed from the full-batch gradient by about 50%.
The backward-pass diagnosis found that normalizing loss by token count before backpropagation caused FP16 activation-gradient underflow on long batches. Gradients differed from higher-precision references by 36%, compared with about 10% on the shorter SWE-Gym control.
Changes to residual-stream precision and per-layer gradient scaling restored healthy learning, Datacurve reported.
Held-out repositories
Datacurve's evaluation used eight attempts per task across three sets:
- 128 held-out tasks from its software-engineering corpus.
- All 113 public DeepSWE tasks.
- 164 tasks from 150 repositories absent from training.
On the unseen-repository set, pass@1 increased from 34% to 42% over 27 updates.
Gains were concentrated where the base model already had some competence: approximately 11.8 percentage points on tasks with roughly 47% baseline success, versus 3.4 points on tasks with roughly 18% baseline success.
Training also reduced malformed tool calls and context-window overruns. Datacurve distinguishes those reliability improvements from gains in software problem-solving.
UltraTerminal task screening
UltraTerminal separately screens environments for attempts with differing rewards, the signal GRPO learns from, according to its release announcement. Its published task inventory separates three stages:
- 2,597 validated: Reference solutions pass and empty answers fail.
- 1,305 scored: 505 solved, 580 mixed-outcome and 220 unsolved tasks.
- 502 reviewed: Blind review against nine criteria.
The release also reported two Pi-adapter results on Terminal-Bench 2.1:
- Qwen3.8-27B: Pass@1 increased from 39% to 55%, a 16-point gain.
- Inkling 2 Mini: Reached the base model's one-hour pass@3 in 25 minutes; with a full hour, scored 70.8%, up from 56.2%.
A follow-up reply also reported a multi-harness adapter with similar scores. The dataset card adds a narrower qualification: only the 502 knowledge_work tasks passed the nine-point review, and the coding baseline retains its source's quarantine_only label.