paperbot · PL 论文追踪

全部论文 待读 收藏

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

弥合 LLM 代码翻译中的鸿沟:用调用图与桥接调试器减少错误
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 4/10 · 论文将调用图(静态分析)用于辅助LLM代码翻译,属于PL与AI的交叉,但并非用户关注的核心方向(如Agentic程序分析、LLM改进静态分析、浮点/贝叶斯程序分析),也未涉及工业落地或新benchmark设计。引用 4 inbox
Yang Luo, Richard Yu, Fajun Zhang, Ling Liang, Yongqiang Xiong
crossref: 2026-09-12

AI 速览

一句话:提出 TransGraph:借调用图与桥接调试器增强 LLM 代码翻译,显著降低编译与运行时错误。

在用大语言模型(LLM)翻译复杂软件时,模型常因上下文感知不足而产生大量编译错误与运行时错误。本文提出代码翻译方法 TransGraph:首先通过 Language Server Protocol 获取整个代码项目的调用图,以结构化的方式刻画函数调用关系,使 LLM 能更有效地处理大规模、复杂代码库,从而大幅减少编译错误;其次,TransGraph 结合桥接调试器与动态测试用例生成,主动触发并定位运行时错误,克服了传统方法测试用例覆盖不足的局限。作者在包括 CodeNet 与 Avatar 在内的六个数据集上开展实验,结果显示 TransGraph 在翻译准确率上优于现有代码翻译方法与 LLM,提升幅度最高达 10.2%。

问题
LLM 在翻译复杂软件代码时缺乏足够的上下文感知,容易产生大量编译错误与运行时错误。
方法
用 Language Server Protocol 提取整个项目的调用图作为结构化上下文供 LLM 使用,并配合桥接调试器与动态测试用例生成来发现和修复运行时错误。
评估
在 CodeNet、Avatar 等六个数据集上与现有代码翻译方法和 LLM 对比翻译准确率,最高取得 10.2% 的提升。
原文摘要(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%.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot8334,
  title = {Bridging Gaps in LLM Code Translation: Reducing Errors with Call Graphs and Bridged Debuggers},
  author = {Yang Luo and Richard Yu and Fajun Zhang and Ling Liang and Yongqiang Xiong},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695322}
}