一句话:提出用辅助OOD数据与能量有界学习提升代码模型鲁棒性,兼顾OOD检测与对抗防御。
现有提升源代码模型鲁棒性的方法主要关注识别对抗样本,而忽视了分布外(OOD)样本,即偏离给定训练分布的有效样本。本文提出引入辅助OOD数据集,并与主数据集联合训练,以增强模型鲁棒性。具体而言,作者采用能量有界学习目标函数,使分布内样本获得更高得分、分布外样本获得更低得分,从而将OOD样本纳入源代码模型的训练过程。在OOD检测和对抗样本检测任务上的评估结果表明,现有源代码模型的鲁棒性得到提升:既能更准确地识别OOD数据,又能同时增强对对抗攻击的抵抗能力。
Existing approaches to improving the robustness of source code models concentrate on recognizing adversarial samples rather than valid samples that fall outside of a given distribution, which we refer to as out-of-distribution (OOD) samples. To this end, we propose to use an auxiliary dataset (out-of-distribution) such that, when trained together with the main dataset, they will enhance the model’s robustness. We adapt 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.
DOI 原文 ·
@inproceedings{paperbot7231,
title = {Towards Robust Models of Code via Energy-Based Learning on Auxiliary Datasets},
author = {Nghi D. Q. Bui and Yijun Yu},
booktitle = {ASE},
year = {2022},
doi = {10.1145/3551349.3561171}
}