In programming, learning code representations has a variety of applications, including code classification, code search, comment generation, bug prediction, and so on. Various representations of code in terms of tokens, syntax trees, dependency graphs, code navigation paths, or a combination of their variants have been proposed, however, existing vanilla learning techniques have a major limitation in robustness, i.e., it is easy for the models to make incorrect predictions when the inputs are altered in a subtle way. To enhance the robustness, existing approaches focus on recognizing adversarial samples rather than on the valid samples that fall outside a given distribution, which we refer to as out-of-distribution (OOD) samples. Recognizing such OOD samples is the novel problem investigated in this paper. To this end, we propose to first augment the in=distribution datasets with out-of-distribution samples such that, when trained together, they will enhance the model's robustness. We propose the use of an energy-bounded learning objective function to assign a higher score to in-distribution samples and a lower score to out-of-distribution samples in order to incorporate such out-of-distribution samples into the training process of source code models. In terms of OOD detection and adversarial samples detection, our evaluation results demonstrate a greater robustness for existing source code models to become more accurate at recognizing OOD data while being more resistant to adversarial attacks at the same time. Furthermore, the proposed energy-bounded score outperforms all existing OOD detection scores by a large margin, including the softmax confidence score, the Mahalanobis score, and ODIN.


翻译:在编程中,学习代码表达方式有多种应用,包括代码分类、代码搜索、评论生成、错误预测等。在标识、语法树、依赖图、代码导航路径或变量组合方面,提出了各种代码的表达方式,但是,在编程中,现有的香草学习技术在稳健性方面有重大限制,即当投入以微妙方式改变时,模型很容易作出不正确的预测。为了加强强健性,现有方法侧重于识别在特定分发范围之外的有效样本,我们称之为分配范围以外的样本。认识到此类OOOD样本是本文所调查的新问题。为此,我们提议首先增加分配数据集的可靠性,在对调时,当输入输入内容以微妙的方式改变输入内容时,这些模型将增强模型的稳健性。我们提议使用一个节能学习目标功能,为分配样本分配更高的分数,而低于分配范围的有效样本,我们称之为超出分配范围(OOOD)的样本。认识到此类OO样本是本文所调查的新问题。为了将更稳健的检测结果纳入现有测试和测试标准,同时将现有测试的浓度值排序,将更多的OO值纳入现有测试标准用于源评估。

0
下载
关闭预览

相关内容

【干货书】真实机器学习,264页pdf,Real-World Machine Learning
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
161+阅读 · 2020年3月18日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
Adversarial Variational Bayes: Unifying VAE and GAN 代码
CreateAMind
7+阅读 · 2017年10月4日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Generalized Out-of-Distribution Detection: A Survey
Arxiv
15+阅读 · 2021年10月21日
Adversarial Mutual Information for Text Generation
Arxiv
13+阅读 · 2020年6月30日
Deep Learning for Energy Markets
Arxiv
8+阅读 · 2019年4月10日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
Adversarial Variational Bayes: Unifying VAE and GAN 代码
CreateAMind
7+阅读 · 2017年10月4日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员