arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2406.11935cs.PLcs.AIcs.SE
收藏

面向问题的视角与锚点验证用于代码优化

A Problem-Oriented Perspective and Anchor Verification for Code Optimization

Zhejiang University(浙江大学);Stony Brook University(石溪大学);AntGroup(蚂蚁集团)

Tong Ye, Tengfei Ma, Xuhong Zhang, Hang Yu, Jianwei Yin, Wenhai Wang

AI总结:

本文提出面向问题的视角与锚点验证框架,用于提升代码优化的正确性和效率,减少优化过程中的性能损耗。

摘要:

大型语言模型(LLMs)在解决各种编程任务,如代码生成方面展现出了显著的能力。然而,它们在代码优化,特别是性能提升方面的潜力仍 largely 未被探索。本文研究了LLMs在最小化执行时间的代码优化能力,填补了当前研究中的关键空白。最近提出的代码优化方法基于同一问题相同程序员的多次提交构建程序优化对。然而,这种方法限制了LLMs在局部性能改进,忽视了全局算法创新。为克服这一限制,我们采用完全不同的视角,将优化对重构为面向问题的方法。这允许整合多个程序员针对同一问题的各种想法。此外,我们发现代码优化比代码生成更具挑战性,往往伴随着

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑