Bridging Gaps in LLM Code Translation: Reducing Errors with Call Graphs and Bridged Debuggers

When using large language models (LLMs) for code translation of complex software, numerous compilation and runtime errors can occur due to insufficient context awareness. To address this issue, this paper presents a code translation method based on call graphs and bridged debuggers: TransGraph. TransGraph first obtains the call graph of the entire code project using the Language Server Protocol, which provides a detailed description of the function call relationships in the program. Through this structured view of the code, LLMs can more effectively handle large-scale and complex codebases, significantly reducing compilation errors. Furthermore, TransGraph, combined with bridged debuggers and dynamic test case generation, significantly reduces runtime errors, overcoming the limitations of insufficient test case coverage in traditional methods. In experiments on six datasets including CodeNet and Avatar, TransGraph outperformed existing code translation methods and LLMs in terms of translation accuracy, with improvements of up to 10.2%.

Authors

Institutions

Publication Details

Published
2024-10-18
DOI
https://doi.org/10.1145/3691620.3695322
Citations
2
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.69
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Bridging Gaps in LLM Code Translation: Reducing Errors with Call Graphs and Bridged Debuggers

Fu-Yan ZHANG, Richard Yu, Yongqiang Xiong, Yang Luo et al.
2 citations
Natural Language Processing Techniques
0.69
article

Bridging Gaps in LLM Code Translation: Reducing Errors with Call Graphs and Bridged Debuggers

Fu-Yan ZHANG, Richard Yu, Yongqiang Xiong, Yang Luo, Ling Liang
article en
2 citations

Abstract

When using large language models (LLMs) for code translation of complex software, numerous compilation and runtime errors can occur due to insufficient context awareness. To address this issue, this paper presents a code translation method based on call graphs and bridged debuggers: TransGraph. TransGraph first obtains the call graph of the entire code project using the Language Server Protocol, which provides a detailed description of the function call relationships in the program. Through this structured view of the code, LLMs can more effectively handle large-scale and complex codebases, significantly reducing compilation errors. Furthermore, TransGraph, combined with bridged debuggers and dynamic test case generation, significantly reduces runtime errors, overcoming the limitations of insufficient test case coverage in traditional methods. In experiments on six datasets including CodeNet and Avatar, TransGraph outperformed existing code translation methods and LLMs in terms of translation accuracy, with improvements of up to 10.2%.

Microsoft Research Asia (China) (CN)
Openalex Percentile: Top 24%
Natural Language Processing Techniques
0.69
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.