arrow
返回

Project-specific code summarization with in-context learning

delete2024-10-01
delete1
PRE
AI
S
S M Yun
S
S.-J. LIN
X
Xiaodong Gu
B
Beijun Shen *
DOI:10.1016/j.jss.2024.112149delete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
Automatically generating summaries for source code has emerged as a valuable task in software development. While state-of-the-art (SOTA) approaches have demonstrated significant efficacy in summarizing general code, they seldom concern code summarization for a specific project. Project-specific code summarization (PCS) poses special challenges due to the scarce availability of training data and the unique styles of different projects. In this paper, we empirically analyze the performance of Large Language Models (LLMs) on PCS tasks. Our study reveals that using appropriate prompts is an effective way to solicit LLMs for generating project-specific code summaries. Based on these findings, we propose a novel project-specific code summarization approach called P-CodeSum. P-CodeSum gathers a repository-level pool of (code, summary) examples to characterize the project-specific features. Then, it trains a neural prompt selector on a high-quality dataset crafted by LLMs using the example pool. The prompt selector offers relevant and high-quality prompts for LLMs to generate project- specific summaries. We evaluate against a variety of baseline approaches on six PCS datasets. Experimental results show that the P-CodeSum improves the performance by 5.9% (RLPG) to 101.51% (CodeBERT) on BLEU-4 compared to the state-of-the-art approaches in project-specific code summarization.
Keyword:
Prompt generation
Project-specific code summarization
Large language model
In-context learning
Context-aware code summary generation上下文感知代码摘要生成
err2025-08-06
err0
PREAI
errChia-Yi Su; Aakash Bansal; Yu Huang; Toby Jia-Jun Li; Collin McMillan
err分享
err收藏
Function Call Graph Context Encoding for Neural Source Code Summarization
err2023-09-01
err5
PREAI
errBansal, Aakash; Eberhart, Zachary; Karas, Zachary; Huang, Yu; Mcmillan, Collin
err分享
err收藏
Can Large Language Models Serve as Evaluators for Code Summarization?大型语言模型能否作为代码摘要的评估者?
err2025-08-19
err0
errOAAI
errYang Wu; Yao Wan; Zhaoyang Chu; Wenting Zhao; Ye Liu; Hongyu Zhang; Xuanhua Shi; Hai Jin; Philip S. Yu
err分享
err收藏
err分享
err收藏

期刊

Journal of Systems and Software 封面图
Journal of Systems and Software
IF:
4.1
论文数:
5.5K
被引数:
1.0W

机构

C
Carnegie Mellon University
学者数:
1.6K
论文数: 586
被引数: 1.5W
上海交通大学 封面图
上海交通大学
学者数:
1.4W
论文数: 4.2K
被引数: 8.7W
引用论文

引用论文

err分享
err收藏
Long-Term Stability of Novel Crucible Systems for the Growth of Oxygen-Free Czochralski Silicon Crystals
err2022-12-22
err0
errOAAI
errFelix Sturm; Matthias Trempa; Gordian Schuster; Rainer Hegermann; Philipp Goetz; Rolf Wagner; Gilvan Barroso; Patrick Meisner; Christian Reimann; Jochen Friedrich
err分享
err收藏
Few-shot code translation via task-adapted prompt learning
err2024-06-01
err5
PREAI
errLi, Xuan; Yuan, Shuai; Gu, Xiaodong; Chen, Yuting; Shen, Beijun
err分享
err收藏
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
The HadGEM2-ES implementation of CMIP5 centennial simulationsCMIP5百年模拟的HadGEM2-ES实现
err
IF0
err2011-03-31
err0
errOAAI
errC. D. Jones; J. K. Hughes; N. Bellouin; S. C. Hardiman; G. S. Jones; J. Knight; S. Liddicoat; F. M. O'Connor; R. J. Andres; C. Bell; K.-O. Boo; A. Bozzo; N. Butchart; P. Cadule; K. D. Corbin; M. Doutriaux-Boucher; P. Friedlingstein; J. Gornall; L. Gray; P. R. Halloran; G. Hurtt; W. Ingram; J.-F. Lamarque; R. M. Law; M. Meinshausen; S. Osprey; E. J. Palin; L. Parsons Chini; T. Raddatz; M. Sanderson; A. A. Sellar; A. Schurer; P. Valdes; N. Wood; S. Woodward; M. Yoshioka; M. Zerroukat
err分享
err收藏
没有更多内容