paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Assessing the Generalizability of Code2vec Token Embeddings

评估 Code2vec Token 嵌入的泛化性
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 该论文研究 code2vec 代码 token 嵌入在注释生成、作者识别和克隆检测等任务上的泛化性,属于代码表示学习/经验评估,与用户关注的静态分析、Agentic 程序、LLM 辅助形式化验证、浮点程序分析及贝叶斯程序分析等核心方向没有直接关联。仅在“机器学习与程序语言”的广义范畴内有一定相邻性,但方法基于早期 code2vec,未涉及 LLM/Agent 或静态分析。引用 78 inbox
Hong Jin Kang, Tegawende F. Bissyande, David Lo
crossref: 2026-09-12

AI 速览

一句话:实证评估 code2vec token 嵌入在代码注释生成、作者识别与克隆检测上的泛化性,发现其无法直接迁移。

自然语言处理中的词嵌入模型通常能泛化到不同下游任务,但源代码 token 嵌入是否具有类似泛化性仍缺乏证据。本文是一篇经验论文,选取代码注释生成、代码作者识别和代码克隆检测三个潜在下游任务,对近期提出的 code2vec token 嵌入进行实证评估。code2vec 原本训练于方法名预测任务,其学习到的向量能否用于其他任务尚未被探索。实验结果表明,源代码 token 嵌入无法被直接用于这些下游任务,甚至相较更简单的方法也未带来改进。作者因此呼吁对源代码嵌入的有效与通用使用开展更多研究。

问题
源代码 token 嵌入模型是否像 NLP 词嵌入一样,能够泛化到其训练任务之外的下游任务,目前缺乏实证证据。
方法
选取代码注释生成、代码作者识别和代码克隆检测三个下游任务,对基于方法名预测训练得到的 code2vec token 嵌入进行迁移与实证评估。
评估
在三个下游任务上测试 code2vec token 嵌入的表现,发现其无法直接迁移使用,且相较更简单的方法没有带来性能提升。
原文摘要(Abstract)

Many Natural Language Processing (NLP) tasks, such as sentiment analysis or syntactic parsing, have benefited from the development of word embedding models. In particular, regardless of the training algorithms, the learned embeddings have often been shown to be generalizable to different NLP tasks. In contrast, despite recent momentum on word embeddings for source code, the literature lacks evidence of their generalizability beyond the example task they have been trained for. In this experience paper, we identify 3 potential downstream tasks, namely code comments generation, code authorship identification, and code clones detection, that source code token embedding models can be applied to. We empirically assess a recently proposed code token embedding model, namely code2vec's token embeddings. Code2vec was trained on the task of predicting method names, and while there is potential for using the vectors it learns on other tasks, it has not been explored in literature. Therefore, we fill this gap by focusing on its generalizability for the tasks we have identified. Eventually, we show that source code token embeddings cannot be readily leveraged for the downstream tasks. Our experiments even show that our attempts to use them do not result in any improvements over less sophisticated methods. We call for more research into effective and general use of code embeddings.

链接与引用

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

BibTeX
@inproceedings{paperbot5222,
  title = {Assessing the Generalizability of Code2vec Token Embeddings},
  author = {Hong Jin Kang and Tegawende F. Bissyande and David Lo},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00011}
}