A Performance Study of LLM-Generated Code on Leetcode
Tristan Coignion, Cl\'ement Quinton, Romain Rouvoy

TL;DR
This paper assesses the performance of various Large Language Models in generating code for Leetcode problems, comparing their efficiency to human solutions and introducing a new measurement method.
Contribution
It introduces a novel method for measuring LLM code speed and provides a comprehensive comparison of 18 LLMs against human solutions on Leetcode.
Findings
LLMs produce code with performance comparable to or better than humans.
The study reveals minimal impact of model temperature on code performance.
LLMs can generate more efficient code than human-written solutions.
Abstract
This study evaluates the efficiency of code generation by Large Language Models (LLMs) and measures their performance against human-crafted solutions using a dataset from Leetcode. We compare 18 LLMs, considering factors such as model temperature and success rate, and their impact on code performance. This research introduces a novel method for measuring and comparing the speed of LLM-generated code, revealing that LLMs produce code with comparable performance, irrespective of the adopted LLM. We also find that LLMs are capable of generating code that is, on average, more efficient than the code written by humans. The paper further discusses the use of Leetcode as a benchmarking dataset, the limitations imposed by potential data contamination, and the platform's measurement reliability. We believe that our findings contribute to a better understanding of LLM capabilities in code…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
MethodsSparse Evolutionary Training · SPEED: Separable Pyramidal Pooling EncodEr-Decoder for Real-Time Monocular Depth Estimation on Low-Resource Settings
