Large Language Models (LLMs) have shown remarkable capabilities in solving various programming tasks, such as code generation. However, their potential for code optimization, particularly in performance enhancement, remains largely unexplored. This paper investigates the capabilities of LLMs in optimizing code for minimal execution time, addressing a critical gap in current research. The recently proposed code optimization methods construct program optimization pairs based on iterative submissions from the same programmer for the same problem. However, this approach confines LLMs to local performance improvements, neglecting global algorithmic innovation. To overcome this limitation, we adopt a completely different perspective by reconstructing the optimization pairs into a problem-oriented approach. This allows for the integration of various ideas from multiple programmers tackling the same problem. Furthermore, we observe that code optimization presents greater challenges compared to code generation, often accompanied by "optimization tax". Recognizing the inherent trade-offs in correctness and efficiency, we introduce a novel anchor verification framework to mitigate this "optimization tax". Ultimately, the problem oriented perspective combined with the anchor verification framework significantly enhances both the correct optimization ratio and speedup to new levels.


翻译:大型语言模型(LLM)在解决各类编程任务(如代码生成)方面已展现出卓越能力。然而,其在代码优化(特别是性能提升方面)的潜力仍未得到充分探索。本文研究了LLM在最小化执行时间的代码优化方面的能力,填补了当前研究的关键空白。近期提出的代码优化方法基于同一程序员对同一问题的多次迭代提交构建程序优化对。然而,这种方法将LLM局限于局部性能改进,忽略了全局算法创新。为突破此限制,我们采用完全不同的视角,将优化对重构为面向问题的方法。这使得整合来自多位解决同一问题的程序员的不同思路成为可能。此外,我们观察到代码优化相比代码生成面临更大挑战,常伴随“优化代价”。认识到正确性与效率之间的固有权衡,我们引入了一种新颖的锚点验证框架以减轻这种“优化代价”。最终,面向问题的视角与锚点验证框架相结合,将正确优化率和加速比双双提升至新的水平。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
《大型语言模型代码生成》综述
专知会员服务
69+阅读 · 2024年6月4日
《大型语言模型指令调优》综述
专知会员服务
74+阅读 · 2023年8月27日
以BERT为例,如何优化机器学习模型性能?
专知
10+阅读 · 2019年10月3日
机器学习中的最优化算法总结
人工智能前沿讲习班
22+阅读 · 2019年3月22日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
技术、多域威慑与海上战争(报告)
专知会员服务
2+阅读 · 今天15:04
“在云端防御”:提升北约数据韧性(报告)
专知会员服务
1+阅读 · 今天14:54
人工智能及其在海军行动中的整合(综述)
专知会员服务
1+阅读 · 今天14:07
美军MAVEN项目全面解析:算法战架构
专知会员服务
16+阅读 · 今天8:36
从俄乌战场看“马赛克战”(万字长文)
专知会员服务
10+阅读 · 今天8:19
相关基金
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员