R2ComSync: Improving Code-Comment Synchronization with In-Context Learning and Reranking
Zhen Yang, Hongyi Lin, Xiao Yu, Jacky Wai Keung, Shuo Liu, Pak Yuen Patrick Chan, Yicheng Sun, Fengji Zhang

TL;DR
R2ComSync leverages in-context learning, retrieval, and re-ranking to enhance code-comment synchronization, significantly outperforming existing methods across multiple datasets and programming languages.
Contribution
The paper introduces R2ComSync, a novel ICL-based CCS approach with hybrid retrieval and multi-turn re-ranking, addressing LLM limitations in code-comment synchronization.
Findings
R2ComSync outperforms SOTA methods in accuracy.
Comments generated by R2ComSync are of higher quality.
The approach is effective across Java and Python datasets.
Abstract
Code-Comment Synchronization (CCS) aims to synchronize the comments with code changes in an automated fashion, thereby significantly reducing the workload of developers during software maintenance and evolution. While previous studies have proposed various solutions that have shown success, they often exhibit limitations, such as a lack of generalization ability or the need for extensive task-specific learning resources. This motivates us to investigate the potential of Large Language Models (LLMs) in this area. However, a pilot analysis proves that LLMs fall short of State-Of-The-Art (SOTA) CCS approaches because (1) they lack instructive demonstrations for In-Context Learning (ICL) and (2) many correct-prone candidates are not prioritized.To tackle the above challenges, we propose R2ComSync, an ICL-based code-Comment Synchronization approach enhanced with Retrieval and Re-ranking.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
