SEAICLOct 29, 2024

Rethinking Code Refinement: Learning to Judge Code Efficiency

arXiv:2410.22375v126 citationsh-index: 20EMNLP
Originality Incremental advance
AI Analysis

This addresses the time-consuming issue of comparing code efficiency for developers and researchers, though it is incremental as it builds on existing code language models.

The paper tackles the problem of automatically judging code efficiency without running code, proposing a code language model that classifies or predicts relative improvement between two code versions, validated across multiple programming languages and refinement steps.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes