Better Python Programming for all: With the focus on Maintainability
Karthik Shivashankar, Antonio Martini

TL;DR
This paper presents a method to improve the maintainability of Python code generated by Large Language Models through fine-tuning for refactoring, resulting in more readable and less complex code.
Contribution
It introduces a fine-tuning approach for LLMs specifically targeting code maintainability, addressing a gap in existing research focused mainly on accuracy.
Findings
Significant improvement in code maintainability standards
Enhanced readability and reduced complexity of generated code
Effective fine-tuning method for AI-assisted refactoring
Abstract
This study aims to enhance the maintainability of code generated by Large Language Models (LLMs), with a focus on the Python programming language. As the use of LLMs for coding assistance grows, so do concerns about the maintainability of the code they produce. Previous research has mainly concentrated on the functional accuracy and testing success of generated code, overlooking aspects of maintainability. Our approach involves the use of a specifically designed dataset for training and evaluating the model, ensuring a thorough assessment of code maintainability. At the heart of our work is the fine-tuning of an LLM for code refactoring, aimed at enhancing code readability, reducing complexity, and improving overall maintainability. After fine-tuning an LLM to prioritize code maintainability, our evaluations indicate that this model significantly improves code maintainability…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Physics and Python Applications
MethodsFocus
