Automating code documentation through explanatory text can prove highly beneficial in code understanding. Large Language Models (LLMs) have made remarkable strides in Natural Language Processing, especially within software engineering tasks such as code generation and code summarization. This study specifically delves into the task of generating natural-language summaries for code snippets, using various LLMs. The findings indicate that Code LLMs outperform their generic counterparts, and zero-shot methods yield superior results when dealing with datasets with dissimilar distributions between training and testing sets.
翻译:通过解释性文本自动化生成代码文档,在代码理解方面具有重要价值。大语言模型在自然语言处理领域取得了显著进展,特别是在代码生成与代码摘要等软件工程任务中。本研究聚焦于利用不同大语言模型为代码片段生成自然语言摘要。研究结果表明,代码专用大语言模型在性能上优于通用大语言模型;此外,当训练集与测试集存在分布差异时,零样本方法能够取得更优效果。