High-performance computing software must be ported among serial C++, OpenMP, and CUDA as platforms and deployment constraints change. Such translation requires preserving program behavior while satisfying target-specific constraints on parallel execution, synchronization, memory movement, and API use. Although large language models are flexible code generators, plausible parallel-code translations can fail at compilation, execution, or validation.
We study guidance and adaptation methods that make existing LLMs more reliable without training a generator from scratch. The central method is latent PRM guidance, which guides a frozen latent-reasoning model before code is emitted. A small process reward model scores alternative continuous hidden-state branches during latent reasoning and selects branches expected to lead to executable, behaviorally correct programs. The evaluation also includes lighter-weight assistance methods such as prompting, fine-tuning, and iterative repair with compiler and execution feedback.
On the ParaTrans dataset, LLMs struggle as standalone executable translators, but their reliability improves significantly through task-aware assistance. Latent PRM guidance improves validation over unguided latent reasoning while remaining compatible with iterative repair. The best results are achieved through the cumulative and compounding effects of combining guidance, prompting, and iterative repair to improve executable correctness and validation performance.