paperbot · PL 论文追踪

全部论文 待读 收藏

P2 On the importance of building high-quality training datasets for neural code search

论构建高质量训练数据集对神经代码搜索的重要性
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 3/10 · 该论文聚焦神经代码搜索的训练数据清洗,属于机器学习与程序语言的交叉,但未涉及用户核心关注的静态分析、Agentic程序、浮点程序分析或贝叶斯程序分析等方向,匹配度较低。引用 97 inbox
Zhensu Sun, Li Li, Yan Liu, Xiaoning Du, Li Li
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出首个面向代码搜索数据集的语义查询清洗框架,用规则与模型双重过滤数据,显著提升神经代码搜索性能。

神经代码搜索模型的性能严重依赖训练数据质量,但高质量“自然语言查询-代码”对稀缺,常用数据集多以代码注释等替代真实查询。作者对知名代码搜索数据集的实证分析发现,超过三分之一的查询含噪声,与真实用户查询语义偏离,导致模型在实际场景中性能下降。为此,论文提出一个数据清洗框架,包含基于规则的句法过滤器和基于模型的语义过滤器,据称是首个将语义查询清洗应用于代码搜索数据集的工作。实验在两种常用代码搜索模型和三个人工标注检索基准上评估;用过滤后数据训练 DeepCS 模型,在三个验证基准上平均提升 19.2% MRR 和 21.3% Answer@1。

问题
高质量查询-代码对稀缺,现有代码搜索数据集常以代码注释替代查询,导致大量噪声查询,使模型在真实场景中性能下降。
方法
提出由规则式句法过滤和基于模型的语义过滤组成的两阶段数据清洗框架,用于识别并清理代码搜索数据集中的噪声查询,使查询与真实用户查询语义一致。
评估
在两个常用代码搜索模型和三个人工标注检索基准上评估;使用过滤后数据训练 DeepCS 在三个基准上平均提升 19.2% MRR 和 21.3% Answer@1。
原文摘要(Abstract)

The performance of neural code search is significantly influenced by the quality of the training data from which the neural models are derived. A large corpus of high-quality query and code pairs is demanded to establish a precise mapping from the natural language to the programming language. Due to the limited availability, most widely-used code search datasets are established with compromise, such as using code comments as a replacement of queries. Our empirical study on a famous code search dataset reveals that over one-third of its queries contain noises that make them deviate from natural user queries. Models trained through noisy data are faced with severe performance degradation when applied in real-world scenarios. To improve the dataset quality and make the queries of its samples semantically identical to real user queries is critical for the practical usability of neural code search. In this paper, we propose a data cleaning framework consisting of two subsequent filters: a rule-based syntactic filter and a model-based semantic filter. This is the first framework that applies semantic query cleaning to code search datasets. Experimentally, we evaluated the effectiveness of our framework on two widely-used code search models and three manually-annotated code retrieval benchmarks. Training the popular DeepCS model with the filtered dataset from our framework improves its performance by 19.2% MRR and 21.3% Answer@l, on average with the three validation benchmarks.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2202-06649,
  title = {On the importance of building high-quality training datasets for neural code search},
  author = {Zhensu Sun and Li Li and Yan Liu and Xiaoning Du and Li Li},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510160}
}