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

DevFeed: [Unlocking Stable On-Policy RL on TPU with Bitwise-Zero Train-Inference Mismatch](<https://devfeed.tech/articles/unlocking-stable-on-policy-rl-on-tpu-with-bitwise-zero-train-inference-mismatch-136559.md>)

Original publisher: [Read original article](<https://developers.googleblog.com/unlocking-stable-on-policy-rl-on-tpu-with-bitwise-zero-traininference-mismatch/>)

Author: Yuxuan Zhang; Lin Chai; Lance Wang; Tianshu Bao; Weiren Yu

Published: 2026-11-17T05:43:32.994674Z

Content type: article

Language: en

Sources: [Google Developers Blog](<https://devfeed.tech/sources/google-developers-blog.md>)

Topics: [Reinforcement learning](<https://devfeed.tech/topics/reinforcement-learning.md>), [AI Infrastructure](<https://devfeed.tech/topics/ai-infrastructure.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>)

Tags: [absolute](<https://devfeed.tech/tags/absolute.md>), [chips](<https://devfeed.tech/tags/chips.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [cloud-tpu](<https://devfeed.tech/tags/cloud-tpu.md>), [drift](<https://devfeed.tech/tags/drift.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [inference](<https://devfeed.tech/tags/inference.md>), [jax](<https://devfeed.tech/tags/jax.md>), [learning](<https://devfeed.tech/tags/learning.md>), [llm](<https://devfeed.tech/tags/llm.md>), [policy](<https://devfeed.tech/tags/policy.md>), [recipe](<https://devfeed.tech/tags/recipe.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [rl](<https://devfeed.tech/tags/rl.md>), [stable](<https://devfeed.tech/tags/stable.md>), [tpu](<https://devfeed.tech/tags/tpu.md>), [train](<https://devfeed.tech/tags/train.md>), [using](<https://devfeed.tech/tags/using.md>), [with](<https://devfeed.tech/tags/with.md>), [zero](<https://devfeed.tech/tags/zero.md>)

## AI overview

Zero-TIM aims to eliminate numerical drift between rollout sampling and training in on-policy LLM reinforcement learning. In Tunix, it aligns sampler decode, serving prefill, and trainer logprobs bit for bit by fixing within-shard kernel accumulation and precision, ordering cross-shard reductions, standardizing action logprob scoring, and reusing serving forward kernels with custom differentiation rules. The implementation preserves sampled token IDs across environment turns and constrains excess compiler precision. On a synthetic FrozenLake test using Qwen3-8B across 64 TPU v5p chips, Zero-TIM reported zero mean absolute sampler-trainer logprob difference at each logged step and higher observed solve rates than Standard training and token-level truncated importance sampling; those approaches retained nonzero mismatch, which TIS adjusts for rather than removes. The excerpt presents this as a modular JAX/XLA and Pallas recipe for multi-host TPU stacks, with linear-attention and MoE support still being extended.

## Source excerpt

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.