arrow
Return

Context-aware code summary generation

delete2025-08-06
delete0
PRE
AI
C
Chia‐Yi Su *
A
Aakash Bansal
Y
Yu Huang
T
Toby Jia-Jun Li
C
Collin McMillan
DOI:10.1016/j.jss.2025.112580delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Recent advances in Large Language Models (LLMs) have helped make automatic code summarization a reality. However, the summaries these approaches write tend to focus on a narrow area of code. The results are summaries that explain what that function does internally, but lack a description of its purpose in the broader context of the program. In this paper, we present an approach for including this context in recent LLM-based code summarization. The input to our approach is a Java method and the summary of the caller methods. The output is a succinct English description of purpose of the method. The advantage of this approach is that we reduce 81% of the tokens in smaller models. We train the model in two steps. First we distill knowledge about code summarization from a large model, then we fine-tune the model using data from a study of human programmers who were asked to write code summaries. We evaluate our method and analyze the rationale behind the decision in the tournament style human study. We find in our human study that human programmers prefer the summary from our approach rather than GPT-4 on this task and accuracy is the most common reason a summary is better than others. In terms of the automatic metrics, we also observed 10% improvement in USE score.
Keywords:
code summarization
large language models
context-aware summaries
model distillation
human evaluation
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
Project-specific code summarization with in-context learning
err2024-10-01
err1
PREAI
errYun, Shangbo; Lin, Shuhuai; Gu, Xiaodong; Shen, Beijun
errShare
errSave
Learning to Generate Structured Code Summaries From Hybrid Code Context
err2024-10-01
err0
PREAI
errZhou, Ziyi; Li, Mingchen; Yu, Huiqun; Fan, Guisheng; Yang, Penghui; Huang, Zijie
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
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
A Survey on Large Language Models for Code Generation
err2026-02-01
err33
PREAI
errJiang, Juyong; Wang, Fan; Shen, Jiasi; Kim, Sungju; Kim, Sunghun
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

Journal

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

Organization

U
University of Notre Dame
Scholars:
1.4K
Papers: 389
Citations: 8.3K
L
Louisiana State University
Scholars:
735
Papers: 341
Citations: 6.0K
V
Vanderbilt University
Scholars:
1.7K
Papers: 615
Citations: 3.0W
researcher View more organizations
Cited Papers

Cited Papers

No cited papers available