Behavioral equivalence gates for agent-led ML codebase conversion
ML platform teams using agents to migrate PyTorch training code to JAX should add a small fixed verifier before accepting a conversion. The gate should check the public training interface, numeric values such as losses and gradients, and a short seeded training trace. T2J-Bench shows why compile and smoke tests are too weak for this job: Claude Code with Opus 4.7 reached 91.1% Spec pass@1, then fell to 26.7% overall after Numeric and Behavioral checks. All evaluated systems also overestimated their own success by 66.6 to 97.8 percentage points against the fixed verifier.
A cheap pilot is one migrated training loop with bounded configs, tiny data, fixed seeds, and stored expected tensors from the source implementation. The pass condition should be observable training behavior, not the agent’s report or a single finite loss. This gives teams a practical acceptance test for modernization work where silent semantic drift can waste training runs or corrupt downstream experiments.