Optimizing Knowledge Utilization for Multi-Intent Comment Generation with Large Language Models
Shuochuan Li, Zan Wang, Xiaoning Du, Zhuo Wu, Jiuqiao Yu, Junjie Chen

TL;DR
This paper introduces KUMIC, a framework that enhances large language models' ability to generate multi-intent code comments by leveraging retrieval and chain-of-thought techniques, significantly improving comment quality.
Contribution
KUMIC is a novel approach that combines retrieval of similar examples and chain-of-thought reasoning to better utilize knowledge in LLMs for multi-intent comment generation.
Findings
KUMIC outperforms baselines by over 14% in BLEU score.
It achieves more accurate intent-specific comments.
The framework effectively links code, statements, and comments through knowledge chains.
Abstract
Code comment generation aims to produce a generic overview of a code snippet, helping developers understand and maintain code. However, generic summaries alone are insufficient to meet the diverse needs of practitioners; for example, developers expect the implementation insights to be presented in an untangled manner, while users seek clear usage instructions. This highlights the necessity of multi-intent comment generation. With the widespread adoption of Large Language Models (LLMs) for code-related tasks, these models have been leveraged to tackle the challenge of multi-intent comment generation. Despite their successes, state-of-the-art LLM-based approaches often struggle to construct correct relationships among intents, code, and comments within a smaller number of demonstration examples. To mitigate this issue, we propose a framework named KUMIC for multi-intent comment…
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.
