Towards Feedback-to-Plan Decisions for Self-Evolving LLM Agents in CUDA Kernel Generation
This paper introduces \texttt{CUDAnalyst}, a unified analysis framework that isolates and attributes the impact of heterogeneous feedback signals on planning decisions in self-evolving LLM agents for CUDA kernel generation, revealing that explicit planning is beneficial only when feedback is aligned and that effective planning emerges from structured multi-feedback interactions.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to teach a robot to write the most efficient code possible for a graphics card (a CUDA kernel). You don't just tell the robot "do it better." Instead, you let the robot write code, run it, and then give it a report card with feedback: "This part is too slow," "This line causes a crash," or "This memory usage is wasteful." The robot then uses this feedback to plan its next attempt.
This paper is about figuring out how the robot actually uses that feedback to make its plans.
The Problem: The "Black Box" of Evolution
In the past, researchers tried to understand this process by simply turning off one type of feedback (like the crash detector) and seeing if the robot got worse. But this is like trying to understand a car engine by driving it for a year, then taking out the spark plugs, and driving it for another year. By the time you compare the two, the car has changed so much from all the other driving that you can't tell if the bad performance was just because of the spark plugs or because the car got tired.
The authors call this "trajectory drift." The robot's path changes so much over time that you can't isolate exactly which piece of feedback helped it make a specific decision.
The Solution: CUDAnalyst (The "Freeze-Frame" Camera)
To fix this, the authors built a tool called CUDAnalyst. Think of it as a time-traveling camera that can freeze the robot's progress at a specific moment.
- Freeze the State: They stop the robot's evolution at a specific point in time.
- Swap the Feedback: They take that frozen moment and ask the robot to make a plan using only the crash report, then only the speed report, then all of them together.
- Compare: Because the starting point (the frozen code) is exactly the same, any difference in the robot's plan is 100% caused by the feedback they changed.
This allows them to see exactly which feedback signals are actually useful and how they work together.
The Big Discoveries (The "Rules of the Road")
Using this freeze-frame method, they found four main things:
1. Feedback is the Fuel; Planning is just the Engine
They found that having a "planning step" (where the robot thinks before acting) is useless unless it has good feedback.
- Analogy: Imagine a GPS (the planner) trying to guide a driver. If the GPS has no map data (no feedback), it will just give you random directions, and you'll get lost faster. But if the GPS has real-time traffic data (feedback), it becomes incredibly useful. The paper shows that planning only works when it's grounded in real, aligned feedback.
2. The "Village" Effect (Tools Work Best Together)
The robot uses different tools: a debugger (finds crashes), an analyzer (looks at code structure), and a profiler (measures speed).
- Analogy: Think of these tools as a team of doctors. One is a surgeon, one is a radiologist, and one is a nutritionist.
- Early on, the robot needs all of them working together to just get the code to run (survival).
- Later on, the "profiler" (nutritionist) becomes the star for making the code fast, but it still needs the others to make sure the code doesn't break.
- The paper shows that these tools have a "synergy"—they are more powerful together than the sum of their parts.
3. Summaries Help, But Don't Replace the Plan
Sometimes, instead of giving the robot a 50-page report, you give it a 1-page summary.
- Analogy: For a smart student (a strong AI model), a 50-page report is fine; they can read it all. But for a student who is still learning (a weaker AI model), a 1-page summary is a huge help because it cuts out the noise.
- The Catch: Even with a great summary, the robot still needs a "planner" to decide what to do with that summary. The summary is just the information; the planner is the decision-maker. You can't just hand a summary to the robot and expect it to work perfectly without the planning step.
4. Smart Students Can Teach Dumb Students
The researchers tried taking the "plan" (the strategy) made by a very smart AI and giving it to a weaker AI to follow.
- Analogy: It's like a master chess player writing down their strategy notes and giving them to a beginner. The beginner doesn't become a grandmaster instantly, but they play much better than they would on their own.
- The Twist: This works best if the two AIs are from the same "family" (trained similarly). If they are too different, the beginner might not understand the master's notes.
The Real-World Result: CuGEdit
Finally, they took these lessons and built a plugin called CuGEdit. This plugin acts like a smart manager for the robot. It knows:
- "Right now, the code is broken, so ignore the speed reports and focus on fixing crashes."
- "Now that the code works, let's look at the speed reports."
- "Let's use the smart AI to write the plan, and the cheaper AI to write the actual code."
When they tested this on a standard benchmark (KernelBench), their system made the code run 2 to 10 times faster than previous methods, proving that understanding how feedback guides planning is the key to building better AI code writers.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.