paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Multi-level Code Optimization via Mixture of Prompts

基于 Mixture of Prompts 的多层级代码优化
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026匹配度 3/10 · 论文属于 LLM 辅助代码优化,与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析无直接关联,且不涉及 Agentic 程序或静态分析技术,仅同属 LLM+PL 交叉领域的外围工作。引用 0 inbox
Yun Peng, Jun Wan, Jiakun Liu, Shuzheng Gao, David Lo, Xiaoxue Ren
crossref: 2026-10-09

AI 速览

一句话:提出 Optimo,利用差分剖析定位瓶颈,并以 Mixture-of-Prompts 路由到多层级优化策略,显著提升动态语言代码运行效率。

传统代码优化在编译期基于 IR,适合静态语言,却难处理无需编译的动态语言;近期 LLM 直接优化源码,但难以识别优化目标,且多为单层级优化。作者提出 Optimo:基于 Mixture-of-Prompts(MoP)的多层级 LLM 代码优化方法。它通过差分剖析定位时间关键结构作为瓶颈,再像 MoE 专家路由一样分派给针对特定代码模式的策略,覆盖从粗粒度算法改进到细粒度 API 使用四个抽象层级。在 COFFE 与 Effibench 上,优化人类代码最高达 57.48% opt%、3.97 倍加速,opt% 超最佳基线最高 96.51%;优化 LLM 生成代码最高达 42.42% opt%、13.51 倍加速。

问题
动态语言代码缺乏编译期 IR 优化,现有 LLM 优化方法难以定位性能瓶颈,且通常只进行不全面的单层级优化。
方法
提出 Optimo,基于 Mixture-of-Prompts 架构,用差分剖析识别时间关键代码结构,并将其路由到覆盖四个抽象层级的专家式提示优化策略。
评估
在 COFFE 和 Effibench 两个代码效率基准上,与最佳基线比较 opt% 和加速比,并分别评估人类编写代码与 LLM 生成代码。
原文摘要(Abstract)

Runtime efficiency is a critical factor that impacts both software quality and user satisfaction. There are many approaches proposed for code optimization to improve runtime efficiency. Traditional code optimization methods operate on intermediate representations (IRs) during compilation for static languages. They are effective but struggle to handle dynamic languages that do not require compilation. Recently, large language models (LLMs) have been leveraged to directly optimize source code in dynamic languages. However, these methods fail to identify suitable optimization targets and usually conduct incomprehensive single-level optimization. To address these challenges, we propose Optimo, a multi-level LLM-based code optimization approach built on a novel Mixture-of-Prompts (MoP) architecture. In the MoP architecture, Optimo identifies time-critical code structures as performance bottlenecks via differential profiling. These structures are then routed to some optimization strategies, akin to expert models in MoE, each tailored to optimize specific code patterns. Unlike traditional approaches that focus only on statement-level optimizations, Optimo operates at four levels of abstraction, ranging from coarse-grained algorithmic improvements to fine-grained optimizations in API usage. We evaluate Optimo on two code efficiency benchmarks, COFFE and Effibench. Our results demonstrate that Optimo achieves an up to 57.48% opt%, i.e., the percentage of optimized programs that are correct and at least 10% faster than the original programs, and an up to 3.97x speedup when optimizing human-written code, and it consistently outperforms the best baseline by up to 96.51% in terms of opt%. Furthermore, Optimo achieves an up to 42.42% opt% and an up to 13.51x speedup when optimizing LLM-generated code.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2607-23665,
  title = {Multi-level Code Optimization via Mixture of Prompts},
  author = {Yun Peng and Jun Wan and Jiakun Liu and Shuzheng Gao and David Lo and Xiaoxue Ren},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834369}
}