Adversarial Training for Code Retrieval with Question-Description Relevance Regularization
Jie Zhao, Huan Sun

TL;DR
This paper introduces an adversarial learning approach for code retrieval that uses question-description relevance to generate challenging code snippets and improve retrieval accuracy, especially in data-scarce scenarios.
Contribution
The work adapts adversarial learning with relevance regularization for code retrieval, enhancing model robustness and performance over state-of-the-art methods.
Findings
Improved code retrieval accuracy on large-scale datasets.
Relevance regularization outperforms multi-task learning with duplicate questions.
Adversarial training effectively generates challenging code snippets.
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. 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.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Multimodal Machine Learning Applications · Natural Language Processing Techniques
