arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.16668cs.NEcs.AI
收藏

代码演化图:理解大语言模型驱动的算法设计

Code Evolution Graphs: Understanding Large Language Model Driven Design of Algorithms

Leiden University(莱顿大学);University of Wyoming(怀俄明大学)

Niki van Stein, Anna V. Kononova, Lars Kotthoff, Thomas Bäck

AI总结:

针对大语言模型在演化计算框架下迭代优化算法时存在的性能不佳、优化停滞等问题,提出代码演化图分析方法,通过三类基准实验发现重复提示会增加代码复杂度且不同模型风格各异,为多模型融合提升代码性能提供依据。

摘要:

大语言模型(LLM)在代码生成方面展现出巨大潜力,尤其是在演化计算框架内用于迭代优化生成的算法时。但在某些情况下,它们无法生成具有竞争力的算法,或是代码优化陷入停滞,而由于对生成过程和生成代码缺乏理解,我们无计可施。我们提出一种新方法来缓解这一问题,让用户能够分析演化过程中生成的代码,以及这些代码在LLM的重复提示下如何演化。我们展示了三类基准问题的结果,并揭示了新的洞见。具体而言,重复提示下LLM倾向于生成更复杂的代码,但额外的复杂度在某些情况下会损害算法性能。不同的LLM有不同的编码“风格”,且生成的代码往往与其他LLM的代码存在差异。这两项发现表明,在代码演化框架内使用不同LLM可能比仅使用单一LLM生成性能更高的代码。

英文摘要:

Large Language Models (LLMs) have demonstrated great promise in generating code, especially when used inside an evolutionary computation framework to iteratively optimize the generated algorithms. However, in some cases they fail to generate competitive algorithms or the code optimization stalls, and we are left with no recourse because of a lack of understanding of the generation process and generated codes. We present a novel approach to mitigate this problem by enabling users to analyze the generated codes inside the evolutionary process and how they evolve over repeated prompting of the LLM. We show results for three benchmark problem classes and demonstrate novel insights. In particular, LLMs tend to generate more complex code with repeated prompting, but additional complexity can hurt algorithmic performance in some cases. Different LLMs have different coding ``styles'' and generated code tends to be dissimilar to other LLMs. These two findings suggest that using different LLMs inside the code evolution frameworks might produce higher performing code than using only one LLM.

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

↑