Research

Paper

AI LLM March 04, 2026

CodeTaste: Can LLMs Generate Human-Level Code Refactorings?

Authors

Alex Thillen, Niels Mündler, Veselin Raychev, Martin Vechev

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 specified in detail, but often fail to discover the human refactoring choices when only presented with a focus area for improvement. A propose-then-implement decomposition improves alignment, and selecting the best-aligned proposal before implementation can yield further gains. CodeTaste provides an evaluation target and a potential preference signal for aligning coding agents with human refactoring decisions in realistic codebases.

Metadata

arXiv ID: 2603.04177
Provider: ARXIV
Primary Category: cs.SE
Published: 2026-03-04
Fetched: 2026-03-05 06:06

Related papers

Raw Data (Debug)
{
  "raw_xml": "<entry>\n    <id>http://arxiv.org/abs/2603.04177v1</id>\n    <title>CodeTaste: Can LLMs Generate Human-Level Code Refactorings?</title>\n    <updated>2026-03-04T15:34:18Z</updated>\n    <link href='https://arxiv.org/abs/2603.04177v1' rel='alternate' type='text/html'/>\n    <link href='https://arxiv.org/pdf/2603.04177v1' rel='related' title='pdf' type='application/pdf'/>\n    <summary>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.\n  Our experimental results indicate a clear gap across frontier models: agents perform well when refactorings are specified in detail, but often fail to discover the human refactoring choices when only presented with a focus area for improvement. A propose-then-implement decomposition improves alignment, and selecting the best-aligned proposal before implementation can yield further gains. CodeTaste provides an evaluation target and a potential preference signal for aligning coding agents with human refactoring decisions in realistic codebases.</summary>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.SE'/>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.AI'/>\n    <category scheme='http://arxiv.org/schemas/atom' term='cs.LG'/>\n    <published>2026-03-04T15:34:18Z</published>\n    <arxiv:primary_category term='cs.SE'/>\n    <author>\n      <name>Alex Thillen</name>\n    </author>\n    <author>\n      <name>Niels Mündler</name>\n    </author>\n    <author>\n      <name>Veselin Raychev</name>\n    </author>\n    <author>\n      <name>Martin Vechev</name>\n    </author>\n  </entry>"
}