Skip to content

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

Aug 2026 · 0 citations · 28 references
Computer Science

TL;DR

This work introduces 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 that achieves a higher median code-smell reduction with smaller edits and fewer public-method removals.

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.

View source

Similar papers

Aug 2026

Automating best-practice refactoring in Java via multi-agent planning and verification

An automated approach that explicitly targets Java best-practice violations across real-world projects is proposed, intended to make automated refactoring more controlled than naïve single-step LLM rewriting by introducing explicit applicability assessment, rule-specific transformation guidance, and post-hoc verification.

Jian Yang, Jing Li, Yuanyuan Gao et al. · 0 citations
Review Open access Aug 2026

AgentCodeReview: Implementation and Comprehensive Benchmark Evaluation of a Multi-Agent Framework for Explainable Code Review and Automated Bug Repair

The AgentCodeReview system is presented, a multi-agent system that is able to conduct explainable code review and automated bug repair by leveraging software engineering agents with different code review tasks and its utility and extensibility to the field of explainable AI in software quality assurance are demonstrated.

B. N, T. L. Manasa · 0 citations
Preprint Aug 2026

A Unified Issue Resolution Benchmark for Requirement Clarification, Planning, and Code Generation for Coding Agents

SWE-RPG is introduced, a repository-level benchmark that combines executable patch evaluation with validated ground-truth references (GTs) for Requirement Clarification and Implementation Planning, and suggests implicit-requirement recovery as a key candidate direction for improving coding agents.

Xin Zhou, Chun-Yong Chong, Kisub Kim et al. · 0 citations
Preprint Aug 2026

TDD-Agent: Test-Driven Reasoning for Code Generation

TDD-Agent is introduced, which operationalizes the test-driven development paradigm for code generation and improves not only code correctness but also the effectiveness of the generated tests, yielding higher pass rates, coverage, and mutation scores, suggesting that tests can serve as evolving reasoning artifacts rather than fixed validators.

Hong Yu, Ke-Fan Li, Jia-Kun Li et al. · 2 citations
Review Open access Aug 2026

Agentcodereview: A Multi-Agent Framework For Explainable Code Review And Automated Bug Repair

Comparisons of AgentCodeReview against single-agent and non-agentic baselines indicate that role specialization and explicit verification improve review accuracy, repair effectiveness and the transparency of the generated rationales, offering a reproducible pathway toward trustworthy autonomous software maintenance.

B. N, T. L. Manas · 0 citations
#artificial intelligence Preprint Sep 2026

KC-Bench: A Dynamic Interactive Benchmark for Evaluating Knowledge Conflicts in LLM Agents

As LLMs increasingly act through tools, they must reconcile user instructions, parametric knowledge, and dynamic environmental observations before taking actions. We introduce KC-Bench, a controlled multi-turn benchmark for measuring this capability across world-knowledge conflicts, input inconsistencies, and multi-source temporal conflicts. Its 238 tasks are manually screened from more than 1,000 generated candidates and combine a user simulator, stateful tools, deterministic environment assertions, an open-source natural-language evaluator, and human trajectory verification. Evaluation of nine models, including DeepSeek-V4-Flash, GLM-5.2, and MiniMax-M3, shows substantial cross-domain variation: no model handles factual correction, identity consistency checking, and temporal conflict resolution reliably across all settings. In the simulated environments, missed conflicts can propagate to tool calls or synthetic protected-data flows. KC-Bench isolates this model-level behavior rather than ranking complete agent frameworks, and provides a reproducible diagnostic for developing conflict-aware reasoning and execution safeguards.

Yaxing Lyu, Sheng-Jie Zhou, B. Toh et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Jun 3, 2026

MIT researchers teach AI models to interpret charts

The new ChartNet training dataset could improve the accuracy of vision-language models that help analyze business trends or interpret scientific figures.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.