kirancodes.me
To Proof Maintenance & Beyond!

Towards Robust Models of Code via Energy-Based Learning on Auxiliary Datasets

Nghi D. Q. Bui, Yijun Yu

Abstract

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.

BibTeX
@inproceedings{Bui-Yu:ASE22,
  author    = {Nghi D. Q. Bui and
               Yijun Yu},
  title     = {Towards Robust Models of Code via {Energy-Based} Learning on Auxiliary Datasets},
  booktitle = {ASE},
  pages     = {147:1--147:3},
  publisher = {{ACM}},
  year      = {2022},
}

Related papers