AI Cloud Architect

Unlocking Stable On-Policy RL on TPU with Bitwise-Zero Train–Inference Mismatch

GoogleHow-to by Yuxuan Zhang, Lin Chai, Lance Wang, Tianshu Bao and Weiren YuGoogle Developers Blog

How we eliminated floating-point train–inference logprob drift for on-policy LLM reinforcement learning across 64 Cloud TPU v5p chips using a generalizable four-part JAX and Pallas recipe in Tunix.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Zero-TIM makes sampler, prefill and trainer compute bitwise-identical logprobs for LLM RL on TPU, using batch-invariant Pallas kernels, ordered cross-shard reductions and custom VJPs in Tunix.

Who it is for

Teams running on-policy LLM reinforcement learning on Cloud TPU with JAX and Tunix who see unstable training from train-inference logprob mismatch.

Key points

  • Verified on 64 TPU v5p chips in a DP8xTP8 mesh with a Qwen3-8B baseline on synthetic FrozenLake.
  • Authors report zero mean absolute sampler-trainer logprob difference in the tested 200-step window; this is a single-seed test.
  • Prototype is part of the open-source Tunix library; the authors say linear-attention and MoE support is in progress.

Timeline

  1. Read firstIntroducing Tunix: A JAX-Native Library for LLM Post-Training · Google · Announcement
  2. This postUnlocking Stable On-Policy RL on TPU with Bitwise-Zero Train–Inference Mismatch

Go deeper