NL in the Middle: Code Translation with LLMs and Intermediate Representations
Not on the map. Why?
Abstract (arXiv)
Studies show that large language models (LLMs) produce buggy code translations. One promising avenue to improve translation accuracy is through intermediate representations, which provide structured guidance for the translation process. We investigate whether LLM-based code translation can benefit from intermediate representations, specifically in the form of natural language (NL) summaries and abstract syntax trees (ASTs). Since prompt engineering greatly affects LLM performance, we consider several ways to integrate these representations, from one-shot to chain-of-thought (CoT) prompting. Using Open GPT4 8X7B and specialized StarCoder and CodeGen models on popular code translation benchmarks (CodeNet and AVATAR), we find that CoT with an intermediate NL summary performs best, with an increase of 13.8% and 6.7%, respectively, in successful translations for the best-performing model (Open GPT4 8X7B) compared to the zero-shot prompt.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). First posted on arXiv 11 Jul 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 3.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2024InterTrans: Leveraging Transitive Intermediate Translations to Enhance LLM-based Code Translation
- 2024What do Large Language Models Need for Machine Translation Evaluation?
- 2024Does Prompt Formatting Have Any Impact on LLM Performance?
- 2024Assessing Code Generation with Intermediate Languages
- 2024Enhancing Code Translation in Language Models with Few-Shot Learning via Retrieval-Augmented Generation
- 2024Improving the Ability of Pre-trained Language Model by Imparting Large Language Model's Experience ↗
- 2025LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling Research
- 2026PromptResponse: Optimizing Prompts for LLM Coding Tasks