arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.19782cs.AIcs.LGcs.SE
收藏

先验知识还是搜索?LLM代理在硬件感知代码优化中的研究

Prior Knowledge or Search? A Study of LLM Agents in Hardware-Aware Code Optimization

Applied AI Institute(应用人工智能研究所);ITMO University(ITMO大学);AI Talent Hub(AI人才中心)

Dmitry Redko, Albert Fazlyev, Konstantin Sozykin, Maria Ivanova, Evgeny Burnaev, Egor Shvetsov

AI总结:

该研究探讨了在硬件感知代码优化中,LLM代理是依赖于先验知识还是搜索过程,通过三个受控实验发现LLM在纯黑盒优化中表现为贪婪优化器,在零样本内核生成中输入大小信息无明显影响,而在反馈循环内核优化中CUDA单调改进而TVM IR主动退化,表明LLM在代码优化任务中高度依赖预训练先验而非反馈或代理结构。

摘要:

LLM发现和优化系统在各个领域中被越来越多地应用,实现了一个常见的提出-评估-修订循环。此类优化或发现过程通过上下文条件在接收到环境反馈后进行。然而,随着现代LLM代理在结构上日益复杂,难以评估哪些组件贡献最大,以及何时以及如何探索可能失败。我们通过三个受控实验回答这些问题。我们的发现:(1) 在纯黑盒优化中,LLM表现为贪婪优化器。(2) 在零样本内核生成中,提供显式输入大小信息没有可测量的影响,模型无论大小或温度都会收敛到相同的内核参数,仿佛大小指令是不可见的。此外,当被要求为不常见的内核大小进行内核优化时,性能会急剧下降,无论使用的语言如何。(3) 在反馈循环内核优化中,CUDA在迭代反馈下单调改进,而TVM IR则主动退化,这表明当模型以低密度语言操作时,内核优化会退化。我们的结果得出结论:在代码优化任务中,LLM高度依赖于预训练的先验而非提供的反馈或代理结构。

英文摘要:

LLM discovery and optimization systems are increasingly applied across domains, implementing a common propose-evaluate-revise loop. Such optimization or discovery progresses via context conditioning on received feedback from an environment. However, as modern LLM agents are increasingly complex in their structure, it is difficult to evaluate which components contribute the most, and when and how this exploration may fail. We answer these questions through three controlled experiments. Our findings: (1) In pure black-box optimization, LLMs act as greedy optimizers. (2) In zero-shot kernel generation, providing explicit input-size information has no measurable effect, models converge to the same kernel parameters regardless of size or temperature, as though the size instruction were invisible. Moreover, when tasked to perform kernel optimization for uncommon kernel sizes, performance sharply degrades regardless of the language used. (3) In feedback-loop kernel optimization, CUDA improves monotonically under iterative feedback, while TVM IR actively degrades, which demonstrates that kernel optimization degrades when models operate with low-density language. Our results conclude that LLMs in code optimization tasks highly depend on pretrained priors rather than provided feedback or agentic structure.

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

↑