# Poster 28090

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/28090

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hello everyone, now I am going to introduce our paper, how efficient is LLM-generated code, a rigorous and high standard benchmark.
I am Rui Zhongqiu from University of Illinois Urbana-Champaign. Advancement of LLM-based program synthesis calls for a thorough evaluation of LLM-generated code. Most of the existing evaluation frameworks focus on functional correctness of generated code. However, efficiency is another important measure of code quality that has been overlooked in existing evaluations. In this work, we aim to answer the question how
How does LLM generated code compare with expert-written code in terms of efficiency? Here we describe our evaluation framework. To achieve a fine-grained evaluation of efficiency, we need not only to let the most efficient code pass, but also to give a continuous score for less efficient code generated by LLMs. The naive idea is to time each code under large-scale input. However, because we have to set a time limit per test case to prevent an acceptably long execution time,
If we used only large-scale inputs to evaluate every code, most of the less efficient code would time out, making it impossible to distinguish different efficiencies. For example, for the problem and code samples in this figure, if we used large-scale inputs that allow only the code with theta log n iterations to pass, then we would not be able to give different scores for the code with 2 to the theta n recursions.
and the code with theta in iteration. To address this issue, we propose to use multiple levels one through l of test cases where each level has a different input scale carefully designed by a human expert so that algorithms with different efficiencies can pass different number of levels. Besides levels one through l, we use an additional level zero to filter out wrong using small strong inputs. Each level has multiple test cases. If they all...
The output of the code does not match the expected output in any test case or does not pass level 0. We will not count it into the SAT-K metric. If the code passes level 0 but exceeds the time limits in some level L,
We will still count it into the pass at k -metric that will escape the remaining levels. We assume that it will also exceed the time limit for the remaining levels because the input scale increases with the level L. Finally we will compute its efficiency score. In this example, level 0 has n smaller than 10 so that naive recursive algorithm in 2 to the theta n iterations can pass. Level 1 has n...
at most 30 so that the dynamic programming algorithm in theta n iterations can pass. Level 2 has n at most 9 ,000 so that the matrix exponentiation algorithm in theta log n iterations by repeated squaring can pass.
Level 3 has at most 10,000. So that doubling algorithm still in theta log -in iterations, yet with a smaller hidden constant in theta can pass. These carefully designed levels enable us to differentiate code samples that have different efficiencies. To appropriately handle write-sensitive execution time, we aim to propose an efficiency score whose dependence on the execution time vanishes whenever the execution time equals.
time exceeds the time limit. Thus, we define the efficiency score F_I_J_L_ as follows. Here, we use the max to characterize the worst-case efficiency since our expert -written input generators produce various types of test cases that cover the worst cases of various algorithms. Finally, since each level has a distinct hardness, we define the efficiency score E_I_J of a code sample C_I_J of problem I_
a weighted average over the levels one through L. But the score will be zero if code is incorrect. Now let's introduce the efficiency metric for an LLM. The PASATK metric is a standard metric in correctness evaluation, which means that the probability that at least one among K generated code samples is correct. So here we define a new metric, FI at K, by the expected maximum efficiency score of K independent code samples.
ReEIJ denotes the efficiency score of code Cij. Our metric Fi at K precisely characterizes the relation between code efficiency and sample size K via the maximum over K code samples. However, estimating Fi at K naively by generating K code samples and calculating their maximum can have high variance. To reduce the variance, we employed two advanced variance reduction techniques and finally produced the raw black realized and
And bootstrap estimator, which is unbiased and reduces the variance of the estimator. Furthermore, naively computing the binomial coefficients in the estimator can result in numerical instability. Instead, we propose a numerically stable implementation which is presented in Algorithm 1. To achieve a comprehensive evaluation of efficiency, we want to create a problem set that contains high-quality problems with a broad range of difficulty to produce efficient
Since we reference solutions and strong test case generators, we employ a human expert to curate them. Here are the main results. Overall, our results suggest that LLMs still fall short of generating expert-level efficient code, benchmarked with our expert-written reference solutions. Even the strongest commercial LLM, GPT-4, cannot achieve F1 0.5. For more thorough analysis, we further evaluate LLMs on two subsets of our...
of our project is to investigate capabilities in algorithm design and implementation optimization respectively. Our algorithm design subsets suggest that existing LLMs still struggle in designing advanced algorithms, and our implementation optimization subset suggests that existing LLMs are barely aware of implementation optimization, and improvement is mainly because random sampling generates multiple equivalent implementation.
That's Thanks for watching! it. Thanks for watching.
