arrow
Return

Analyzing the performance of large language models on statement-level code summarization

delete2026-05-16
delete0
PRE
AI
J
Jie Zhu
Z
Zhihui Wang
T
Tingting Xu
J
Junwu Zhu *
Y
Yonglong Zhang
DOI:10.1007/s10489-026-07214-0delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code summarization provides concise descriptions of code, covering functionality, logic, and usage, which is essential for enhancing code quality and maintainability. Recent advancements in large language models (LLMs) have demonstrated strong performance in this task, gradually replacing traditional deep learning methods. However, most studies focus on function-level code summarization, leaving statement-level code summarization underexplored. Statement-level code summarization describes the functionality of key statements in code and plays a vital role in understanding higher-level code units like functions and classes. However, this task faces challenges due to its high context dependence and other factors. This paper evaluates LLMs for statement-level code summarization, focusing on dataset construction, comment generation, and automated evaluation. We created a high-quality dataset by incorporating functions as context and using rule-based filtering and relevant tools. During dataset construction, we verified the consistency of code-comment pairs using LLMs, resulting in the exclusion of 60% of low-quality data. In the comparative experiments, using functions as context significantly enhanced performance across all metrics, with the BLEU score increasing by 25.04%. Next, we tested mainstream prompt methods, and the few-shot method outperformed others, excelling in both automated metric evaluation and human assessment. Finally, we tested LLMs in automated evaluation, finding a strong positive correlation and consistency with human evaluation, highlighting their potential as a new method for automated assessment.
Keywords:
Large language models
Code summarization
Statement-level code summarization

Journal

Applied Intelligence cover
Applied Intelligence
IF:
3.5
Papers:
7.5K
Citations:
1.7W

Organization

C
City University of Macau
Scholars:
513
Papers: 355
Citations: 2.5K
Y
yangzhou university
Scholars:
8.8K
Papers: 2.7K
Citations: 2