paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Code to comment "translation"

代码到注释的“翻译”
ASE Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering2020匹配度 2/10 · 该论文研究代码注释生成(code-to-comment)任务及BLEU评估校准,属于机器学习与程序语言的交叉,但不涉及静态分析、Agentic程序、浮点程序分析或贝叶斯程序分析,也未使用LLM/Agent改进程序分析。其数据集与评测批判虽有方法学参考价值,但与用户核心研究方向匹配度低。引用 44 inbox
David Gros, Hariharan Sezhiyan, Prem Devanbu, Zhou Yu
crossref: 2026-09-12

AI 速览

一句话:重新审视代码注释生成等同于自然语言翻译的假设,比较数据集并校准BLEU,指出性能可能被高估且IR是合理基线。

代码注释生成长期受到关注,近期工作常将其视为“代码到自然语言的翻译”,直接借用神经翻译模型和BLEU等指标。本文系统检验这一类比:对比CodeNN、DeepCom、FunCom、DocString等代码-注释数据集与WMT19自然语言翻译数据集,揭示二者在数据分布和任务性质上的差异;并利用同一项目、同一类内的方法“亲和对”校准BLEU,评估注释质量指标的可靠性。研究发现,现有部分数据集上的性能可能被显著高估,而朴素信息检索方法已能构成合理基线。最后,作者对未来研究提出了建议。

问题
研究问题:代码注释生成是否与自然语言翻译足够相似,从而可沿用翻译模型与BLEU评估指标。
方法
方法:比较多个代码-注释数据集与WMT19,并用方法亲和对校准BLEU,同时测试朴素信息检索基线。
评估
评估方式:通过数据集对比、BLEU校准实验和IR基线实验,分析现有模型性能与指标可靠性。
原文摘要(Abstract)

The relationship of comments to code, and in particular, the task of generating useful comments given the code, has long been of interest. The earliest approaches have been based on strong syntactic theories of comment-structures, and relied on textual templates. More recently, researchers have applied deep-learning methods to this task---specifically, trainable generative translation models which are known to work very well for Natural Language translation (e.g., from German to English). We carefully examine the underlying assumption here: that the task of generating comments sufficiently resembles the task of translating between natural languages, and so similar models and evaluation metrics could be used. We analyze several recent code-comment datasets for this task: CodeNN, DeepCom, FunCom, and DocString. We compare them with WMT19, a standard dataset frequently used to train state-of-the-art natural language translators. We found some interesting differences between the code-comment data and the WMT19 natural language data. Next, we describe and conduct some studies to calibrate BLEU (which is commonly used as a measure of comment quality). using "affinity pairs" of methods, from different projects, in the same project, in the same class, etc; Our study suggests that the current performance on some datasets might need to be improved substantially. We also argue that fairly naive information retrieval (IR) methods do well enough at this task to be considered a reasonable baseline. Finally, we make some suggestions on how our findings might be used in future research in this area.

链接与引用

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

BibTeX
@inproceedings{paperbot6003,
  title = {Code to comment "translation"},
  author = {David Gros and Hariharan Sezhiyan and Prem Devanbu and Zhou Yu},
  booktitle = {ASE},
  year = {2020},
  doi = {10.1145/3324884.3416546}
}