REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring
- URL: http://arxiv.org/abs/2608.23611v1
- Date: Fri, 21 Aug 2026 17:44:40 GMT
- Title: REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring
- Abstract summary: REFINE is a tool-agnostic, evidence-aware multi-agent approach for generating Java file-level candidates.<n>We evaluate REFINE on 450 Java files from 15 open-source systems.
- Score: 3.294884078309524
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Large Language Models (LLMs) offer new opportunities for automated code refactoring. However, generated changes must reduce targeted quality problems without introducing new issues or altering behaviour-relevant code structures. We introduce REFINE (Refactoring with Evidence-aware Flow for Integrated ageNtic Execution), a tool-agnostic, evidence-aware multi-agent approach for generating Java file-level refactoring candidates. REFINE combines static-analysis-guided smell identification, smell-informed planning, LLM-based transformation, automated re-analysis, preservation checks, and structured reporting. We evaluate REFINE on 450 Java files from 15 open-source systems, producing 1,350 model-pass outputs using OpenAI GPT-5.5, Google Gemini 3.1 Pro Preview, and Anthropic Claude Opus 4.8. REFINE reduces detected code smells by 68.26%, 72.79%, and 68.49% across the three configurations, respectively, with the strongest reductions observed for major smells. A matched 150-file direct-prompt baseline shows that REFINE achieves a higher median code-smell reduction with smaller edits and fewer public-method removals. However, broader quality improvements are inconsistent, and preservation checks reveal residual risks, including assert/fail-call changes and public-method removal. Therefore, REFINE outputs should be treated as refactoring candidates requiring compilation, testing, dependency analysis, and human review before adoption in repository- or system-level settings.
Related papers
- RefactorAssist: Agentic Refinement for Reliable Code Refactoring [0.3657314044338856]
Large Language Models (LLMs) have demonstrated potential for automating software engineering tasks.<n>LLMs often introduce subtle errors, leading to functional behavior changes and failed unit tests.<n>We develop the RefactorAssist agent to improve the functional correctness of LLM-generateds.
arXiv Detail & Related papers (2026-08-02T01:32:22Z) - ReproRepo: Scaling Reproducibility Audits with GitHub Repository Issues [54.98461672730087]
We introduce ReproRepo, a scalable framework for evaluation that leverages human-raised GitHub issues as naturally occurring supervision on realistic reproduction blockers.<n>We instantiate ReproRepo on 1,149 recent machine learning papers from major conferences and evaluate four frontier model-agent configurations.<n>Our results show that LLM agents, even without executing code, can identify many real-world problems from paper-repository pairs.
arXiv Detail & Related papers (2026-06-16T17:58:05Z) - SmellBench: Evaluating LLM Agents on Architectural Code Smell Repair [1.6922906233636834]
Architectural code smells erode software maintainability and are costly to repair manually.<n>We present the first empirical evaluation of large language model agents on architectural code smell repair.<n>We contribute SmellBench, a task orchestration framework that incorporates smell-type-specific optimized prompts.
arXiv Detail & Related papers (2026-05-07T22:33:32Z) - LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation [75.05397479715576]
Large language models (LLMs) and agents have shown promising progress, but their true capabilities and failure modes remain unclear.<n>We present the first systematic and contamination-aware study of LLM- and agent-based formal specification generation for C programs.
arXiv Detail & Related papers (2026-05-02T11:31:33Z) - Dynamic analysis enhances issue resolution [53.50448142467294]
DAIRA (Dynamic Analysis-enhanced Issue Resolution Agent) is an automated repair framework that embeds dynamic analysis into the agent's reasoning cycle.<n> Driven by a Test Tracing-Driven methodology, DAIRA utilizes lightweight monitors to extract critical runtime data.<n>When powered by Gemini 3 Flash Preview, DAIRA establishes a new state-of-the-art (SOTA) performance, achieving a 79.4% resolution rate on the SWE-bench Verified dataset.
arXiv Detail & Related papers (2026-03-23T14:48:54Z) - NERFIFY: A Multi-Agent Framework for Turning NeRF Papers into Code [49.610331036334316]
We introduce NERFIFY, a framework that reliably converts NeRF research papers into trainable Nerfstudio plugins.<n>Code, data and implementations will be publicly released.
arXiv Detail & Related papers (2026-02-28T20:57:32Z) - SWE-Refactor: A Repository-Level Benchmark for Real-World LLM-Based Code Refactoring [20.694251041823097]
Large Language Models (LLMs) have attracted wide interest for tackling software engineering tasks.<n>Existing benchmarks commonly suffer from three shortcomings.<n>SWE-Refactor comprises 1,099 developer-written, behavior-preserving LLMs mined from 18 Java projects.
arXiv Detail & Related papers (2026-02-03T16:36:29Z) - ROSE: Transformer-Based Refactoring Recommendation for Architectural Smells [3.946103868607285]
Existing tools detect such smells but rarely suggest how to fix them.<n>We frame the task as a three-class classification problem and fine-tune both models on over 2 million instances mined from 11,149 open-source Java projects.<n>Our results show that transformer-based models can effectively bridge the gap between smell detection and actionable repair.
arXiv Detail & Related papers (2025-07-16T18:19:51Z) - The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models [48.073219761367184]
We investigate an APR pipeline that balances the generation of multiple outputs and multiple rounds of iteration.<n>We fine-tune each model on an APR dataset with three sizes (1K, 30K, 65K) and two techniques (Full Fine-Tuning and LoRA)<n>Our results show that by using only a fraction (1%) of the fine-tuning dataset, we can achieve improvements of up to 78% in the number of plausible patches generated.
arXiv Detail & Related papers (2025-05-05T18:06:51Z) - ReF Decompile: Relabeling and Function Call Enhanced Decompile [50.86228893636785]
The goal of decompilation is to convert compiled low-level code (e.g., assembly code) back into high-level programming languages.<n>This task supports various reverse engineering applications, such as vulnerability identification, malware analysis, and legacy software migration.
arXiv Detail & Related papers (2025-02-17T12:38:57Z) - Automated Unit Test Refactoring [10.847400457238423]
Test smells arise from poor design practices and insufficient domain knowledge.<n>We propose UTRefactor, a context-enhanced, LLM-based framework for automatic test in Java projects.<n>We evaluate UTRefactor on 879 tests from six open-source Java projects, reducing the number of test smells from 2,375 to 265, achieving an 89% reduction.
arXiv Detail & Related papers (2024-09-25T08:42:29Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.