AI
LLM Agents Rely on Training Data, Not Feedback, for Code Optimization
A study of language models optimizing hardware-aware code reveals they lean heavily on pre-trained knowledge rather than agentic search loops.
Researchers have conducted a systematic investigation into how well language model agents perform at hardware-aware code optimization—a task that typically requires models to propose solutions, receive feedback, and iteratively refine their approach. The findings challenge common assumptions about how these systems actually work.
What the Study Examined#
The team ran three controlled experiments to isolate different aspects of LLM-based optimization pipelines. They tested performance on pure black-box optimization, zero-shot kernel code generation across different input sizes, and iterative kernel optimization through feedback loops. The goal was to understand which components—prior knowledge, feedback mechanisms, or agentic reasoning—drove success or failure.
Key Findings on Model Behavior#
The experiments uncovered three striking patterns:
-
Black-box optimization behaves greedily. When LLMs face pure optimization without environmental signals, they act as simple greedy optimizers rather than sophisticated search agents.
-
Input-size instructions are largely ignored. Even when explicitly told to generate kernels for specific input sizes, models produced identical parameters regardless of input dimensions or temperature settings—as if the instruction had no effect. Performance collapsed sharply when asked to handle uncommon kernel sizes, suggesting models rely on pretraining rather than following new directives.
-
Feedback helps some languages more than others. Under iterative refinement, CUDA code improved consistently with each round of feedback. By contrast, TVM IR—a lower-density intermediate representation—actually degraded over iterations, indicating that models struggle to reason about unfamiliar or sparse code representations.
Implications for LLM-Based Optimization#
The overarching conclusion is sobering: language models in code optimization tasks are fundamentally dependent on what they learned during pretraining rather than on feedback mechanisms or agentic loop structure. This suggests that building more complex agent frameworks around LLMs may deliver less benefit than expected if the underlying model lacks strong prior knowledge of the optimization domain. For practitioners, the finding implies that model selection and pretraining diversity matter more than sophisticated orchestration.

