paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Technical Optimizations on Textbook-Efficient Code with LLMs

使用LLM对教科书级高效代码进行技术优化
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 4/10 · 论文研究 LLM 对代码性能的技术优化,属于 LLM×程序语言(代码生成/优化)的交叉,与用户关注的 AI→PL(用 LLM 改进静态分析与形式化验证)方向相邻但任务不同;既不涉及静态分析/形式化验证,也不涉及浮点或贝叶斯程序分析。其失败成因的实证分析契合用户对问题驱动研究的偏好,但核心方向不匹配。引用 0 inbox
Hanrui Qi, Yida Tao
crossref: 2026-09-12

AI 速览

一句话:研究LLM对教科书级高效代码的技术优化,发现功能保持输出中34%有非平凡加速,但也伴随失败与回退。

运行时效率通常可通过算法选择或实现细节优化提升,但后者依赖难以言传的经验知识。本文检验LLM能否优化按教科书标准已经高效的学生代码。作者用六个LLM优化649个程序,在功能保持的输出中,34%取得非平凡运行时改进,平均执行时间减少18.9%,约合1.3倍加速,说明“教科书高效”与“实际高效”之间存在差距。定性分析显示,LLM能提出更高效API、轻量数据结构和数学简化,但也可能误解需求、引入冗余计算或过度复杂化逻辑,导致33%测试失败和9%性能回退。研究表明LLM有优化潜力,但当前模型可靠应用仍需严格验证与谨慎集成。

问题
探究LLM能否对已符合教科书效率标准的程序进行实现细节层面的技术优化,并分析其可靠性与能力边界。
方法
用六个LLM对649个已教科书高效的学生程序进行优化,检查功能保持、运行时表现并对生成结果做定性分析。
评估
在功能保持的LLM输出中,34%取得非平凡运行时提升,平均执行时间降低18.9%(约1.3倍加速);同时33%出现测试失败、9%出现性能回退。
原文摘要(Abstract)

Runtime efficiency is an important attribute of source code, typically improved through high-level algorithm selections or low-level implementation optimizations. While algorithmic efficiency is well studied and formally taught, technical optimization on implementation details relies heavily on tacit, experience-driven knowledge that is often inaccessible to novices. To examine this assumption, we prompted six LLMs to optimize 649 student programs that were already efficient by textbook standards. Among the LLM-generated outputs that preserved the original functionality, \(34\%\) achieved non-trivial runtime improvements, with an average execution time reduction of \(18.9\%\) and a corresponding speedup of 1.3 ×. This finding indicates a potential gap between being textbook-efficient and being practically efficient. Our qualitative analysis further reveals both the strengths and limitations of applying LLMs to technical optimizations. On the positive side, LLMs propose more efficient APIs, lightweight data structures, and mathematical simplifications. On the downside, LLMs may misinterpret requirements, introduce redundant computations, or overcomplicate logic, resulting in test failures (\(33\%\)) or performance regressions (\(9\%\)). Overall, our study demonstrates the potential of LLMs to optimize textbook-efficient code. It also highlights, however, that reliable application with current models still requires rigorous verification and careful integration.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11489,
  title = {Technical Optimizations on Textbook-Efficient Code with LLMs},
  author = {Hanrui Qi and Yida Tao},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3774748.3795660}
}