Lune

ACL Findings2026

Let the Comments Speak: A Multi-Agent Framework based on Large Language Model for Comment-Guided Code Refactoring

Zixuan Wang, Wutong Yu, Deyu Zhou

摘要

Code refactoring is essential for software maintainability, yet current Large Language Model (LLM) based frameworks primarily focus on syntax and neglect the vital semantic signals in code comments. As pointed out in Fowler's refactoring theory, explanatory comments function as semantic anchors that provide necessary guidance for method extraction. Moreover, research reports show that more than 84 percent of codebases lack appropriate code comments, which hinders the leverage of such guidance. To bridge this gap, we propose MACOR, a Multi-Agent framework for COmment-guided code Refactoring. In specific, MACOR populates original code with precise comments to provide necessary semantic guidance for the subsequent refactoring process. These generated signals are employed to retrieve expert examples. An iterative feedback is incorporated loop for validation. Experiments are conducted on three benchmarks using three base LLMs. Experimental results show that MACOR significantly optimizes code quality and achieves higher developer acceptance compared to the representative baselines.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • iSMELL: Assembling LLMs with Expert Toolsets for Code Smell Detection and Refactoring 引用了 Deep Learning Based Feature Envy Detection Boosted by Real-World Examples
  • Reflexion: language agents with verbal reinforcement learning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper8

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan 等NeurIPS 2023 · 5,828 次引用
  3. OctoPack: Instruction Tuning Code Large Language ModelsNiklas Muennighoff, Qian Liu, Armel Randy Zebaze, Qinkai Zheng 等ICLR 2024 · 203 次引用
  4. iSMELL: Assembling LLMs with Expert Toolsets for Code Smell Detection and RefactoringDi Wu, Fangwen Mu, Lin Shi, Zhaoqiang Guo 等ASE 2024 · 19 次引用
  5. Deep Learning Based Feature Envy Detection Boosted by Real-World ExamplesBo Liu, Hui Liu, Guangjie Li, Nan Niu 等FSE 2023 · 19 次引用

相关 Paper

  1. RefAgent: A Multi-agent LLM-based Framework for Automatic Software RefactoringKhouloud Oueslati, Maxime Lamothe, Foutse KhomhICSE 2026 · 1 次引用
  2. From Draft to Precision: Iterative Agentic Framework for Intent-Aware Code SummarizationYifei Ge, Chunrong Fang, Zhenyu Chen, Juan ZhaiISSTA 2026
  3. CORE: Resolving Code Quality Issues using LLMsNalin Wadhwa, Jui Pradhan, Atharv Sonwane, Surya Prakash Sahu 等FSE 2024 · 32 次引用
  4. Failure Localization in Multi-Agent Code Generation via Knowledge-Guided and Transferable ReasoningMingyang Geng, Shanzhi Gu, Zhipeng Liu, Chuanfu Xu 等AAAI 2026
  5. An LLM-Based Agent-Oriented Approach for Automated Code Design Issue LocalizationFraol Batole, David O'Brien, Tien N. Nguyen, Robert Dyer 等ICSE 2025 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖