Efficiency Hallucination: Formalizing and Measuring Behavioral Calibration in LLM-Based Code Optimization
Not on the map. Why?
Abstract (arXiv)
The integration of Large Language Models (LLMs) into automated code optimization introduces a critical reliability risk we term the Efficiency Hallucination: an LLM's tendency to issue non-functional mutations with unsubstantiated performance claims on already-optimized code. This is driven by the Evaluation Trap, wherein binary benchmarks incentivize unnecessary modifications over safely abstaining. We present a validation framework using classification penalty methods, evaluated across 180 optimization runs on nine models (GPT, Claude, Gemini) using EffiBench. Under standard prompts, models exhibit a 100% over-edit rate on optimal code. Our guardrail raises correct abstention from 0% to to 44.4%, preserving a 100% edit rate on sub-optimal code with zero false abstentions. Calibration is uneven: GPT-5.4 Mini approaches near-perfect abstention, and simple code is recognized more reliably than complex code. Our framework offers a training-free mechanism to mitigate LLM overconfidence before deployment in production.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 14 of its 20 references that are in the map. First posted on arXiv 13 Sep 2026.
Builds on
14 of 20 references.
References · 14
- 2025AlphaEvolve: A coding agent for scientific and algorithmic discoverycited by 763
- 2025Why Language Models Hallucinatecited by 205
- 2023Learning Performance-Improving Code Editscited by 103
- 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 92
- 2024EffiBench: Benchmarking the Efficiency of Automatically Generated Codecited by 62
- 2024LLaMoCo: Instruction Tuning of Large Language Models for Optimization Code Generationcited by 45
- 2024How Efficient is LLM-Generated Code? A Rigorous & High-Standard Benchmarkcited by 39
- 2025SWE-Perf: Can Language Models Optimize Code Performance on Real-World Repositories?cited by 33
- 2024CodeMirage: Hallucinations in Code Generated by Large Language Modelscited by 23
- 2025Efficient Hallucination Detection for LLMs Using Uncertainty-Aware Attention Headscited by 14
- 2026Controlled Self-Evolution for Algorithmic Code Optimizationcited by 11
- 2023PerfRL: A Small Language Model Framework for Efficient Code Optimizationcited by 8
2 more
Built on by
Not cited yet.