一句话:结合编译器与LLM的归约分析自动识别关键输入特征,将输入识别时间缩短44至450倍,支撑输入中心优化。
输入中心程序优化通过刻画程序输入与程序行为之间的关系来优化代码,但自动识别复杂输入的关键特征长期依赖繁重的插桩与profiling。本文提出一种编译器引导大语言模型(LLM)的归约分析技术,通过编译器与LLM协同,以归约方式克服LLM在程序代码分析中的可扩展性等局限。该方法首次在无需重型插桩或profiling的情况下自动识别关键输入特征,将输入识别平均时间从9.6小时降至13分钟(远程LLM)或77秒(本地LLM),分别加速44倍与450倍,使输入刻画可融入程序编译工作流。基于所识别输入特征的优化达到甚至优于以往profiling方法的效果:选择自适应OpenMP并行决策的准确率达92.6%,serverless计算性能提升20-30%的同时减少50-60%资源使用。
Input-centric program optimization aims to optimize code by considering the relations between program inputs and program behaviors. Despite its promise, a long-standing barrier for its adoption is the difficulty of automatically identifying critical features of complex inputs. This paper introduces a novel technique, reductive analysis through compiler-guided Large Language Models (LLMs) , to solve the problem through a synergy between compilers and LLMs. It uses a reductive approach to overcome the scalability and other limitations of LLMs in program code analysis. The solution, for the first time, automates the identification of critical input features without heavy instrumentation or profiling, cutting the time needed for input identification by 44× (or 450× for local LLMs), reduced from 9.6 hours to 13 minutes (with remote LLMs) or 77 seconds (with local LLMs) on average, making input characterization possible to be integrated into the workflow of program compilations. Optimizations on those identified input features show similar or even better results than those identified by previous profiling-based methods, leading to optimizations that yield 92.6% accuracy in selecting the appropriate adaptive OpenMP parallelization decisions, and 20-30% performance improvement of serverless computing while reducing resource usage by 50-60%.
@article{paperbot3113,
title = {Reductive Analysis with Compiler-Guided Large Language Models for Input-Centric Code Optimizations},
author = {Xiangwei Wang and Xinning Hui and Chunhua Liao and Xipeng Shen},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {PLDI},
year = {2025},
doi = {10.1145/3729282}
}