Rethinking Code Refinement: Learning to Judge Code Efficiency

Minju Seo, Jinheon Baek, Sung Ju Hwang
10/29/2024
cs.SEcs.AIcs.CL

No official code found. Best implementation: going-doer/judge_code_efficiency (1 star, last commit 2024-11-06).

Abstract

Large Language Models (LLMs) have demonstrated impressive capabilities in understanding and generating codes. Due to these capabilities, many recent methods are proposed to automatically refine the codes with LLMs. However, we should rethink that the refined codes (from LLMs and even humans) are not always more efficient than their original versions. On the other hand, running two different versions of codes and comparing them every time is not ideal and time-consuming. Therefore, in this work, we propose a novel method based on the code language model that is trained to judge the efficiency between two different codes (generated across humans and machines) by either classifying the superior one or predicting the relative improvement. We validate our method on multiple programming languages with multiple refinement steps, demonstrating that the proposed method can effectively distinguish between more and less efficient versions of code.

View on arXivView PDF

Code Implementations(1)

[EMNLP Findings 2024] Rethinking Code Refinement: Learning to Judge Code Efficiency

10Shell, PythonOct 3, 20241 years ago

Similar Papers

Cite this paper

@article{seo2024rethinking,
  title  = {Rethinking Code Refinement: Learning to Judge Code Efficiency},
  author = {Minju Seo and Jinheon Baek and Sung Ju Hwang},
  year   = {2024},
  eprint = {2410.22375},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.22375v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.22375.svg)](https://codeofpaper.com/paper/2410.22375)

Discussion