LLM Agent在硬件感知代码优化中依赖预训练先验还是搜索?三项受控实验研究
Prior Knowledge or Search? A Study of LLM Agents in Hardware-Aware Code Optimization
三项受控实验发现,LLM在代码优化任务中高度依赖预训练先验而非反馈或Agent结构。纯黑盒优化中LLM表现为贪心优化器;零样本kernel生成时输入尺寸信息几乎无影响,模型收敛到相同kernel参数,面对不常见kernel尺寸性能急剧下降。反馈循环中CUDA随迭代单调提升,TVM IR反而退化,表明低密度语言下kernel优化会变差。
arXiv:2605.19782v2 Announce Type: replace Abstract: 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.
来源:arXiv (AI + Vision + Imaging) · arxiv.org