跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 机器学习

arXiv:2004.02942 (cs)
[提交于 2020年4月8日]

标题:Embedding Java Classes with code2vec: Improvements from Variable Obfuscation

作者:Rhys Compton, Eibe Frank, Panos Patros, Abigail Koay
查看论文《Embedding Java Classes with code2vec: Improvements from Variable Obfuscation》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Automatic source code analysis in key areas of software engineering, such as code security, can benefit from Machine Learning (ML). However, many standard ML approaches require a numeric representation of data and cannot be applied directly to source code. Thus, to enable ML, we need to embed source code into numeric feature vectors while maintaining the semantics of the code as much as possible. code2vec is a recently released embedding approach that uses the proxy task of method name prediction to map Java methods to feature vectors. However, experimentation with code2vec shows that it learns to rely on variable names for prediction, causing it to be easily fooled by typos or adversarial attacks. Moreover, it is only able to embed individual Java methods and cannot embed an entire collection of methods such as those present in a typical Java class, making it difficult to perform predictions at the class level (e.g., for the identification of malicious Java classes). Both shortcomings are addressed in the research presented in this paper. We investigate the effect of obfuscating variable names during the training of a code2vec model to force it to rely on the structure of the code rather than specific names and consider a simple approach to creating class-level embeddings by aggregating sets of method embeddings. Our results, obtained on a challenging new collection of source-code classification problems, indicate that obfuscating variable names produces an embedding model that is both impervious to variable naming and more accurately reflects code semantics. The datasets, models, and code are shared for further ML research on source code.
评论: In 17th International Conference on Mining Software Repositories (MSR) 2020, Seoul, Republic of Korea. 11 pages
主题: 机器学习 (cs.LG); 程序设计语言 (cs.PL); 软件工程 (cs.SE); 机器学习 (stat.ML)
引用方式: arXiv:2004.02942 [cs.LG]
  (或者 arXiv:2004.02942v1 [cs.LG] 对于此版本)
  https://doi.org/10.48550/arXiv.2004.02942
相关 DOI: https://doi.org/10.1145/3379597.3387445

提交历史

来自:Rhys Compton
[v1] 2020年4月8日 星期三 00:00:00 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.LG
< 上一篇   |   下一篇 >
最新 | 近期 | 2020-04
切换浏览方式为:
cs
cs.PL
cs.SE
stat.ML

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站