Skip to content

T2J-BENCH: Benchmarking Coding Agents on Execution-Grounded PyTorch-to-JAX Repository Migration

May 2026 · 0 citations · 81 references
Computer Science

TL;DR

T2J-BENCH is introduced, a benchmark of 63 whole-repository PyTorch-to-JAX migration tasks spanning 18 model families across both training and serving, and TWINHARNESS, a reference-grounded agent harness that turns the agent's executable PyTorch source into legitimate self-verification feedback.

Abstract

Migrating a machine-learning codebase across frameworks--for example from PyTorch to JAX--is a routine but costly engineering task that is fundamentally cross-paradigm: eager, stateful, object-oriented modules must be rewritten as pure, jittable functions over an explicit parameter pytree. We ask whether coding agents can perform such whole-repository migrations correctly, and argue that existing code benchmarks, which grade unit-test pass rates or surface-level similarity to a reference translation, cannot answer this: they neither require the migrated system to \emph{behave} the same nor prevent a JAX reimplementation from faking equivalence by secretly importing PyTorch itself. We introduce T2J-BENCH, a benchmark of 63 whole-repository PyTorch-to-JAX migration tasks spanning 18 model families across both training and serving, where torch-free checkpoint conversion is itself part of the deliverable. T2J-BENCH grades execution-grounded functional equivalence: each candidate is run inside a separate, torch-free, offline verifier and scored against references frozen from the PyTorch original, under a hard independence gate and a continuous, threshold-free reward. Across twenty off-the-shelf agent--model configurations, the strongest recovers only 0.676 of the reward against a 0.980 oracle, with substantial numeric and behavioral divergence despite high spec pass rates. Finally, we contribute TWINHARNESS, a reference-grounded agent harness that turns the agent's executable PyTorch source into legitimate self-verification feedback; applied to an opus-5 agent it raises the reward from 0.649 to 0.723--the highest of any configuration--using only task-visible resources.

View source

Similar papers

Preprint Oct 2026

WEAVE: Weaving Real-World Code Evolution into Dependency-Structured Tasks for Benchmarking and Training Code Agents

Real-world software engineering rarely consists of isolated changes. Features, migrations, and systematic fixes often unfold across multiple pull requests (PRs), requiring coordinated modifications across a repository. Yet most executable repository-level benchmarks retain a single issue or PR as the task unit, while e...

Wei-Hao Li, Zi-Hang Xu, Zhong-Qiu Wang et al. · 3 citations
Preprint Oct 2026

FrontierRefactor: Benchmarking Multi-Scale Performance-Oriented Codebase Refactoring

Autonomous codebase refactoring requires coding agents to restructure working software while strictly preserving externally observable behavior and prioritizing execution performance and compute efficiency over stylistic preference. Existing benchmarks: refactoring benchmarks assess functional correctness while overloo...

Shi-Jian Wang, Fan-Qing Meng, Jiajun Chen et al. · 0 citations
Preprint Oct 2026

ICALL-BENCH: Benchmarking LLM Interprocedural Reasoning in Binary Programs

Recent benchmarks show that LLMs achieve strong performance in both function-level binary understanding and end-to-end binary reverse engineering tasks, but whether LLMs can reason over interprocedural semantics in compiled binaries remains unclear. Function-level benchmarks offer limited visibility into cross-function...

Sheng-Long Yao, Zi-Rui Liu, Xiang-Chi Yuan et al. · 0 citations
Preprint Oct 2026

HPCAgent-Bench: A Framework for Sound Benchmarking of Code-Optimizing Agents, Harnesses, and Skills

Coding agents are increasingly used to optimize code, but existing benchmarks fix one accelerator, programming model, or harness, so they cannot isolate what each component contributes or show whether added skills and tools repay their cost. We present HPCAgent-Bench with 722 kernels in three tracks: loop-level optimiz...

Yakup Budanaz, Lorenzo Paleari, Marcin Copik et al. · 0 citations
Open access Nov 2026

Beyond synthetic benchmarks: evaluating LLM performance on real-world class-level python code generation

This work introduces RealClassEval, a benchmark derived from real-world open-source repositories, comprising 400 classes divided into seen and unseen partitions based on model training cutoffs, and establishes the diagnostic foundation necessary for advancing both fundamental LLM capabilities and sophisticated reposito...

Musfiqur Rahman, Sayedhassan Khatoonabadi, E. Shihab · 1 citation
#machine learning Preprint Oct 2026

MetaKernelBench: Measuring GPU Kernel Knowledge Transfer Beyond Code

Recent GPU kernel optimization agents retain what they learn in knowledge bases or as distilled skills. Kernel benchmarks score each attempt's implementation for correctness and speed but leave the reuse value of retained experience unmeasured. We introduce MetaKernelBench, which measures whether experience distilled f...

Xueyi Chen, Shi-Yu Liu, Xing-Yu Jin et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Dec 1, 2026

A new form of memory helps robots learn complex skills

The method uses large vision-language models to teach smaller models how to remember key details about a robot’s surroundings, making the machines more reactive and resourceful.

MIT News · Artificial Intelligence Nov 23, 2026

Many languages, one common neural code

Analyzing speakers of 21 languages, an MIT study using multilingual AI finds the human brain may represent meaning in much the same way.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.