一句话:提出首个LLM辅助的跨语言程序缩减技术LPR,结合通用缩减器与语言语义变换,比Vulcan生成更小程序。
程序缩减通过自动最小化触发编译器缺陷的程序来辅助调试。现有技术要么通用但缺乏语言特异性(如Perses、Vulcan),要么只针对单一语言优化(如C-Reduce),难以兼顾通用性与最优性。本文提出LPR,首个用大语言模型进行多语言程序缩减的技术:先用语言通用缩减器把程序缩到适合LLM处理的小规模,再由LLM基于学到的语言语义做程序变换,为通用缩减器创造新的缩减机会。在C、Rust和JavaScript的50个基准上,LPR比Vulcan分别多缩小24.93%、4.47%和11.71%,且在大程序上耗时更少;二者可互补,对C可接近C-Reduce。
Program reduction is a widely used technique to facilitate debugging compilers by automatically minimizing programs that trigger compiler bugs. Existing program reduction techniques are either generic to a wide range of languages (such as Perses and Vulcan) or specifically optimized for one certain language by exploiting language-specific knowledge (e.g., C-Reduce). However, synergistically combining both generality across languages and optimality to a specific language in program reduction is yet to be explored. This paper proposes LPR, the first LLMs-aided technique leveraging LLMs to perform language-specific program reduction for multiple languages. The key insight is to utilize both the language generality of program reducers such as Perses and the languagespecific semantics learned by LLMs. Concretely, language-generic program reducers can efficiently reduce programs into a small size that is suitable for LLMs to process; LLMs can effectively transform programs via the learned semantics to create new reduction opportunities for the language-generic program reducers to further reduce the programs. Our thorough evaluation on 50 benchmarks across three programming languages (i.e., C, Rust and JavaScript) has demonstrated 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, separately. Moreover, LPR and Vulcan have the potential to complement each other. For the C language for which C-Reduce is optimized, by applying Vulcan to the output produced by LPR, we can attain program sizes that are on par with those achieved by C-Reduce. For efficiency perceived by users, LPR is more efficient when reducing large and complex programs, taking 10.77%, 34.88%, 36.96% less time than Vulcan to finish all the benchmarks in C, Rust and JavaScript, separately.
DOI 原文 ·
@inproceedings{paperbot8579,
title = {LPR: Large Language Models-Aided Program Reduction},
author = {Mengxiao Zhang and Yongqiang Tian and Zhenyang Xu and Yiwen Dong and Shin Hwei Tan and Chengnian Sun},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3652126}
}