---
title: "UniPar — paper by Bitan et al. (2025) — summary and ideas"
description: "UniPar tests how fine-tuning and compiler-guided repair affect the translation of serial, OpenMP, and CUDA kernels for high-performance…"
canonical: "https://research.elamur.ai/free/en/papers/bitan-2025-unipar-unified-llm-based-framework/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bitan-2025-unipar-unified-llm-based-framework/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2025](https://md.research.elamur.ai/free/en/papers/2025/) / UniPar: A Unified LLM-Based Framework for Parallel and Accelerated Code Translation in HPC

# UniPar: A Unified LLM-Based Framework for Parallel and Accelerated Code Translation in HPC

Paper · 2025 · Tomer Bitan, Tal Kadosh, Erel Kaplan et al.

**Authors:** Tomer Bitan, Tal Kadosh, Erel Kaplan, Shira Meiri, Le Chen, Peter Morales, Niranjan Hasabnis and Gal Oren · **Year:** 2025 · **Venue:** arXiv:2509.12136 · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

Cited by **6** papers in our library of more than 163,000 papers whose bibliographies we read · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/2509.12136)
- [arXiv 2509.12136](https://arxiv.org/abs/2509.12136)

## Summary

Moving a scientific program to different hardware can require rewriting the code that performs its computations. A serial implementation can specify what to calculate, while a parallel implementation must also express how to divide the work and coordinate it. A kernel written for one parallel programming interface can already solve those problems in ways that need to change when it moves to another. UniPar asks how much of this work a [large language model](https://md.research.elamur.ai/free/en/concepts/large-language-models/) can do, and how much better its translations become when it can revise them using feedback from a compiler and a runtime verifier.

The authors build ParaTrans from corresponding implementations of benchmark kernels, the parts of a program that perform its main computations. They test translations from serial code to OpenMP or CUDA, and in both directions between OpenMP and CUDA. GPT-4o-mini and LLaMA-3.3-70B-Instruct serve as general-purpose starting points. The experiments vary how the systems generate code, whether their prompts contain worked examples, and whether the generator has received task-specific [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/). A further experiment lets the system rework its initial translation after attempting to compile and run it.

The paper reports a GPT-4o-mini baseline of 46% for compilation and 15% for functional validation on the ParaTrans test cases. Its headline figures for the UniPar methodology are 69% compilation and 33% functional validation. Adding examples to the translation prompt yielded inconsistent results and could lower the compilation rate. Fine-tuning LLaMA produced a clearer improvement in the share of translations that passed the benchmark’s output checks than in the share that compiled. The feedback pipeline helped across the tested starting points, including when it started with the fine-tuned LLaMA.

The distinction between compilation and functional validation matters throughout the study. A compiler accepts code it can build. The benchmark checks what the resulting program does when it runs on its supplied cases. UniPar measures both outcomes, and the authors leave execution speed and scalability for future study. They make the UniPar source code and the ParaTrans dataset available.

## Deep dive: UniPar: A Unified LLM-Based Framework for Parallel and Accelerated Code Translation in HPC

UniPar tests how fine-tuning and compiler-guided repair affect the translation of serial, OpenMP, and CUDA kernels for high-performance computing. · about 33 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### A translation has to carry the computation across

High-performance computing uses parallel execution to tackle demanding calculations in fields such as climate modeling, molecular dynamics, and astrophysics. Parallel execution changes how a program expresses a computation. A programmer has to decide which work can proceed at the same time and how those pieces fit together. The programming interface determines how those decisions appear in source code. CUDA, associated with NVIDIA hardware, and OpenMP, an open interface, are the two parallel targets the paper studies. The wider setting is [parallel computing](https://md.research.elamur.ai/free/en/topics/gpu-parallel-computing/).

Porting code matters because the best available platform for a workload can change. An organization might care about which devices it can obtain, what features a platform supports, or how well an implementation runs on a given machine. Programs tied to a vendor’s interface can restrict those choices. Open interfaces offer compatibility across vendors, and the paper treats the ability to move among interfaces as a separate practical advantage. A team can have a working implementation and still face a substantial rewrite before it can use a different platform.

The translation problem has a useful starting point. The source already describes an existing calculation. The target code has to express that same calculation in a different programming setting. A source-to-target pair therefore conveys two kinds of information. It shows the work the program is supposed to perform, and it shows a particular way to express that work through the target interface. The benchmark’s aligned examples let the authors make this distinction concrete. Each implementation belongs to a kernel with corresponding code in another form, so the desired behavior has an independent reference.

The starting form also changes what a translation entails. A serial source gives the translator an implementation of the calculation that runs without the parallel directives used to derive it. The target must express parallel execution. A CUDA source already divides work for its own setting. A move from CUDA to OpenMP asks the translator to preserve the calculation while expressing its parallel structure through the other interface. Moving from OpenMP to CUDA reverses the direction of the port and changes which conventions the generated program has to satisfy.

The paper’s focus is the implementation of a benchmark kernel. This gives the authors a unit that can be extracted, translated, compiled, and checked. It also makes the scope of the task clear. Moving application build settings, coordinating changes across a large collection of files, and reproducing an application’s performance on new hardware are separate problems. The study concentrates on whether the core calculation can make the transition and pass the corresponding benchmark checks. The relevant area is [code and programming languages](https://md.research.elamur.ai/free/en/topics/code-and-programming/).

#### What existing translators offered

The authors describe established source-to-source translators as a starting point for the problem. SYCLomatic converts CUDA code to SYCL. HIPify converts CUDA to HIP. They also discuss an Intel translator from OpenACC to OpenMP. Each example illustrates a practical way to support a defined migration. Developers with code and hardware on those paths have a translator aimed at the particular interfaces they need.

The paper puts several research efforts in the same history, including CU2CL, SnuCL, and TransCL for work involving CUDA and OpenCL. The authors characterize academic efforts as sometimes pursuing wider applicability. In their assessment, static tools face a maintenance problem as compiler toolchains and interfaces change. The authors also point to the scope of individual translators. Supporting a new direction is a distinct requirement when a translator has been designed for a particular source and target.

The appeal of a common translation setup follows from this account. If a user can specify the source and destination interfaces in an instruction, the same experimental procedure can test multiple directions. The program generator still has to produce the right code in every case. A common procedure makes it possible to study where that ability holds up and where a specific transition causes trouble. It also gives the authors a way to change the generator without redesigning the rest of the evaluation.

The paper describes learning-based work as another strand of research. Specialized systems had been applied to parallel programming tasks, including work involving OpenMP and MPI. Some methods use learning to advise parallelization or generate code for a particular programming environment. CodeRosetta is cited in connection with unsupervised translation for parallel programming. The authors see adaptability as a motivation for learning-based methods, alongside the practical effort required to adopt a specialized system. UniPar explores whether accessible instruction-following systems can serve as a starting point for the translation task.

Earlier studies also gave the authors reason to test general-purpose code generation. The paper cites work on generating serial and parallel programs, along with research on how language-based systems handle parallel programming interfaces. Those studies motivate a more specific evaluation. A system can produce plausible code for an interface and still struggle when a source program constrains exactly what the target has to compute. The UniPar experiments supply that constraint through existing implementations and check the generated code by building and running it.

Compiler feedback also has a precedent. The paper cites work on obtaining compilable generated code, using compiler information to improve code datasets, and building translation systems that can correct previous output. UniPar uses feedback to revise a particular answer during inference, after the initial translation has already been generated. This puts the diagnostic information close to the decision it is intended to improve. The compiler is reporting on the candidate currently under consideration. The paper cites [Compilable Neural Code Generation with Compiler Feedback](https://md.research.elamur.ai/free/en/papers/wang-2022-compilable-neural-code-generation-compiler/).

#### The questions UniPar separates

The authors organize the study around successive opportunities to improve a translation. The first lies in the initial request. The experiment can adjust how the generator chooses tokens and whether it sees worked translations before answering. The second lies in training. The same general instruction format can be used to teach the generator from aligned examples before giving it a held-out source. The third lies after generation. Build and runtime evidence can inform a revision for the case that just failed.

These opportunities differ in when the system learns anything specific about the task. A decoding setting changes the way a response is sampled. An example in the prompt shows a translation without updating the generator’s parameters. Supervised training uses examples to update those parameters. Repair supplies new information about a particular generated program. Keeping the interventions distinct lets the paper ask whether a better initial translation still has room to improve when it meets the compiler.

The study also separates two stages of success. Compiling is a necessary step toward running the generated program in the evaluation. Passing the benchmark’s output check requires the compiled program to exhibit the expected behavior on the supplied cases. This is a consequential distinction for program translation. The target can be valid enough for the compiler to build and still perform the wrong calculation. A study that observes both stages can identify whether an intervention mostly helps the build, largely helps behavior, or helps on both measures.

The authors describe UniPar as a systematic evaluation across serial and parallel forms and across several ways of improving generation. Their claim of novelty concerns that combination. The cited literature already includes automatic parallelization, code translation, and compiler-informed correction. The question here is how well the same general translation procedure works across the chosen directions when those interventions are evaluated on a common corpus.

### The method, step by step

#### From benchmark programs to aligned examples

ParaTrans starts with HeCBench, a collection of computational benchmarks. It contains 499 benchmarks across areas including cryptography, machine learning, and signal processing. The paper counts 1758 implementations across the supported programming forms, which include CUDA, HIP, SYCL/DPC++, and OpenMP-4.5. Availability varies by benchmark. A collection organized around a common computational task can supply an example of the same kernel in several forms, even when the full range is unavailable for an individual benchmark.

The authors begin by retaining benchmarks that have an implementation in CUDA, OpenMP, or both. Those are the interfaces the evaluation asks the generator to produce. They then identify the main computational source file. For 706 of the 1758 programs, the implementation consists of a single source file. For benchmarks that use several files, the authors look at how the source is organized and exclude auxiliary code, such as files devoted to utilities or reference calculations, when it falls outside the computation they want to translate.

This choice sets the boundary of each example. The source passed to the generator is the code the authors identify as the core of the benchmark. The evaluation can still draw on the benchmark’s own build and verification support. The prompt and the test machinery thus have different roles. One supplies the implementation to translate. The other supplies the environment in which a proposed translation is checked. After the initial selection and file filtering, the paper reports 406 CUDA codes and 276 OpenMP codes.

The authors remove comments from the selected source files. This standardizes the material they use for prompts and focuses generation on the code. They create the serial version of a kernel by taking the OpenMP version and removing its OpenMP pragmas. A pragma is a source directive. In these examples, the OpenMP directives are the part the authors remove to obtain a serial counterpart. The resulting pair preserves much of the same code and therefore gives Serial → OpenMP a close source-to-target correspondence.

That relationship deserves attention when following the rest of the paper. The serial source for this direction comes from the target’s family of implementations. Its similarity to the corresponding OpenMP code is built into the dataset procedure. A serial source supplied by someone developing a program independently could have a different structure. In ParaTrans, the paired examples give the experiment a controlled starting point and give the favorable Serial → OpenMP results a specific interpretation.

The authors next verify the benchmark code itself. They build the implementation and run it to see whether its output agrees with what the benchmark expects. When an implementation fails that validation, the dataset excludes it. The paper says three benchmark kernels ultimately failed validation and were removed from subsequent experiments. This check precedes judging generated translations. It gives the reference code a chance to fail under the same broad kinds of checks that the generated code will face.

Length is another filter. The authors examine source-file lengths using the LLaMA-3.3-70B-Instruct tokenizer. A tokenizer divides text into the units a generator consumes and produces. The number of tokens in a source file determines how much of the available input it occupies. Long source files are especially consequential here because an example-based prompt contains source code and target code as well as the new kernel to translate. The study’s relevant unit is the one used by the generator’s [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

The paper sets a source-length cutoff of 7,500 tokens after examining the distribution. The authors want to retain a range of benchmark programs while avoiding inputs they consider excessively long. They cite work on difficulties using information in long contexts as part of the motivation. The length rule and the later response limit apply at different stages. The former determines which source files enter the corpus. The latter governs how long a generated answer may be. The related study is [Lost in the Middle](https://md.research.elamur.ai/free/en/papers/liu-2023-lost-middle-language-models-use/).

The resulting corpus retains 380 CUDA programs and 258 OpenMP programs. These are counts of implementations. The training and test totals are expressed as counts of directed translation pairs. The same kernel can provide more than one kind of example when several implementations are available. A pair specifies which implementation supplies the source and which supplies the reference in the chosen target language. A tuple groups corresponding implementations of a computation, from which such pairs can be formed.

The authors allocate 898 translation pairs to training and 76 pairs to the held-out test split. The Serial → OpenMP direction contributes 235 training pairs and 20 test pairs. Serial → CUDA has 221 training pairs and 19 test pairs. CUDA → OpenMP has 221 training pairs and 18 test pairs. OpenMP → CUDA has 221 training pairs and 19 test pairs. The directional breakdown matters because the same total score can arise from quite different behavior across these tasks.

The split also gives the worked prompt examples and the supervised training examples a defined origin. Both come from the training side. The held-out side supplies the source programs used to score performance. When the generator receives a worked demonstration, it sees an aligned source and target drawn from the training split before attempting the test translation. When it receives fine-tuning, the training pairs are used beforehand and the test translation is again generated in response to its source.

#### How the initial answer is produced

The translation request uses a common template. It sets the role of a specialist in high-performance computing, identifies the source and target interfaces, and supplies the source code. The answer is expected to contain the translated code. This format lets the authors use different kernel pairs and different translation directions while preserving the same basic task description. The identity of the source and target is explicit, so the generator is given the destination it should write for.

A zero-shot request gives the task and the source without a worked translation. A few-shot request places worked input-output examples before the new source. Each demonstration shows a kernel in one form together with its corresponding implementation in the requested target. The paper draws these demonstrations from the ParaTrans training split and matches their translation direction to that of the test input. A Serial → CUDA example therefore illustrates the transition requested in a Serial → CUDA test, with the source and target named in both places. This is [few-shot learning](https://md.research.elamur.ai/free/en/concepts/few-shot-learning/) through examples in the prompt.

The demonstration supplies evidence of what an answer should look like and how a previous kernel was transformed. The generator must decide which aspects of that transformation carry over. The logic of the new source may require a different arrangement, even though its target uses the same programming interface. The few-shot experiment tests this particular way of presenting examples. Its design uses the common direction as the basis for making a demonstration relevant.

The authors run this translation prompt with GPT-4o-mini and LLaMA-3.3-70B-Instruct. Both have already been instruction-tuned, meaning they have been adapted to respond to requests expressed as instructions. Their behavior can be evaluated directly through the same prompt template. The authors chose them for accessibility and general coding ability. The task-specific training reported later starts from the instruction-following LLaMA, preserving that ability to respond to the prompt while adapting it to ParaTrans.

Before settling on settings for later experiments, the authors vary how answers are generated. Temperature controls the amount of randomness when the generator chooses the next token. With a lower temperature, options already favored by the generator tend to dominate the choice. A higher temperature gives alternatives more opportunity to appear. In a program, a local change can affect later token choices and can change whether the final candidate fits the target compiler’s requirements.

Top-p is another control over the next-token choice. The procedure considers likely tokens in descending order and retains a set based on their cumulative probability. Sampling takes place within that set. The maximum token setting limits the length of the generated response. For code generation, that ceiling matters because a response has to include enough of the implementation to be useful. A permitted output length is a budget. The candidate can end before it uses the full allowance.

For the zero-shot sweep, the temperatures are 0.2, 0.6, and 0.9, and the output limits are 5,000, 10,000, and 15,000 tokens. The paper describes that sweep with top-p fixed at 0.8. After observing a slight improvement at 0.9, the authors specify temperature 0.2, top-p 0.9, and an output budget of 15,000 tokens for the subsequent experiments. These are settings for the generation of a response. Supervised training and prompt demonstrations change other parts of the procedure.

#### What supervised training adds

The experiment with task-specific training uses LLaMA-3.3-70B-Instruct. The training examples are aligned kernel implementations from ParaTrans. The request supplies the source code and identifies the translation direction. The paired target supplies the answer the generator is trained to produce. This gives supervision at the level of an entire translation. A request for CUDA is paired with CUDA code for the computation described in its source. A request for OpenMP is paired with an OpenMP implementation of the corresponding kernel.

The training format follows the instruction template used for inference. An adapted generator still receives a source program and a target interface when presented with a new test case. The difference is that its parameters have been updated using examples of this task. A worked example presented during inference affects the text available for that request. Supervised training changes how the underlying generator responds to requests, including requests that contain only the new source.

Source and target code can each be long enough to make the training sequence demanding. The authors use memory optimizations from TorchTune to reach a training context length of 16,384 tokens. The context length governs the sequence available to the generator in that training setup. It is reported separately from the 7,500-token source-file cutoff and from the 15,000-token response budget. Those settings describe different aspects of preparing examples, fitting the training setup, and generating code.

The paper reports training with 16-bit floating-point precision. For inference, it describes 8-bit quantization, which represents parameter values with fewer bits to reduce memory demands. Training ran on eight NVIDIA A100 GPUs with 80GB per device. The hardware for LLaMA inference comprised 12 Intel Xeon Gold 6336Y CPUs and 4 NVIDIA L40 GPUs. GPT-4o-mini was accessed through the Azure OpenAI API. These details describe the execution environments used for the study.

Task-specific training can supply regularities shared by many translations. It can also improve the initial answer without observing anything about the success of that answer on the particular test case. At the point when the generator returns its first program, the compiler and the output verifier still have work to do. UniPar can direct those checks at either an untouched instruction-following generator’s output or a candidate from the fine-tuned LLaMA.

#### How feedback changes a candidate

UniPar divides inference with feedback into roles. The Questioner formulates the translation request and obtains a candidate from the selected generator. The Compilation Agent attempts to build that candidate. The Execution Agent runs a build that has passed compilation and uses benchmark checks to assess it. These roles organize the exchange of information. The Questioner starts from the original program and its requested target, while the later roles can see evidence about how the candidate fared.

UniPar translation and feedback The steps in order.

The compiler stage turns a build failure into material for a second request. The authors name Clang++ and NVCC as compilers available in the architecture. When compilation fails, the Compilation Agent takes the diagnostic message and constructs a repair prompt for the failed candidate. The generator can then return a changed program. A new build tests whether the changes were enough. A diagnostic tied to a particular candidate supplies details that the original request could only express in general terms.

If compilation succeeds, the Execution Agent runs the code on test cases supplied by the original benchmark. It has access to observed behavior and runtime errors when seeking a further correction. The paper emphasizes that the repair stage gets runtime error information, beyond a bare success or failure signal. The verifier supplies the criterion for success. The error information gives the repair step something concrete about the current run to work from.

The repair loop is bounded. The experimental description assigns the Compilation Agent three attempts to compile and correct. The Execution Agent, if reached, has three attempts to run and address errors. GPT-4o-mini underlies both repair roles. The authors vary the Questioner, using GPT-4o-mini and versions of LLaMA-3.3-70B-Instruct, including the fine-tuned version. For this pipeline they use a temperature of 0.2, top-p of 0.9, and a response limit of 15,000 tokens.

Keeping the repair generator fixed while changing the initial generator makes the starting point an experimental variable. A better starting candidate may already satisfy more of the target requirements. A weaker candidate may offer more opportunities for a diagnostic to identify a fix. The pipeline outcome reflects both the starting code and the repair system that works on it. The authors study that relationship by comparing performance with and without repair for the different Questioners.

#### How a translation is judged

The evaluation draws on HeCBench’s support for compiling and executing kernels with known output checks. To use the original check, the authors replace the generated program’s `main` function with the reference kernel’s `main`. The `main` function is the program entry point. In the benchmark it includes the logic needed to verify the output. Reusing that entry point lets the benchmark setup call the generated implementation and apply the established expected-output test.

Replacing the entry point can expose interface mismatches in code that compiled beforehand. The paper describes a specific procedure for such cases. If compilation worked before the replacement and failed afterwards, the authors allowed 3 GPT-4o-mini repair attempts. They then checked that the repairs left kernel functionality intact. This adjustment serves the integration of the benchmark’s entry point. The feedback experiment separately studies repair as part of the translation pipeline itself.

A successful build contributes to the compilation rate. A generated program contributes to the validation rate when its execution produces the output expected by the benchmark. The paper defines both as percentages of generated programs. Validation describes how the candidates fare across the evaluation cases, so an inability to compile can also prevent a candidate from becoming a validation success. This interpretation is central to the study’s [evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/).

The paper gives these metric definitions in prose and describes its decoding and repair procedures operationally. The core sequence is to produce code, build it, run it where possible, and compare its output with the benchmark’s expectation. In the feedback conditions, a failure can lead to another attempt within the stated budget. The status of the translation at the end of that process is the outcome measured in the experiment.

### Experiments and results

#### The test cases, starting points, and measures

All the main translation results concern the held-out ParaTrans split of 76 pairs. The test includes 20 Serial → OpenMP cases, 19 Serial → CUDA cases, 18 CUDA → OpenMP cases, and 19 OpenMP → CUDA cases. The directions share the evaluation procedure, and each has its own set of source programs. A direction can therefore be difficult because of how the target expresses parallel work, because of the programs assigned to that task, or because of both.

The direct baselines are the instruction-following GPT-4o-mini and LLaMA-3.3-70B-Instruct, given a translation request. The authors compare versions of the prompt and decoding settings, the fine-tuned LLaMA against its starting version, and candidates that go through feedback against those generated without the pipeline. The migration tools discussed in the introduction motivate the problem. The reported comparisons use the code generators and their configurations.

Compilation rate measures whether the translation can be built in the target environment. Validation rate measures whether its observed output matches the expected output on the supplied tests. OpenMP verification ran on a machine with fifty AMD EPYC 7742 CPUs. CUDA verification used the NVIDIA L40 GPUs also reported for LLaMA inference. These machines are the environments for checking execution. The paper presents no runtime speed comparison on them.

The authors’ headline account gives GPT-4o-mini’s default baseline as 46% compilation and 15% functional validation. It reports 69% compilation and 33% validation for the enhanced UniPar methodology. The headline describes the combined approach, and the individual experiments are needed to see what changed when each kind of intervention was introduced. In particular, the Questioner comparison later in the paper identifies the fine-tuned LLaMA with feedback as the strongest setting for validation in that comparison. The headline figures and the Questioner ranking answer different reporting questions.

GPT-4o-mini baseline and UniPar headline compilation rates on ParaTrans test pairs The enhanced framework produces more compilable translations than the default baseline.

**The numbers**

| System or setting | compilation % |
| --- | --- |
| GPT-4o-mini default baseline | 46 |
| UniPar headline result (this paper) | 69 |

GPT-4o-mini baseline and UniPar headline validation rates on ParaTrans test pairs More translations pass the benchmark output checks under the enhanced framework.

**The numbers**

| System or setting | validation % |
| --- | --- |
| GPT-4o-mini default baseline | 15 |
| UniPar headline result (this paper) | 33 |

The charts use the comparison reported in the abstract. They describe improvements on the held-out kernel translation tasks in the paper. The gap between the compilation and validation results also shows why the authors run both checks. A successful build leaves room for a failure during execution or an output that disagrees with the benchmark. Measuring both makes it possible to see improvements in code that the benchmark can run and in code that actually passes its output check.

#### Decoding settings and demonstrations

The zero-shot sweep examines generation before the authors add worked examples, task-specific training, or the repair loop. The main pairs of settings are the temperature and the maximum response length. The test measures the compilation rate of the generated candidates. This lets the authors observe how frequently a change to decoding alone produces code the build accepts on the same translation task.

The paper finds lower temperature generally more reliable, particularly when the permitted outputs are longer. Temperature 0.2 gave the authors a setting that worked consistently enough to carry forward. The effect is especially visible for LLaMA in the configurations with more room to generate. The paper interprets the pattern as evidence that less randomness helps preserve syntactic validity when the output is substantial. The tuning experiment scores builds, which is the outcome that directly supports that interpretation.

The later choice of 15,000 tokens gives the generator room to finish larger responses. The authors carry forward top-p 0.9 after reporting a slight gain over 0.8, the setting used during the described temperature and length sweep. The combination becomes a shared backdrop for the later comparisons. A change observed after that point can be interpreted in relation to the added demonstration, the trained parameters, or the repair pipeline, with the generation settings held in common as described by the paper.

The next experiment compares 0-shot, 1-shot, 2-shot, and 3-shot prompts. The additional examples come from the training split and use the same source-target direction as the test translation. The primary reported outcome is compilation rate. The authors also break the comparison down by translation direction and show results across benchmark categories for the comparison of prompts with and without a worked example.

The observed pattern is uneven. For both GPT-4o-mini and LLaMA-3.3-70B-Instruct, the addition of demonstrations usually changes compilation less predictably than an assumption of steady improvement would imply. The 3-shot condition shows a noticeable deterioration in the authors’ overall account. Direction and application domain matter, and more examples do not consistently help across the categories they examine.

An important detail is that matching the source and target interfaces makes a demonstration relevant in one respect. Its code can still embody a different calculation and a different arrangement of work. The authors examined cases in which LLaMA made subtle syntactic errors even when the worked example was very close to the requested translation. The experiment shows that supplying a plausible precedent for the answer leaves the generator responsible for many details on which the build depends.

#### What changes after supervised training

The fine-tuning comparison returns to the held-out ParaTrans tasks with a generator trained on aligned kernels. The paper finds compilation rates broadly on par with or better than the base results. The clearer gains are in functional validation. The paper’s comparison figure describes the average validation rate as more than doubling for LLaMA after fine-tuning. This statement concerns the before-and-after comparison for that generator on the test directions.

Grouped by target interface, the fine-tuned LLaMA achieves 29.4% validation for translations to CUDA and 38.2% validation for translations to OpenMP. The CUDA figure covers the directions with CUDA as their target. The OpenMP figure covers the directions with OpenMP as their target. Each target grouping combines source forms already defined by the experiment. The rates describe passage of the output check, so they capture a different property from the compilation rates the paper emphasizes in its prompt experiments.

The increase in validation is the evidence closest to the authors’ rationale for supervised training. The training set gives the generator repeated examples of corresponding kernels. On the test split, more of its translations go through the build and deliver the expected result. The aggregate outcome is compatible with several changes in generated programs, including changes that help them compile and changes that improve a computation that could already run. The comparison reports the resulting test outcomes, without a separate count of each kind of change.

The target grouping is also informative about what can be claimed. OpenMP includes the serial-to-OpenMP task for which sources and targets are closely related by construction. CUDA includes a different set of paths and source programs. The reported results characterize those groups as the authors assembled them. Reading the rates as a universal ordering of target difficulty would require a comparison that holds the underlying problems and their source structure fixed across the targets.

#### What changes when the tools respond

For the feedback experiment, the paper compares the initial-only condition with the pipeline that can compile, diagnose, revise, execute, and revise further. The direction-level plots report compilation and validation. Across the evaluated translations, the authors find that using compiler and execution evidence improves overall performance on both measures. Later attempts get information about errors encountered by the current candidate, so their requests differ from a fresh translation prompt that contains only the original source.

The feedback intervention can improve validation by helping a candidate get past the build stage. It can also give a program that compiles a chance to address a problem observed at runtime. The study evaluates those opportunities together in the full pipeline. A larger gain in validation than in compilation in a comparison is consistent with revision helping behavior after a build. The aggregate numbers alone do not identify the exact path by which each program became a success.

The effect varies by starting generator and direction. The authors report larger gains in some of the tasks where the initial candidate was less often successful, including OpenMP → CUDA for LLaMA and Serial → CUDA for GPT-4o-mini. Feedback also improves results when the initial generator is the fine-tuned LLaMA. That setting retains the strongest overall validation in the comparison of Questioners, even though its incremental gain from feedback is smaller than the gains reported for some of the base settings.

Taking the experiments together, the interventions address different moments of failure. Decoding affects the first generated answer. Additional demonstrations offer an example of the task before the answer is written. Supervised training adapts the generator across many training pairs. The repair loop responds to evidence from an actual candidate. The results are strongest for task-specific training and tool feedback, while the demonstration experiment shows that putting more examples in the prompt can have variable consequences for whether the code builds.

### What the ablations show

#### Changing the source of the initial candidate

The first named ablation varies the Questioner while using the same repair setup. The Questioner can supply a translation from GPT-4o-mini, the base instruction-tuned LLaMA, or the fine-tuned LLaMA. The paper compares each starting condition with its counterpart using the Compilation and Execution agents. This lets the authors examine both how much quality the initial candidate brings and how much further improvement the feedback stages deliver.

The pipeline helps each tested Questioner. The paper reports especially substantial effects for the base settings. Those settings begin with more failures available for correction, which gives some context to their larger gains. The fine-tuned Questioner already has stronger validation before the repair stages are attached. It improves further when those stages are used and gives the best overall validation in the comparison.

This result supports a practical sense in which the two interventions combine. In UniPar, adaptation on the training corpus produces better initial translations, and candidate-specific feedback still contributes afterwards. The evidence comes from observing the pipeline continue to help under an improved starting condition. A formal additive-effects claim would require an analysis of how the magnitude of the repair effect depends on the training treatment. The paper itself observes differences in the size of the gain across starting conditions.

The ablation also defines what changes when the initial generator changes. GPT-4o-mini remains responsible for the compiler- and runtime-driven correction roles. In a condition that starts from LLaMA, the reported pipeline performance reflects a LLaMA candidate refined by GPT-4o-mini. In the condition that starts and repairs with GPT-4o-mini, it reflects the same underlying service in separate roles with different prompts and available evidence. The paper’s comparisons support claims about the whole configurations tested.

A stronger initial candidate and a more successful repair have different implications for how the pipeline responds to a task. An initial answer that already passes the checks can finish without needing the evidence from a failed attempt. An initial answer with several problems can require more revision. Overall validation combines these cases. The paper’s comparison shows that useful assistance from the repair system persists even when the input to that system improves.

#### Following compilation through the repair rounds

The other named ablation follows compilation success from the initial generation through successive correction rounds. The displayed breakdown includes the initial candidate and up to two rounds of compiler-guided repair. This view shows when builds are recovered. The full pipeline’s end result tells how many candidates eventually succeed, while the round-by-round comparison shows how much of that success appears after each opportunity to use a diagnostic.

In most of the cases examined, the first repair attempt accounts for the largest gain in compilation. The compiler has identified concrete problems in the initial attempt, and the repair prompt can focus on them. The later round still contributes in some cases. The authors explain that a repair can resolve one kind of problem while a different issue persists. A fresh build can make the remaining issue available for the next prompt.

The authors suggest that code needing multiple corrections could benefit from further rounds, particularly as kernels become longer or more complex. That is a proposed explanation and extension of the observed pattern. The measured evidence in the breakdown concerns the rounds actually shown. Much of the gain in the studied cases appears early, with more limited gains from the second correction.

The timing of recovery varies by translation direction. The paper identifies cases for which weak initial compilation leaves a greater opportunity for repairs to close the difference between tasks. It also relates strong performance on Serial → OpenMP to the closeness of the two versions. Because the serial source comes from the OpenMP implementation with its directives removed, much of the surrounding computation is already expressed in a familiar form. The repair evidence therefore belongs alongside the dataset construction when explaining directional variation.

This analysis is specific to compilation. It gives direct evidence about the first round’s contribution to obtaining a build. The paper reports effects on validation for the full feedback pipeline, where runtime checks and repair are also available. Passage through the build and passage through the output check remain distinct events. A repair round that restores a build can reveal a runtime problem that could only be observed once the program ran.

#### What the prompt analyses can explain

The decoding sweep and the demonstration comparison are controlled variations on the starting procedure. The decoding sweep shows that a generator’s compilation rate changes with the way it selects tokens and with the permitted response length. The authors’ reading of the results is that conservative generation helps preserve the details needed for syntactic validity, especially for longer answers. The sweep measures observable build success under each setting and provides the basis for the settings used later.

The demonstration experiment tests whether examples help when the translation direction is already specified. It varies how many worked pairs the generator receives. The authors find generally small or uneven effects until performance falls under the longer demonstration setup. Their inspection of individual errors suggests that a demonstration can communicate the broad form of a translation while the generated program still fails on details needed for compilation.

The authors suspect that longer prompts dilute attention to the relevant details and that examples are better at conveying the overall shape of the answer than its precise implementation. The experiment changes prompt length and the amount of example material together. The stated explanation is therefore a hypothesis about what produces the outcome. The observed findings are the variations in compilation, the inconsistent category effects, and the persistence of errors in some cases with closely related demonstrations.

These comparisons also provide context for the fine-tuning result. Training on aligned translations affects the generator’s responses across test requests, while a worked example is available only as context for a particular request. The reported data show a meaningful validation gain after training in the LLaMA experiment and weak evidence that appending demonstrations reliably improves compilation. Each intervention is assessed with the outcome emphasized in its experiment, and the interventions can be understood without assuming that they change the same errors.

### Limitations

#### Limits the authors state

The authors explicitly leave runtime performance and scalability unevaluated. A candidate can produce the expected output in a benchmark run while having performance characteristics that make it unsuitable for the intended high-performance workload. The authors did not ask the generators to optimize the translated code. The reported validation rates measure the benchmark’s functional criterion. The computational objectives that frequently motivate a move to new hardware remain open.

The paper also restricts its translation targets to CUDA and OpenMP. The dataset begins with a benchmark suite that contains other implementations, and the authors discuss interfaces such as SYCL and OpenACC as possible extensions. The evaluated directions show how the procedure works with these serial and parallel forms. Applying it to a new target would require corresponding examples, a compiler setup, and a way to check the resulting programs. The effectiveness of the method under those conditions remains a question for further experiments.

The authors describe their ablations as preliminary. They examine changes in the Questioner and the contribution of successive compiler-repair rounds. They reserve a more extensive study of pipeline design choices for later work. The repair roles in this study share GPT-4o-mini and the paper’s chosen settings, so the results characterize a particular arrangement. Different choices for the repair roles, diagnostic context, or stopping budget are among the possibilities left open by that design.

The conclusion also calls for improving compilation and validation and extending coverage to longer kernels. This is connected to an explicit choice in the method. ParaTrans excludes sources beyond 7,500 tokens under the tokenizer used to curate the dataset. The experiments give direct evidence for the kernels admitted by that procedure, including the longer examples that fit within it. Larger inputs change the amount of source code, answer code, and repair context the system has to handle.

#### Limits of the benchmark design

The scope of functional validation comes from the supplied HeCBench cases. Matching the expected output on those cases provides evidence about the calculation in the situations actually tested. Parallel behavior under a wider range of inputs and execution conditions remains outside that observation. The experiment also gives a pass or fail outcome at the candidate level. It cannot tell from the aggregate validation rate how many failed programs were close to matching the required behavior or how extensive a correction would have made them pass.

Compilation is similarly tied to the tested toolchains and integration procedure. The `main` replacement gives the output check a reliable place to run, and the special repair allowance addresses build failures introduced by that replacement. The measured outcome therefore concerns compatibility with the experiment’s build and verification setup. A development team integrating a kernel into a different application would have its own interfaces, source organization, and build requirements.

The corpus is selected for evaluability. The authors identify the core computational file, remove comments, exclude auxiliary material where appropriate, validate benchmark implementations, and filter long files. These decisions make it possible to compare translation directions within a common procedure. They also delimit the evidence. The study concerns curated kernels with known reference behavior. An application whose calculation is spread across several source files, or whose success can only be checked through a larger workflow, would present an additional integration problem.

The serial examples deserve particular care. Removing OpenMP pragmas yields a useful pair because the two implementations share surrounding code. This construction gives Serial → OpenMP a closer relationship than a corpus of independently written implementations might have. As the authors note in discussing directional performance, that closeness helps explain why the task can be relatively favorable. The result is directly informative about recovering parallel code from this kind of source and leaves other serial starting points to be evaluated.

The unit of the split matters as well. The paper reports a held-out split in directed pairs and gives counts for each direction. It describes forming pairs from aligned kernels, which can support multiple directions when several implementations are available. The split description does not establish how related directions for the same underlying kernel were assigned across the split. The evidence is therefore most precise when stated as performance on the held-out translation pairs, with the strength of generalization to entirely unseen kernel families left open.

The individual test directions have 20, 19, 18, and 19 pairs in the reported breakdown. Direction-specific results describe the candidates evaluated in these groups. The headline aggregate depends on the particular mix of directions and programs. Performance on a corpus with different application categories, longer source, or more kernels in one direction could change the ordering of the configurations. The paper’s subgroups make some of that heterogeneity visible without establishing a general distribution of parallel translation tasks.

#### Limits of causal attribution

The combined repair intervention changes the procedure in several ways. It allows more attempts, brings compiler diagnostics into the conversation, and adds a runtime stage that can generate further repair context. The comparison with the initial-only condition measures the joint effect of those changes. The compilation-round analysis makes the timing of the build gains more precise. The study leaves the individual contributions of additional attempts, compiler information, and runtime information incompletely isolated.

This is especially relevant to the way the authors describe compounding improvements. Fine-tuning followed by repair yields better validation than the fine-tuned starting point alone. That is evidence that the two can be combined effectively in the evaluated setup. The amount of improvement from repair differs across Questioners, which allows for interactions between starting quality, generator choice, and the kinds of errors left in the code. The paper’s use of a fixed generator for repair helps define the comparison and still leaves those interactions open.

The few-shot comparison has a related limit. With each additional example comes more context and more code to interpret. A change in compilation can reflect the added length, the relation between a demonstration and the new kernel, or the details the example encourages the generator to reproduce. The authors offer observations that motivate their explanation of the decline, but the reported comparison does not separate those influences.

Finally, the direct baselines are the chosen instruction-following generators in their evaluated configurations. The earlier migration tools establish the practical setting and give examples of approaches with narrower supported paths. The paper does not report a head-to-head performance comparison against those translators on a shared set of supported programs. UniPar’s reported gains are improvements over the initial generation settings in its own experiments. That is the comparison those numbers support.

### What came after

Later work building on UniPar has yet to be documented here. The related systems discussed by the authors establish the work that preceded UniPar, including compiler-guided code correction and translation across programming interfaces. The paper leaves open whether its approach extends to other parallel targets, whether longer kernels benefit from additional repair, and how the translated programs perform when speed and scalability are included in the evaluation.

## Cite

Cite as Tomer Bitan, Tal Kadosh, Erel Kaplan, Shira Meiri, Le Chen, Peter Morales, Niranjan Hasabnis and Gal Oren. 2025. UniPar: A Unified LLM-Based Framework for Parallel and Accelerated Code Translation in HPC. arXiv:2509.12136.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.2509.12136](https://doi.org/10.48550/arxiv.2509.12136) · [arXiv 2509.12136](https://arxiv.org/abs/2509.12136)

```bibtex
@misc{bitan2025unipar,
  title = {{UniPar: A Unified LLM-Based Framework for Parallel and Accelerated Code Translation in HPC}},
  author = {Tomer Bitan, Tal Kadosh, Erel Kaplan, Shira Meiri, Le Chen, Peter Morales, Niranjan Hasabnis and Gal Oren},
  year = {2025},
  doi = {10.48550/arxiv.2509.12136},
  eprint = {2509.12136},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2509.12136}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
