[论文解读] A Literature Study of Embeddings on Source Code
本综述收集并对源代码中词嵌入在多种粒度层面的应用进行分类,并讨论公开可用的数据与可视化方法。
Natural language processing has improved tremendously after the success of word embedding techniques such as word2vec. Recently, the same idea has been applied on source code with encouraging results. In this survey, we aim to collect and discuss the usage of word embedding techniques on programs and source code. The articles in this survey have been collected by asking authors of related work and with an extensive search on Google Scholar. Each article is categorized into five categories: 1. embedding of tokens 2. embedding of functions or methods 3. embedding of sequences or sets of method calls 4. embedding of binary code 5. other embeddings. We also provide links to experimental data and show some remarkable visualization of code embeddings. In summary, word embedding has been successfully applied on different granularities of source code. With access to countless open-source repositories, we see a great potential of applying other data-driven natural language processing techniques on source code in the future.
研究动机与目标
- 对源代码在多种粒度层面上使用词嵌入进行调查(令牌、函数、API 序列、二进制等)。
- 将现有工作分成五个嵌入类别并总结可用的实验数据。
- 突出可视化方法和公开数据资源,以促进复制和进一步研究。
提出的方法
- 通过联系相关作者并进行广泛的 Google Scholar 搜索来评审文章。
- 将每个工作分为五个嵌入类别:令牌、函数/方法、序列/API 使用、二进制代码,以及其他嵌入。
- 提供公开可用的实验数据和代码嵌入的可视化表示的链接。
- 总结代码嵌入的潜力与局限性,并讨论可视化方法。
实验结果
研究问题
- RQ1代码嵌入应用的主流粒度是什么(令牌、函数、API 序列、二进制等)?
- RQ2嵌入技术如何被用于支持下游代码任务(如修复、克隆检测、漏洞预测等)?
- RQ3存在哪些公开数据和可视化工具以支持复制与进一步研究代码嵌入?
- RQ4对源代码中的上下文或下游任务评估嵌入有哪些未来方向建议?
主要发现
- 嵌入技术应用于代码的多种粒度,包括令牌、函数/方法、API 序列和二进制代码。
- 很多工作使用 word2vec 或类似方法来学习令牌、函数和 API 的嵌入,以用于下游任务,如修复、克隆检测和漏洞预测。
- 若干研究采用结构化表示(如 AST、控制流图、符号轨迹)和神经网络来学习代码语义的嵌入。
- 可视化方法(PCA、t-SNE)用于展示高维代码嵌入。
- 有大量公开数据集与人工制品链接到代码嵌入研究,以便复制和复用。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。