Automated Extract Method Refactoring with Open-Source LLMs: A Comparative Study

Sivajeet Chand 1 Melih Kilic 1 Roland Würsching 1 Sushant Kumar Pandey 2 Alexander Pretschner 1 · 2025

Read Automated Extract Method Refactoring with Open-Source LLMs: A Comparative Study by Sivajeet Chand 1 Melih Kilic 1 Roland Würsching 1 Sushant Kumar Pandey 2 Alexander Pretschner 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-26480.txt.

Description

Sivajeet Chand, with four co-authors, tests whether open-source language models can clean up code on their own. Their task is the extract method refactoring, which moves a block of code into its own named method to make programs easier to read. Doing it by hand is slow, so automation would help, but the step needs care to keep code working.

Chand and the team compare five models, from three to eight billion parameters, on Python code. A loop of criticism and revision beat single-shot prompting on both test pass rates and quality. The best models passed most tests and cut method length from about twelve lines to about six. In a developer survey, over seventy percent accepted the machine-made changes, though the authors note that simple code metrics often clash with human judgement.

Catalog record

CREATORSivajeet Chand 1 Melih Kilic 1 Roland Würsching 1 Sushant Kumar Pandey 2 Alexander Pretschner 1
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE39 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2510-26480

Browse the full library · About the Tower of Babel