LPR:大语言模型辅助的程序缩减
LPR: Large Language Models-Aided Program Reduction
AI总结:
本文提出 LPR,结合通用语法缩减器与 LLM 的语义变换,在 C、Rust 和 JavaScript 上实现兼顾通用性与语言针对性的程序缩减,并在缩减效果和耗时上优于 Vulcan。
摘要:
程序缩减是一种通过自动最小化触发缺陷的程序来促进编译器调试的常用技术。现有程序缩减技术要么跨语言通用(例如 Perses 和 Vulcan),要么通过利用特定语言特征而针对某种语言专门定制,例如 C-Reduce。然而,如何在跨多种编程语言的通用性与程序缩减中对各语言的针对性之间取得平衡,仍有待探索。本文提出 LPR,这是首个利用 LLM 对多种语言执行特定语言程序缩减的技术。其核心洞见是同时利用语言通用的语法级程序缩减(例如 Perses)以及由 LLM 学习到的特定语言语义级程序变换。具体而言,语言通用的程序缩减器会交替地将程序高效缩减至 1-tree-minimality,这一规模足够小,便于 LLM 处理;LLM 则通过已学习的语义有效变换程序,以暴露新的缩减机会,供语言通用程序缩减器进一步缩减程序。我们在跨越三种语言(C、Rust 和 JavaScript)的 50 个基准上进行的广泛评估,凸显了 LPR 相对于最先进的语言通用程序缩减器 Vulcan 的实用性和优越性。在有效性方面,LPR 在 C、Rust 和 JavaScript 基准上生成的程序分别比 Vulcan 小 24.93%、4.47% 和 11.71%。此外,LPR 与 Vulcan 已展现出相互补充的潜力。通过对 LPR 的 C 程序输出再使用 Vulcan,我们获得了与 C-Reduce 缩减结果相当的程序规模。在效率方面,LPR 完成 C、Rust 和 JavaScript 全部基准所用时间分别比 Vulcan 少 10.77%、34.88% 和 36.96%。
英文摘要:
Program reduction is a prevalent technique to facilitate compilers' debugging by automatically minimizing bug-triggering programs. Existing program reduction techniques are either generic across languages (e.g., Perses and Vulcan) or specifically customized for one certain language by employing language-specific features, like C-Reduce. However, striking the balance between generality across multiple programming languages and specificity to individual languages in program reduction is yet to be explored. This paper proposes LPR, the first technique utilizing LLMs to perform language-specific program reduction for multiple languages. The core insight is to utilize both the language-generic syntax level program reduction (e.g., Perses) and the language-specific semantic level program transformations learned by LLMs. Alternately, language-generic program reducers efficiently reduce programs into 1-tree-minimality, which is small enough to be manageable for LLMs; LLMs effectively transform programs via the learned semantics to expose new reduction opportunities for the language-generic program reducers to further reduce the programs. Our extensive evaluation on 50 benchmarks across three languages (C, Rust, and JavaScript) has highlighted LPR's practicality and superiority over Vulcan, the state-of-the-art language-generic program reducer. For effectiveness, LPR surpasses Vulcan by producing 24.93%, 4.47%, and 11.71% smaller programs on benchmarks in C, Rust and JavaScript. Moreover, LPR and Vulcan have demonstrated their potential to complement each other. By using Vulcan on LPR's output for C programs, we achieve program sizes comparable to those reduced by C-Reduce. For efficiency, LPR takes 10.77%, 34.88%, 36.96% less time than Vulcan to finish all benchmarks in C, Rust and JavaScript, separately.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。