Pattern-Driven Evaluation of LLM Code Optimization: Isolating Compiler-Transcendent Semantic Reasoning
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.
Create a lesson
Metadata
- Categories
- cs.AI, cs.PL, cs.SE
- Comments
- 12 pages, 2 figures, 6 tables. Published at the AI Measurement Science Workshop at COLM 2026
Related papers
ESM-Bench: A Benchmark for Evaluating Whether AI Agents Understand Earth System Model Physics and Code
Shared title terminologycs.AIKoutian Wu, Yuxuan Cao, Gengchen Mai et al.
Auditable Financial Knowledge Graphs: Schema-Driven Construction and Intrinsic Quality Evaluation
Shared title terminologycs.AISamarth Sarin, Lovepreet Singh, Dhagash Mehta
SLP-Bench: Evaluating and Improving Acoustic Claims of Reasoning Audio Language Models on Clinical Speech
Shared title terminologycs.AICôme Hosxe, Rachid Riad, Quentin Spinat
Understanding When Reflective Prompt and Skill Optimization Helps on Locally Served Reasoning Models: A Two-Model Study of GEPA and SkillOpt
Shared title terminologycs.AIAndrea Giummarra, Carmelo Baglieri, Antonio Di Maria et al.
MAMath-Bench: Process-Aware and Robust Evaluation of Multimodal Multi-Agent Mathematical Reasoning
Shared title terminologycs.AIXinping Wang, Jie Ma, Rui Xing et al.
Pareto-Optimal RTL Code Generation via Multi-Objective Reinforcement Learning with Large Language Models
Shared title terminologycs.AIKoki Takeshita, Kenji Uebayashi, Hikaru Tomonari et al.