mlsanityData to 7 Oct 2026

Leveraging LLMs, IDEs, and Semantic Embeddings for Automated Move Method Refactoring

arXiv 2503.20934 ↗First posted 26 Mar 2025cs.SE cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

MOVEMETHOD is a hallmark refactoring. Despite a plethora of research tools that recommend which methods to move and where, these recommendations do not align with how expert developers perform MOVEMETHOD. Given the extensive training of Large Language Models and their reliance upon naturalness of code, they should expertly recommend which methods are misplaced in a given class and which classes are better hosts. Our formative study of 2016 LLM recommendations revealed that LLMs give expert suggestions, yet they are unreliable: up to 80% of the suggestions are hallucinations. We introduce the first LLM fully powered assistant for MOVEMETHOD refactoring that automates its whole end-to-end lifecycle, from recommendation to execution. We designed novel solutions that automatically filter LLM hallucinations using static analysis from IDEs and a novel workflow that requires LLMs to be self-consistent, critique, and rank refactoring suggestions. As MOVEMETHOD refactoring requires global, projectlevel reasoning, we solved the limited context size of LLMs by employing refactoring-aware retrieval augment generation (RAG). Our approach, MM-assist, synergistically combines the strengths of the LLM, IDE, static analysis, and semantic relevance. In our thorough, multi-methodology empirical evaluation, we compare MM-assist with the previous state-of-the-art approaches. MM-assist significantly outperforms them: (i) on a benchmark widely used by other researchers, our Recall@1 and Recall@3 show a 1.7x improvement; (ii) on a corpus of 210 recent refactorings from Open-source software, our Recall rates improve by at least 2.4x. Lastly, we conducted a user study with 30 experienced participants who used MM-assist to refactor their own code for one week. They rated 82.8% of MM-assist recommendations positively. This shows that MM-assist is both effective and useful.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 15 of its 61 references that are in the map. First posted on arXiv 26 Mar 2025.

Builds on

15 of 61 references.

References · 15

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  2. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  3. 2024Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preferencecited by 1,151
  4. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
  5. 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
  6. 2023Refactoring Programs Using Large Language Models with Few-Shot Examplescited by 27
  7. 2024Unprecedented Code Change Automation: The Fusion of LLMs and Transformation by Examplecited by 15
  8. 2024How to Refactor this Code? An Exploratory Study on Developer-ChatGPT Refactoring Conversationscited by 11
  9. 2016Why We Refactor? Confessions of GitHub Contributorscited by 10
  10. 2024An Empirical Study on the Potential of LLMs in Automated Software Refactoringcited by 10
  11. 2025MANTRA: Enhancing Automated Method-Level Refactoring with Contextual RAG and Multi-Agent LLM Collaborationcited by 10
  12. 2024EM-Assist: Safe Automated ExtractMethod Refactoring with LLMscited by 8
3 more
  1. 2020Recommendation of Move Method Refactoring Using Path-Based Representation of Codecited by 4
  2. 2022RMove: Recommending Move Method Refactoring Opportunities using Structural and Semantic Representations of Codecited by 2
  3. 2022Automated Variable Renaming: Are We There Yet?cited by 1

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring
  2. 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?
  3. 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Grounding
  4. 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring
  5. 2025Beyond Code Generation: LLM-supported Exploration of the Program Design Space
  6. 2025RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring
  7. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
  8. 2024An Empirical Study on the Code Refactoring Capability of Large Language Models