Pattern-Driven Evaluation of LLM Code Optimization: Isolating Compiler-Transcendent Semantic Reasoning
Wesley Lu, Runzhou Liu, Hongru Du, Xinyao Yi
Key points
From the paper's conclusion- These results suggest that evaluation of LLM-based code optimization should measure not only performance outcomes, but also whether the target transformation was successfully executed.
Abstract
Existing evaluations of LLM-based code optimization primarily measure end-to-end speedup, obscuring whether a model actually performs the intended optimization. For compiled languages, this is especially problematic: observed gains may reflect transformations already recoverable by modern optimizing compilers rather than optimization behavior attributable to the model itself. We present PatternBench, a benchmark for studying compiler-transcendent optimization, i.e., performance improvements that remain after aggressive compiler optimization. PatternBench targets residual optimization opportunities across seven classes of transformations and pairs runtime evaluation with an AST-based optimization faithfulness analysis that verifies whether the intended optimization is realized in the generated program. Experiments with frontier, open-weight, and fine-tuned models show that runtime speedup alone provides an incomplete account of optimization capability. Optimization faithfulness is strongly associated with realized speedup, and fine-tuning improves both faithfulness and optimization effectiveness. These results suggest that evaluation of LLM-based code optimization should measure not only performance outcomes, but also whether the target transformation was successfully executed.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- HPC-Bench: A Comprehensive Benchmark for High Performance Computing CodesarXiv · 2026
- Understanding code semantics: a benchmark study of LLMsInternational Journal on Software Tools for Technology Transfer · 2026
- KernelOPT: Dispatch-Aware Agentic Search for GPU Kernel OptimizationarXiv · 2026
- TestJack: Should you trust the results in coding benchmarks? Agentic Coding Benchmarks Auditing via Evaluator EvolutionarXiv · 2026
- Pattern-Guided Graph Synthesis for Suppressing Known Defects in DL Compiler FuzzingarXiv · 2026
- RL–LLMfuzzer: reinforcement learning–guided dual–model differential fuzzing for compiler testingJournal of King Saud University - Computer and Information Sciences · 2026