Lune

ICSE2025顶会

Search-Based LLMs for Code Optimization

Shuzheng Gao, Cuiyun Gao, Wenchao Gu, Michael R. Lyu

摘要

The code written by developers usually suffers from efficiency problems and contain various performance bugs. These inefficiencies necessitate the research of automated refactoring methods for code optimization. Early research in code optimization employs rule-based methods and focuses on specific inefficiency issues, which are labor-intensive and suffer from the low coverage issue. Recent work regards the task as a sequence generation problem, and resorts to deep learning (DL) techniques such as large language models (LLMs). These methods typically prompt LLMs to directly generate optimized code. Although these methods show state-of-the-art performance, such one-step generation paradigm is hard to achieve an optimal solution. First, complex optimization methods such as combinatorial ones are hard to be captured by LLMs. Second, the one-step generation paradigm poses challenge in precisely infusing the knowledge required for effective code optimization within LLMs, resulting in under-optimized code. To address these problems, we propose to model this task from the search perspective, and propose a search-based LLMs framework named SBLLM that enables iterative refinement and discovery of improved optimization methods. SBLLM synergistically integrate LLMs with evolutionary search and consists of three key components: 1) an execution-based representative sample selection part that evaluates the fitness of each existing optimized code and prioritizes promising ones to pilot the generation of improved code; 2) an adaptive optimization pattern retrieval part that infuses targeted optimization patterns into the model for guiding LLMs towards rectifying and progressively enhancing their optimization methods; and 3) a genetic operatorinspired chain-of-thought prompting part that aids LLMs in combining different optimization methods and generating improved optimization methods. Our evaluation of SBLLM on a dataset of Python and C++ code demonstrates its effectiveness in improving code efficiency. Specifically, the results indicate that SBLLM can improve program execution efficiency by up to 209.59 % and consistently outperform all baseline methods by <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">8.75%∼28.06%8.75 \% \sim 28.06 {\%}</tex> and <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">1.15%∼9.56%1.15 \% \sim 9.56 {\%}</tex> with different LLMs in terms of top-5 speedup rate on Python and C++, respectively.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 16 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Large Language Models Cannot Self-Correct Reasoning Yet 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • LOOPRAG: Enhancing Loop Transformation Optimization with Retrieval-Augmented Large Language Models 引用了 Language Models are Few-Shot Learners
  • Speed Up Your Code: Progressive Code Acceleration Through Bidirectional Tree Editing 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Speed Up Your Code: Progressive Code Acceleration Through Bidirectional Tree Editing 引用了 ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness?
  • PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code Editing 引用了 Language Models are Few-Shot Learners
  • WizardCoder: Empowering Code Large Language Models with Evol-Instruct 引用了 Language Models are Few-Shot Learners
  • Automated Program Repair in the Era of Large Pre-trained Language Models 引用了 Language Models are Few-Shot Learners
  • ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness? 引用了 WizardCoder: Empowering Code Large Language Models with Evol-Instruct
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper16

  1. TOM-SWE: User Mental Modeling For Software Engineering AgentsXuhui Zhou, Valerie Chen, Zhiruo Wang, Graham Neubig 等ICML 2026 · 12 次引用
  2. PEACE: Towards Efficient Project-Level Efficiency Optimization via Hybrid Code EditingXiaoxue Ren, Jun Wan, Yun Peng, Zhongxin Liu 等ASE 2025 · 5 次引用
  3. ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness?Siddhant Waghjale, Vishruth Veerendranath, Zhiruo Wang, Daniel FriedEMNLP 2024 · 3 次引用
  4. LOOPRAG: Enhancing Loop Transformation Optimization with Retrieval-Augmented Large Language ModelsYijie Zhi, Yayu Cao, Jianhua Dai, Xiaoyang Han 等ASPLOS 2026 · 1 次引用
  5. Speed Up Your Code: Progressive Code Acceleration Through Bidirectional Tree EditingLonghui Zhang, Jiahao Wang, Meishan Zhang, GaoXiong Cao 等ACL 2025 · 1 次引用

它引用的 Paper19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  3. WizardCoder: Empowering Code Large Language Models with Evol-InstructZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun 等ICLR 2024 · 945 次引用
  4. Large Language Models Cannot Self-Correct Reasoning YetJie Huang, Xinyun Chen, Swaroop Mishra, Huaixiu Steven Zheng 等ICLR 2024 · 858 次引用
  5. Automated Program Repair in the Era of Large Pre-trained Language ModelsChunqiu Steven Xia, Yuxiang Wei, Lingming ZhangICSE 2023 · 321 次引用

相关 Paper

  1. When Faster Isn't Greener: The Hidden Costs of LLM-Based Code OptimizationTristan Coignion, Clément Quinton, Romain RouvoyASE 2025
  2. A Problem-Oriented Perspective and Anchor Verification for Code OptimizationTong Ye, Tengfei Ma, Xuhong Zhang, Hang Yu 等ICLR 2026 · 3 次引用
  3. Revolve: Optimizing AI Systems by Tracking Response Evolution in Textual OptimizationPeiyan Zhang, Haibo Jin, Leyang Hu, Xinnuo Li 等ICML 2025
  4. EffiLearner: Enhancing Efficiency of Generated Code via Self-OptimizationDong Huang, Jianbo Dai, Han Weng, Puzhen Wu 等NeurIPS 2024 · 54 次引用
  5. SWE-Perf: Can Language Models Optimize Code Performance on Real-World Repositories?Xinyi He, Qian Liu, Mingzhe Du, Lin Yan 等ICML 2026 · 31 次引用
黄昏的海面,两侧是细线勾勒的悬崖