Context-Focused Prompt Tuning Pre-Trained Code Models to Improve Code Summarization

2024 IEEE 48TH ANNUAL COMPUTERS, SOFTWARE, AND APPLICATIONS CONFERENCE, COMPSAC 2024(2024)

引用 0|浏览6
摘要
Existing code summarization approaches overlook developers' discriminative context focuses when generating code comments. This paper proposes a context-focused code sum-marization approach based on the prompt tuning technique. It enables the pre-trained code models to identify specific context focuses around a method and to generate the method's comment with corresponding contextual information, which improves the accuracy and informativeness of the generated comments. As the first attempt, we design prompt templates for six common types of contexts, construct a context-focused code-comment dataset, and prompt-tune two pre-trained code models with the dataset to generate code comments. The experimental results demonstrate that our approach significantly improves the existing models to generate context-focused comments. Compared with existing approaches, our generated comments are more informative, and our models can adapt to different code contexts, making the generation process more interpretable. We discuss the envisioned application of our approach and challenges for future work to tackle, including identifying more essential code contexts automatically, constructing more effective prompts, etc.
更多
查看译文
关键词
Code Comment,Code Summarization,Code Context,Prompt Tuning
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
0
您的评分 :

暂无评分

数据免责声明
页面数据均来自互联网公开来源、合作出版商和通过AI技术自动分析结果,我们不对页面数据的有效性、准确性、正确性、可靠性、完整性和及时性做出任何承诺和保证。若有疑问,可以通过电子邮件方式联系我们:report@aminer.cn