arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.22338cs.SE
收藏

利用设计感知上下文在大语言模型中生成代码注释

Leveraging Design-Aware Context in Large Language Models for Code Comment Generation

Indian Institute of Technology Kharagpur(印度理工学院卡拉格普尔分校);University of Leeds(利兹大学);Ashoka University(阿肖卡大学);University of Sheffield(谢菲尔德大学);TPXimpact

Aritra Mitra, Srijoni Majumdar, Anamitra Mukhopadhyay, Partha Pratim Das, Paul D Clough, Partha Pratim Chakrabarti

AI总结:

本研究探讨利用设计文档作为上下文,通过大语言模型生成更实用的代码注释,以提高代码维护效率。

摘要:

注释对代码开发流程非常有用。随着代码的日益普及,初级程序员已经创建了大量代码库。由于缺乏注释标准,他们的注释往往无用,并增加了进一步维护代码的时间。本研究旨在寻找大型语言模型(LLMs)在这些情况下生成潜在更好注释的用处。本研究重点在于设计文档作为LLMs生成更有用注释的上下文的可行性,因为设计文档常被维护者用来在注释不足时理解代码。

英文摘要:

Comments are very useful to the flow of code development. With the increasing commonality of code, novice coders have been creating a significant amount of codebases. Due to lack of commenting standards, their comments are often useless, and increase the time taken to further maintain codes. This study intends to find the usefulness of large language models (LLMs) in these cases to generate potentially better comments. This study focuses on the feasibility of design documents as a context for the LLMs to generate more useful comments, as design documents are often used by maintainers to understand code when comments do not suffice.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑