Rethinking Code Refinement: Learning to Judge Code Efficiency

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Seo, Minju, Baek, Jinheon, Hwang, Sung Ju
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913567224102912
author Seo, Minju
Baek, Jinheon
Hwang, Sung Ju
author_facet Seo, Minju
Baek, Jinheon
Hwang, Sung Ju
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_22375
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Rethinking Code Refinement: Learning to Judge Code Efficiency
Seo, Minju
Baek, Jinheon
Hwang, Sung Ju
Software Engineering
Artificial Intelligence
Computation and Language
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.
title Rethinking Code Refinement: Learning to Judge Code Efficiency
topic Software Engineering
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2410.22375