HACS: An Enhancement Framework for Deep Code Search Benefiting from Hard Negative Samples (S)
At a glance
- Citations
- 0
- References
- 0
- Comments
- 0
Abstract
Code search aims to retrieve relevant code snippets from large code repositories based on query, promoting code reuse and enhancing software development efficiency.Deep Learning is a powerful approach for code search, in which the hard negative samples within training batches critically impact model performance.However, most existing deep code search models only randomly sample negative samples, resulting in a paucity or complete lack of hard negative samples.To address this limitation, we introduce a novel enhancement framework named HACS to optimize the composition of negative samples within batches, thus enhancing the training effectiveness of deep code search models.The core idea is to increase the count of hard negative samples within the negative samples corresponding to each query in the training batch.Specifically, HACS utilizes deep reinforcement learning techniques for sampling hard negative samples and implements vector-level mixed data augmentation strategy to generate hard negative samples.We evaluated our framework on a public dataset covering six programming languages.Experimental results reveal that HACS significantly improves the code search performance of existing models.
Publication details
- DOI
- 10.18293/seke2024-104
- OpenAlex
- W4406255327
- Document type
- conference-paper
- Language
- EN
- Source
- Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
- Last metadata update
Comments
Log in to join the discussion.