arrow
Return

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
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

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.
Keywords:
Prompt generation
Project-specific code summarization
Large language model
In-context learning
Large Language Model-Aware In-Context Learning for Code Generation
err2025-08-14
err0
errOAAI
errJia Li; Chongyang Tao; Jia Li♂; Ge Li; Zhi Jin; Huangzhao Zhang; Zheng Fang; Fang Liu
errShare
errSave
Analyzing the performance of large language models on statement-level code summarization
err2026-05-16
err0
PREAI
errJie Zhu; Zhihui Wang; Tingting Xu; Junwu Zhu; Yonglong Zhang
errShare
errSave
errShare
errSave
Evaluating LLMs for Source Code Generation and Summarization Using Machine Learning Classification and Ranking
err2026-02-10
err0
errOAAI
errHussain Mahfoodh; Mustafa Hammad; Bassam A. Y. Alqaralleh; Aymen I. Zreikat
errShare
errSave
Context-aware code summary generation
err2025-08-06
err0
PREAI
errChia-Yi Su; Aakash Bansal; Yu Huang; Toby Jia-Jun Li; Collin McMillan
errShare
errSave
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
errShare
errSave
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
errShare
errSave
errShare
errSave

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
1.0W

Organization

C
Carnegie Mellon University
Scholars:
1.6K
Papers: 586
Citations: 1.5W
Shanghai Jiao Tong University cover
Shanghai Jiao Tong University
Scholars:
1.4W
Papers: 4.2K
Citations: 8.7W
Cited Papers

Cited Papers

errShare
errSave
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
errShare
errSave
Few-shot code translation via task-adapted prompt learning
err2024-06-01
err5
PREAI
errLi, Xuan; Yuan, Shuai; Gu, Xiaodong; Chen, Yuting; Shen, Beijun
errShare
errSave
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
The HadGEM2-ES implementation of CMIP5 centennial simulations
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
errShare
errSave
no more