ParaCodex : A Profiling-Guided Autonomous Coding Agent for Reliable Parallel Code Generation and Translation
Erel Kaplan 1 Tomer Bitan 1 Lian Ghrayeb 1 Le Chen 2 Tom Yotam 3 Niranjan Hasabnis 3 Gal Oren 1,4 1 Technion – Israel Institute of Technology, Haifa, Israel 2 Argonne National Laboratory, Lemont, USA 3 Code Metal, USA 4 Stanford University, Stanford, USA {erel.kaplan, tomerbitan, lian.ghrayeb}@campu · 2026
Read ParaCodex : A Profiling-Guided Autonomous Coding Agent for Reliable Parallel Code Generation and Translation by Erel Kaplan 1 Tomer Bitan 1 Lian Ghrayeb 1 Le Chen 2 Tom Yotam 3 Niranjan Hasabnis 3 Gal Oren 1,4 1 Technion – Israel Institute of Technology, Haifa, Israel 2 Argonne National Laboratory, Lemont, USA 3 Code Metal, USA 4 Stanford University, Stanford, USA {erel.kaplan, tomerbitan, lian.ghrayeb}@campu (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-04327.txt.
Introduction
Erel Kaplan and six co-authors present ParaCodex, an autonomous coding agent built to write parallel programs that are both correct and fast, in a 2026 arXiv paper. The hard target is OpenMP GPU offload, where moving data on and off the graphics processor dominates results and unaided AI agents often produce brittle code.
ParaCodex wraps a Codex-based agent in a working engineer's routine. Find the hot spots first, plan the data movement explicitly, gate every version on correctness, then refine using real profiles from the target hardware. Translating serial processor kernels on three benchmark suites, it succeeded on every valid kernel tried but five excluded ones. Beating the reference OpenMP versions in most cases with several-fold average speedups on two suites. A second test, translating CUDA code to OpenMP, kept high compile and validation rates.
Catalog record
| CREATOR | Erel Kaplan 1 Tomer Bitan 1 Lian Ghrayeb 1 Le Chen 2 Tom Yotam 3 Niranjan Hasabnis 3 Gal Oren 1,4 1 Technion – Israel Institute of Technology, Haifa, Israel 2 Argonne National Laboratory, Lemont, USA 3 Code Metal, USA 4 Stanford University, Stanford, USA {erel.kaplan, tomerbitan, lian.ghrayeb}@campu |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 73 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-04327
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
ParaCodex : A Profiling-Guided Autonomous Coding Agent for Reliable Parallel Code Generation and Translation Erel Kaplan 1 Tomer Bitan 1 Lian Ghrayeb 1 Le Chen 2 Tom Yotam 3 Niranjan Hasabnis 3 Gal Oren 1,4 1 Technion – Israel Institute of Technology, Haifa, Israel 2 Argonne National Laboratory, Lemont, USA 3 Code Metal, USA 4 Stanford University, Stanford, USA {erel.kaplan, tomerbitan, lian.ghrayeb}@campus.technion.ac.il [email protected] , {tom, niranjan}@codemetal.ai , [email protected] Abstract Parallel programming is central to HPC and AI, but producing code that is correct and fast remains challenging, especially for OpenMP GPU offload, where data movement and tuning dominate. Autonomous coding agents can compile, test, and profile on target hardware, but outputs are brittle without domain scaffolding. We present ParaCodex , an HPC-engineer workflow that turns a Codex-based agent into an autonomous OpenMP GPU offload system using staged hotspot analysis, explicit data planning, correctness gating, and profiling-guided refinement. We evaluate translation from serial CPU kernels to OpenMP GPU offload kernels on HeCBench, Rodinia, and NAS. After excluding five kernels, ParaCodex succeeded on all 31 valid kernels. The generated kernels improved GPU time over reference OpenMP implementations in 25/31 cases, achieving geometric-mean speedups of 3 × \times on HeCBench and 5 × \times on Rodinia, and outperforming a zero-shot Codex baseline on all suites. We also evaluate CUDA → \rightarrow OpenMP offload translation on ParEval, where ParaCodex maintains high compilation and validation rates in code-only and end-to-end settings 1 1 1 ParaCodex repository: https://github.com/Scientific-Computing-Lab/ParaCodex . 1 Introduction Parallel programming is central to modern high-performance computing, but producing parallel implementations that are both correct and fast remains arduous. In practice, developers face two recurring needs: introducing parallelism into serial kernels to exploit CPUs and GPUs, and migrating existing parallel code between programming models to improve portability and maintainability. Crucially, this work studies tool-using LLM code autonomous agents for program transformation: systems that do not stop at text-only code generation, but iteratively compile, test, and profile their outputs on target hardware, using structured intermediate artifacts (e.g., hotspot analyses and data plans) and environment feedback as first-class signals for refinement ( 20 ) . Classical automation tools like polyhedral compilers ( 5 ; 17 ) reduce manual effort but struggle with non-affine loops and ambiguous pointer aliasing, often requiring expert intervention to inject pragmas or resolve dependencies ( 22 ; 37 ) . Conversely, while Large Language Models (LLMs) can generate plausible OpenMP directives, they lack the system-level awareness to manage data movement efficiently ( 39 ; 3 ; 15 ) . A common failure mode is “thrashing,” where an LLM correctly parallelizes a loop but fails to map a helper function or hoist data allocations, causing the runtime to implicitly copy arrays back and forth between CPU and GPU at every iteration, yielding code that is functionally correct but much slower than serial execution. Unlike text-only code generation, autonomous coding agents ( 32 ) integrate code models with tool use in terminals or IDEs, enabling iterative editing, compilation, and testing directly on the target machine ( 50 ) . This shifts the setting from offline code completion to in-situ , feedback-driven development. We focus on OpenMP GPU offloading ( 14 ) because it addresses the “ultimate goal” of modern parallel computing with one of the most used parallel APIs ( 46 ; 27 ) : exploiting the massive performance advantage of GPUs over CPUs, which has become ubiquitous over the last decade ( 45 ) . By targeting OpenMP offloading, we tackle a triple challenge: (i) maintaining portability across heterogeneous systems, (ii) preserving CPU fallback (since OpenMP offloads are optional), and (iii) raising the bar for agentic reasoning, requiring the agent to correctly manage device memory and kernel launches, not just thread-level parallelism. We evaluate two input settings: translation (serial \rightarrow OpenMP) and migration (CUDA \rightarrow OpenMP), among the most important tasks in the field. ( 7 ) . These limitations motivate the design of ParaCodex , a Codex-based agentic workflow ( 24 ; 48 ) that mirrors the iterative process of an HPC engineer ( 36 ) . To prevent premature parallelization of unsafe loops (a classical tool weakness), ParaCodex enforces Stage 1 (Analysis). To avoid data thrashing, Stage 2 (Data Planning) explicitly structures memory residency before code generation. Finally, to catch performance regressions that static analysis misses, Stage 3 (Profiling) closes the loop with ground-truth measurement ( 40 ) . Unlike approaches that stop once tests pass, ParaCodex explicitly optimizes for performance via feedback. We evaluate ParaCodex on 36 serial \rightarrow OpenMP tasks drawn from HeCBench ( 26 ) (23), Rodinia ( 6 ) (7), and NAS ( 2 ; 18 ) (6). Together, these widely used suites span micro-kernels through end-to-end scientific benchmarks, with provided implementations ranging from optimized to highly tuned. Using GPU time measured by NVIDIA Nsight Systems (kernel execution plus transfers), ParaCodex achieves valid GPU offload on 31/36 kernels (86%; 5 kernels excluded, detailed in § 4.2 ), produces correct implementations for all 31 valid kernels, and improves GPU time over the provided OpenMP implementations in 25/31 cases (80%), with geometric-mean GPU-time speedups of 3 \times on HeCBench, 5.1 \times on Rodinia, and 1.08 \times on the highly tuned NAS suite. As a separate generalization study, we evaluate CUDA \rightarrow OpenMP migration on four ParEval ( 38 ) kernels, where ParaCodex maintains high compilation and validation rates under both a fixed build environment ( code-only ) and an end-to-end setting where the agent must also construct the build flow ( overall ) (§ 4 ). Key Question. To what extent can a tool-using autonomous coding agent translate and migrate parallel code under automated build-and-test validation, and use profiling feedback to narrow the performance gap to reference implementations? Research Questions. To explore this space we pose four guiding questions: 1. RQ1 – Baseline feasibility: How effectively can contemporary agentic LLMs translate serial code into correct OpenMP GPU offload without profiling-guided iteration? 2. RQ2 – Benefit of specialization: Does a staged, expert-seeded workflow with structured intermediate artifacts improve robustness and performance? 3. RQ3 – Performance attainment: To what extent can profiling-in-the-loop refinement approach or exceed the provided OpenMP implementations across diverse benchmarks, and where do regressions persist? 4. RQ4 – Task generalization: Does the same workflow generalize from serial \rightarrow OpenMP translation to CUDA \rightarrow OpenMP migration? Contributions. We make three contributions: 1. We systematize HPC engineering practice into a reusable agentic pattern: from hotspot analysis via a loop taxonomy through data residency and transfer strategy selection to profile-guided tuning, connected via Makefile-based correctness gates (RQ2, RQ3). 2. We design a comprehensive evaluation protocol for serial \rightarrow OpenMP agentic parallelization across HeCBench, Rodinia, and NAS under a unified build-and-test harness and a zero-shot Codex baseline, quantifying both robustness and GPU-time performance relative to expert implementations (RQ1, RQ3). 3. We demonstrate generalization to CUDA \rightarrow OpenMP translation on ParEval, and introduce bypass-detection analysis that surfaces pseudo-offload cases and suggests harness design strategies to enforce device-side work (RQ4). 2 Related Work We organize prior work from static and learned parallelization methods, through LLM-based parallel code generation and translation, to autonomous coding agents and feedback-driven self-refinement. We distinguish ParaCodex from prior work along three axes: (1) Compile/test repair (UniPar, LASSI) fixes bugs but