IC-1307Released LLMs (CodeLlama 7B/13B/34B, GPT-3.5, GPT-4) achieve limited code-optimization speedups with standard prompting, with the best baseline (GPT-3.5 CoT) reaching only 1.60x versus the 3.66x human reference

Alexander G Shypula, Aman Madaan, Yimeng Zeng, Uri Alon, Jacob R. Gardner, Yiming Yang, Milad Hashemi, Graham Neubig, Parthasarathy Ranganathan, Osbert Bastani, Amir Yazdanbakhsh

SourceLearning Performance-Improving Code Edits

The paper evaluates five released LLMs on the PIE test set (978 C++ program pairs) using instruction-only, few-shot, and chain-of-thought prompting. Without task-specific training data, all models struggle: CodeLlama 7B achieves at most 1.13x speedup (CoT, best@8), CodeLlama 34B reaches 1.30x, GPT-3.5 reaches 1.60x, and GPT-4 reaches 1.58x. The human reference for the same test set is 3.66x average speedup. The gap between the best prompting baseline and human performance is roughly 2x.

Evidence
correlational
Key metric
GPT-3.5 CoT best@8: 43.05% opt, 1.60x speedup; GPT-4 CoT best@8: 42.74% opt, 1.58x; CodeLlama 34B CoT best@8: 19.63% opt, 1.30x; CodeLlama 7B CoT best@8: 7.46% opt, 1.13x; human reference: 3.66x
Caveat
Results are measured on a single test set of 978 competitive programming problems in C++; the 10% speedup threshold for counting a program as 'optimized' may undercount small but real improvements.
Model
Code Llama, GPT-3.5 / ChatGPT-3.5, GPT-4 / ChatGPT4 / GPT-4 Code Interpreter / GPT-4 Technical Report
Concepts
Failure mode
Datasets
CodeNet [source]
Methods
Chain-of-Thought prompting / Chain-of-Thought (CoT) prompting / CoT prompting / Few-shot Chain of Thought / Few-shot CoT / Chain-of-Thought (CoT-S) / CoT-bag prompting / Few-shot CoT prompting / Rationale prompting / Zero-shot CoT prompting / Wei et al. (2022) chain-of-thought prompting [primary], Few-shot prompting / 2-shot prompting / Few-shot ICL / Few-shot prompting for base models [primary]
Related work
Code Llama [context], AlphaCode [context]
Related findings
IC-1308, IC-1309, IC-1310
Extraction
automatic-extraction