From Draft to Precision: Iterative Agentic Framework for Intent-Aware Code Summarization
Yifei Ge, Chunrong Fang, Zhenyu Chen, Juan Zhai
Key points
From the paper's conclusion- To bridge this gap, we propose a plan-conditioned revision framework that improves code summarization through iterative revision.
Abstract
Code summarization aims to generate natural language (NL) descriptions for code snippets to assist developers in understanding and maintaining programs. Recent advances in large language models (LLMs) have substantially improved the quality of automatic code summarization. In real-world projects, code comments are written to serve different developer intents, which has motivated the development of intent-aware summarization methods. However, existing intent-aware methods still struggle to fully capture developer intent, often producing incomplete or misaligned summaries. Our empirical study reveals that real-world comments are typically refined through multiple rounds of developer revision, which we believe is key to achieving high quality. However, current methods typically overlook this iterative refinement. To bridge this gap, we propose a plan-conditioned revision framework that improves code summarization through iterative revision. It integrates two collaborating agents: a Generator that produces and revises summaries, and a Reviewer that assesses the generated summary and drafts targeted revision plans to guide subsequent edits using available contextual information. By iteratively refining summaries with revision plans and contextual information, our framework yields summaries that are more accurate, complete, and better aligned with developer intent. Extensive experiments on an intent-annotated CSN-Java benchmark demonstrate the effectiveness of our method. On automatic metrics, our method achieves a 28.75% improvement over the state-of-the-art baseline methods across all intents. Besides, in human studies, our framework yields average gains of over 20% in usefulness, adequacy, and intent alignment. It also achieves the highest Top-1 preference (over 40% across all intents), underscoring its practical advantage for developers
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Understanding Regression in Code Self-Refinement: A Study of Refinement Protocols Without Execution FeedbackAI · 2026
- Agentic Refactoring: An Empirical Study of AI Coding AgentsACM Transactions on Software Engineering and Methodology · 2026
- CIVER: Causal Intervention Verification for Reliable Code ReviewarXiv · 2026
- Humanize: Judgement Engineering for Agentic CodingarXiv · 2026
- ComBeautify: Leveraging Code Change Summaries for Conventional Commit GenerationarXiv · 2026
- CodeReviewBench: An Automated Benchmark for Evaluating the Software FactoryarXiv · 2026