paperbot · PL 论文追踪

全部论文 待读 收藏

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

利用设计感知上下文的大语言模型代码注释生成
ICSE Proceedings of the IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文研究用 LLM 结合设计文档上下文生成代码注释,属于 LLM 辅助软件工程中的代码注释任务,与用户核心方向(面向 ML/Agentic 程序的静态分析、LLM 改进静态分析与形式化验证、浮点程序分析、贝叶斯程序分析)均无直接关联,仅共享“LLM 作为工具处理代码”的宽泛背景。文中也未涉及理论形式化、工业落地或失效分析。引用 0 inbox
Aritra Mitra, Srijoni Majumdar, Anamitra Mukhopadhyay, Partha Pratim Das, Paul D Clough, Partha Pratim Chakrabarti
crossref: 2026-09-12

AI 速览

一句话:将设计文档作为上下文输入 LLM 生成代码注释,实验表明设计感知上下文可提升注释的有用性。

代码注释对开发与维护流程十分有用。随着工具可及性与能力的提升,新手程序员创建了大量代码库,但由于缺乏标准化,他们的注释往往效果不佳,反而延长了后续维护所需的时间。本文探讨利用大语言模型生成更有效注释的可行性,重点研究能否将设计文档作为上下文提供给 LLM,从而生成更有用的注释。作者通过实验比较在有/无此类上下文时生成注释的有用性,结果显示,采用设计感知的上下文信息后,注释的有用性有所提升。

问题
新手开发者编写的注释缺乏规范、质量参差,导致后续代码维护成本增加;如何借助自动化手段生成更有用的代码注释。
方法
以设计文档作为额外上下文输入大语言模型,引导模型在了解设计意图的前提下生成代码注释。
评估
通过实验对比有无设计感知上下文时生成注释的有用性(usefulness),结果表明引入该上下文可提升注释的有用性。
原文摘要(Abstract)

Comments are very useful in the code development workflow. With increased access to and capability of tools, novice coders have been creating a significant amount of codebases. However, due to lack of standardization, their comments are often ineffective and can increase the time taken for subsequent maintenance. This study investigates the utility of using Large Language Models (LLMs) to generate more effective comments. The study focuses on the feasibility of utilizing design documents as a context for LLMs to generate more useful comments. Our results show that the usefulness of comments increases when using such contextual information.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11990,
  title = {Leveraging Design-Aware Context in Large Language Models for Code Comment Generation},
  author = {Aritra Mitra and Srijoni Majumdar and Anamitra Mukhopadhyay and Partha Pratim Das and Paul D Clough and Partha Pratim Chakrabarti},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3786582.3786825}
}