Explain-then-Translate: An Analysis on Improving Program Translation with Self-generated Explanations
This work explores the use of self-generated natural language explanations as an intermediate step for code-to-code translation with language models. Across three types of explanations and 19 programming languages constructed from the MultiPL-E dataset, we find the explanations to be particularly effective in the zero-shot case, improving performance by 12% on average. Improvements with natural language explanations are particularly pronounced on difficult programs. We release our dataset, code, and canonical solutions in all 19 languages.
Code (1)
Tasks
Code TranslationTranslationSimilar Papers 제목 키워드 기반
AlphaTrans: A Neuro-Symbolic Compositional Approach for Repository-Level Code Translation and Validation
Code translation transforms programs from one programming language (PL) to another. Several rule-based transpilers have been designed to automate code translation between different pairs of PLs. However, the rules can be…
Code TranslationTranslationSyzygy: Dual Code-Test C to (safe) Rust Translation using LLMs and Dynamic Analysis
Despite extensive usage in high-performance, low-level systems programming applications, C is susceptible to vulnerabilities due to manual memory management and unsafe pointer operations. Rust, a modern systems programmi…
Code GenerationCode TranslationTranslationA Case Study: Exploiting Neural Machine Translation to Translate CUDA to OpenCL
The sequence-to-sequence (seq2seq) model for neural machine translation has significantly improved the accuracy of language translation. There have been new efforts to use this seq2seq model for program language translat…
GPUMachine TranslationTranslationEvaluation of Google Translate for Mandarin Chinese translation using sentiment and semantic analysis
Machine translation using large language models (LLMs) is having a significant global impact, making communication easier. Mandarin Chinese is the official language used for communication by the government and media in C…
Machine TranslationSentiment AnalysisTranslationNeuro-Symbolic Bi-Directional Translation -- Deep Learning Explainability for Climate Tipping Point Research
In recent years, there has been an increase in using deep learning for climate and weather modeling. Though results have been impressive, explainability and interpretability of deep learning models are still a challenge.…
DecoderDeep Learning