VisualCoder:通过细粒度多模态思维链推理引导大语言模型进行代码执行
VisualCoder: Guiding Large Language Models in Code Execution with Fine-grained Multimodal Chain-of-Thought Reasoning
AI总结:
VisualCoder 通过将多模态思维链推理与可视化控制流图对齐,并引入引用机制保证代码与执行路径一致,从而提升大语言模型在程序行为预测、错误检测和输出生成上的表现。
摘要:
预测程序行为并推理代码执行仍然是软件工程中的重大挑战,尤其是对于用于代码分析的大语言模型(LLMs)而言。虽然这些模型擅长理解静态语法,但在动态推理任务上往往表现不佳。我们提出了 VisualCoder,这是一种简单而有效的方法,通过将多模态思维链(CoT)推理与可视化控制流图(CFG)相结合来增强代码推理能力。通过将代码片段与其对应的 CFG 对齐,VisualCoder 能够更深入地洞察执行流程。我们通过一种引用机制解决了多模态 CoT 集成中的挑战,确保代码与其执行路径之间的一致性,从而提升了在程序行为预测、错误检测和输出生成方面的性能。
英文摘要:
Predicting program behavior and reasoning about code execution remain significant challenges in software engineering, particularly for large language models (LLMs) designed for code analysis. While these models excel at understanding static syntax, they often struggle with dynamic reasoning tasks. We introduce VisualCoder, a simple yet effective approach that enhances code reasoning by integrating multimodal Chain-of-Thought (CoT) reasoning with a visual Control Flow Graph (CFG). By aligning code snippets with their corresponding CFGs, VisualCoder provides deeper insights into execution flows. We address challenges in multimodal CoT integration through a reference mechanism, ensuring consistency between code and its execution path, thereby improving performance in program behavior prediction, error detection, and output generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。