Adversarial Training for Code Retrieval with Question-Description Relevance Regularization

Jie Zhao, Huan Sun
10/19/2020
cs.CLcs.AIcs.IR

Official code: jiez-osu/QQC (1 star, Python, last commit 2020-11-20).

Abstract

Code retrieval is a key task aiming to match natural and programming languages. In this work, we propose adversarial learning for code retrieval, that is regularized by question-description relevance.

Show full abstract

First, we adapt a simple adversarial learning technique to generate difficult code snippets given the input question, which can help the learning of code retrieval that faces bi-modal and data-scarce challenges. Second, we propose to leverage question-description relevance to regularize adversarial learning, such that a generated code snippet should contribute more to the code retrieval training loss, only if its paired natural language description is predicted to be less relevant to the user given question. Experiments on large-scale code retrieval datasets of two programming languages show that our adversarial learning method is able to improve the performance of state-of-the-art models. Moreover, using an additional duplicate question prediction model to regularize adversarial learning further improves the performance, and this is more effective than using the duplicated questions in strong multi-task learning baselines

View on arXivView PDF

Code Implementations(1)

jiez-osu/QQCOfficial100%

Adversarial Training for Code Retrievalwith Question-Description Relevance Regularization

11PythonOct 5, 20206 years ago

Similar Papers

Cite this paper

@article{zhao2020adversarial,
  title  = {Adversarial Training for Code Retrieval with Question-Description Relevance Regularization},
  author = {Jie Zhao and Huan Sun},
  year   = {2020},
  eprint = {2010.09803},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2010.09803}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2010.09803.svg)](https://codeofpaper.com/paper/2010.09803)

Discussion