CodeTaste: Can LLMs Generate Human-Level Code Refactorings?
Alex Thillen, Niels M\"undler, Veselin Raychev, Martin Vechev

TL;DR
This paper introduces CodeTaste, a benchmark for evaluating large language models' ability to perform and identify human-like code refactorings, highlighting current performance gaps and potential improvements.
Contribution
The paper presents CodeTaste, a novel benchmark for assessing LLMs on code refactoring tasks and proposes methods to improve alignment with human developer choices.
Findings
LLMs perform well with detailed refactoring instructions
Models struggle to replicate human refactoring decisions without specific guidance
A propose-then-implement approach enhances model alignment with human refactoring choices
Abstract
Large language model (LLM) coding agents can generate working code, but their solutions often accumulate complexity, duplication, and architectural debt. Human developers address such issues through refactoring: behavior-preserving program transformations that improve structure and maintainability. In this paper, we investigate if LLM agents (i) can execute refactorings reliably and (ii) identify the refactorings that human developers actually chose in real codebases. We present CodeTaste, a benchmark of refactoring tasks mined from large-scale multi-file changes in open-source repositories. To score solutions, we combine repository test suites with custom static checks that verify removal of undesired patterns and introduction of desired patterns using dataflow reasoning. Our experimental results indicate a clear gap across frontier models: agents perform well when refactorings are…
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
TopicsSoftware Engineering Research · Scientific Computing and Data Management · Machine Learning in Materials Science
