paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Source Code Summarization in the Era of Large Language Models

大语言模型时代的源代码摘要
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 论文研究 LLM 代码摘要工作流,评估提示技术、解码参数与模型能力,属于 LLM 在代码任务上的能力分析,与用户关注的静态分析、形式化验证、浮点/贝叶斯程序分析无直接交集;且主要目标是评估 LLM 本身,不符合用户对“LLM 仅作为工具改进静态分析”的偏好。引用 45 inbox
Weisong Sun, Yun Miao, Yuekang Li, Hongyu Zhang, Chunrong Fang, Yi Liu, Gelei Deng, Yang Liu, Zhenyu Chen
crossref: 2026-09-12

AI 速览

一句话:系统研究 LLM 代码摘要工作流,评估自动评测、提示技术、解码参数、语言类型与模型能力差异。

本文对 LLM 时代的代码摘要进行系统全面研究,覆盖评测、提示、模型设置、语言类型与模型比较等环节。作者首先考察自动评测方法,发现 GPT-4 评测与人工评价最一致;随后比较 zero-shot、few-shot、chain-of-thought、critique 和 expert 五种提示技术,发现高级提示未必优于简单 zero-shot。实验还分析 top_p 与 temperature 的影响,发现其作用因基础模型和编程语言而异,但两者影响相似。进一步测试不同编程语言上的摘要能力,发现 LLM 在逻辑编程语言上的表现弱于过程式或面向对象语言。最后意外发现 7B 参数的 CodeLlamaInstruct 在生成设计理由和代码属性断言方面可超过 GPT-4。

问题
如何在大语言模型时代系统理解代码摘要工作流各环节,并评估 LLM 生成注释的质量与能力边界。
方法
考察自动评测方法与人工评测的一致性,比较五种提示技术,分析 top_p 和 temperature 设置,并测试不同编程语言上的摘要表现及不同规模模型的能力。
评估
以 GPT-4 评测等自动指标结合人工评估,对多种 LLM 和语言类型进行实验比较,包括与 GPT-4 及 CodeLlamaInstruct 7B 的对比。
原文摘要(Abstract)

To support software developers in understanding and maintaining programs, various automatic (source) code summarization techniques have been proposed to generate a concise natural language summary (i.e., comment) for a given code snippet. Recently, the emergence of large language models (LLMs) has led to a great boost in the performance of coderelated tasks. In this paper, we undertake a systematic and comprehensive study on code summarization in the era of LLMs, which covers multiple aspects involved in the workflow of LLMbased code summarization. Specifically, we begin by examining prevalent automated evaluation methods for assessing the quality of summaries generated by LLMs and find that the results of the GPT-4 evaluation method are most closely aligned with human evaluation. Then, we explore the effectiveness of five prompting techniques (zero-shot, few-shot, chain-of-thought, critique, and expert) in adapting LLMs to code summarization tasks. Contrary to expectations, advanced prompting techniques may not outperform simple zero-shot prompting. Next, we investigate the impact of LLMs' model settings (including top_p and temperature parameters) on the quality of generated summaries. We find the impact of the two parameters on summary quality varies by the base LLM and programming language, but their impacts are similar. Moreover, we canvass LLMs' abilities to summarize code snippets in distinct types of programming languages. The results reveal that LLMs perform suboptimally when summarizing code written in logic programming languages compared to other language types (e.g., procedural and object-oriented programming languages). Finally, we unexpectedly find that CodeLlamaInstruct with 7B parameters can outperform advanced GPT-4 in generating summaries describing code design rationale and asserting code properties. We hope that our findings can provide a comprehensive understanding of code summarization in the era of LLMs.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8695,
  title = {Source Code Summarization in the Era of Large Language Models},
  author = {Weisong Sun and Yun Miao and Yuekang Li and Hongyu Zhang and Chunrong Fang and Yi Liu and Gelei Deng and Yang Liu and Zhenyu Chen},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00034}
}