cs.SEMar 4, 2026

CodeTaste: Can LLMs Generate Human-Level Code Refactorings?

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

Organizations: Department of Computer Science, ETH Zurich · LogicStar.ai, Zurich, Switzerland

Abstract

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. We investigate whether agents (i) can execute refactorings reliably and (ii) identify the refactorings that human developers actually chose in real codebases. To this end, we construct CodeTaste, a benchmark mined from large multi-file open-source refactorings. To score solutions, we combine repository test suites that measure functional correctness with tailored static checks that verify removal of undesired and introduction of desired code patterns using dataflow reasoning. Our results show a clear gap: agents perform well at implementing refactorings that are specified in detail, but often fail to discover the human refactoring choices when given a focus area for changes. 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. We release the benchmark, leaderboard, and code.

Figures & tables

Appendix figures & tables19 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring

    Aug 21, 2026Muhammad Waseem, Aakash Ahmad, Pekka AbrahamssonAutomated Code RefactoringAutomated Software Engineering

  2. SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring

    Aug 10, 2026Yuling Shi, Jinghan Xu, Kelin Fu +12AI Coding AgentsSoftware Engineering Benchmarks

  3. RefactorAssist: Agentic Refinement for Reliable Code Refactoring

    Aug 2, 2026Jonathan Cordeiro, Shayan Noei, Ying ZouLLM Self-RefinementAutomated Program Repair