AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks
Technology

AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks

A new benchmark evaluating AI translation of PyTorch code to Google TPUs reveals that top models achieve a 31 percent success rate.

By James Whitmore
Published:
Email this Article
AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks
Overview of XStack. Top: in our benchmark, the agent explores a PyTorch repository built for GPUs, reads its code and runs the source, then builds and tests a JAX version on TPUs. Bottom left: pass rates of the 5 best-performing agents among the 7 we evaluate. Bottom right: the pass rates against total cost on a log scale; the dashed line is a linear fit, and the shaded steps are the Pareto frontier, the best pass rate reached at or below each cost. Linrong Cai et al. / arXiv

Artificial intelligence coding agents are attempting to translate entire machine learning codebases from PyTorch on NVIDIA graphics cards to JAX on Google tensor processing units, revealing a major hurdle in hardware portability. While researchers frequently want to run successful experiments on whatever hardware they have available, shifting a whole repository across software stacks involves rebuilding models, optimizers, and data pipelines under an entirely different compiler and memory architecture. To measure how well automated systems handle this challenge, computer scientists introduced a benchmark called XStack, which tests AI agents on migrating 20 real machine learning repositories.

How the Cross-Stack Benchmark Evaluates AI Coding Agents

The evaluation framework supplies each coding agent with a working PyTorch repository pinned to a specific Git commit and a clean machine powered by tensor processing units, or TPUs, which are specialized accelerator chips built by Google. The agents must install all necessary packages, write setup scripts, translate the model using libraries like Flax and Optax, and deliver a fully functional JAX repository capable of running the original experiments from scratch. To ensure fair grading without giving away the exact numerical answers beforehand, the researchers implemented a two-phase system. If an agent fails its first attempt because it ran a different valid experiment variant, a second phase reveals the primary experiment recipe while keeping the target metric hidden. Every submission is then transferred to a freshly wiped machine and executed to check whether it reaches the published benchmark results.

Figure 2: Pipeline of XStack. Top: the agent migrates a PyTorch repository to JAX on a bare TPU. Bottom: we rerun the output on a fresh TPU and check its number against the source’s result and with two model judges. If they fail, the alignment step (phase 2, pink) gives the agent the main experiment’s recipe, lets it change only the entry script, and regrades the result. A pass also needs the weights to load into the original PyTorch model.
Pipeline of XStack. Top: the agent migrates a PyTorch repository to JAX on a bare TPU. Bottom: we rerun the output on a fresh TPU and check its number against the source’s result and with two model judges. If they fail, the alignment step (phase 2, pink) gives the agent the main experiment’s recipe, lets it change only the entry script, and regrades the result. A pass also needs the weights to load into the original PyTorch model. Credit: Linrong Cai et al. / arXiv

Why Verification Remains the Biggest Bottleneck for Code Migration

When evaluated across seven frontier models from five major artificial intelligence laboratories, the overall success rate reached just 31 percent across 140 tested cells, according to a study published in an arXiv preprint server. Claude Opus 5 led the field by successfully migrating 15 out of 20 repositories, achieving a 75 percent pass rate. GPT-5.6-sol followed with 45 percent, while DeepSeek V4.1 Flash also managed 40 percent. Other models scored significantly lower, struggling with runtime crashes, fidelity gaps where models fell short of target metrics, and verification failures. The authors noted that translation alone is rarely the hardest part, because automated agents can easily convert code when tested on identical hardware. The true difficulty lies in coordinating framework conversions alongside hardware migrations, where agents must set up unfamiliar virtual machine environments and verify that their code actually works under real-world conditions. Furthermore, the data showed that an agent’s accuracy scales predictably with its computing cost, rising by roughly 25 percentage points for every tenfold increase in expenditure.

The study was posted to the arXiv preprint server on November 5, 2026.

Fact Checked

This article has been fact checked for accuracy, with information verified against reputable sources. Learn more about us and our editorial process.

Last reviewed on .

Article history

  • Latest version

Reference(s)

  1. Cai, Linrong. “XStack: A Benchmark for ML Repo Migration.” arXiv.org <http://arxiv.org/abs/2611.08472v1>.

Cite this page:

Whitmore, James. “AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks.” BioScience. BioScience ISSN 2521-5760, 08 November 2026. <https://www.bioscience.com.pk/en/subject/technology/xstack-a-benchmark-for-ml-repo-migration>. Whitmore, J. (2026, November 08). “AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks.” BioScience. ISSN 2521-5760. Retrieved November 08, 2026 from https://www.bioscience.com.pk/en/subject/technology/xstack-a-benchmark-for-ml-repo-migration Whitmore, James. “AI Coding Agents Struggle to Migrate Machine Learning Repositories Across Hardware Stacks.” BioScience. ISSN 2521-5760. https://www.bioscience.com.pk/en/subject/technology/xstack-a-benchmark-for-ml-repo-migration (accessed November 08, 2026).
End of the article