paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing

SECRET:通过分段深度哈希实现可扩展且高效的代码检索
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 该论文研究的是基于深层哈希的代码检索效率优化(用分段短哈希码替代长哈希码以降低召回复杂度),属于代码检索/信息检索与表示学习方向,与用户关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析均无交集;也完全不涉及 LLM/Agent 的交互或利用 LLM 改进分析工具。仅在'工程落地与大规模效率'这一点上略有共鸣,但核心问题不匹配。引用 0 inbox
Wenchao Gu, Ensheng Shi, Yanlin Wang, Lun Du, Shi Han, Hongyu Zhang, Dongmei Zhang, Michael R. Lyu
crossref: 2026-09-12

AI 速览

一句话:提出 SECRET,将长深度哈希码迭代训练为多段短码,用哈希表查表召回,大幅提升大规模代码检索效率。

代码检索根据自然语言描述返回代码片段,在软件开发中应用广泛。深度学习模型虽能提升检索效果,但大规模代码库管理仍面临挑战;已有深度哈希方法虽可用汉明距离快速召回,却需线性扫描整个代码库,扩展性受限。为此,论文提出 SECRET,通过迭代训练策略将现有深度哈希方法生成的长哈希码转换为若干短哈希码段;训练后,SECRET 对每个码段分别查哈希表以召回候选代码,从而显著降低召回时间复杂度。大量实验表明,SECRET 在检索性能与已有深度哈希方法相当甚至更高的情况下,至少减少 95% 的检索时间;在相同哈希表数量下,也优于经典 LSH 方法。

问题
大规模代码检索中,现有深度哈希方法虽用汉明距离快速召回,但仍需线性扫描整个代码库,可扩展性不足。
方法
SECRET 采用迭代训练策略,将长哈希码转换为多个短哈希码段,并在召回阶段对每个码段查找哈希表。
评估
大量实验表明,SECRET 相比现有深度哈希方法可至少减少 95% 的检索时间,性能相当或更优;在相同哈希表数量下也优于 LSH。
原文摘要(Abstract)

Code retrieval, which retrieves code snippets based on users' natural language descriptions, is widely used by devel-opers and plays a pivotal role in real-world software development. The advent of deep learning has shifted the retrieval paradigm from lexical-based matching towards leveraging deep learning models to encode source code and queries into vector represen-tations, facilitating code retrieval according to vector similarity. Despite the effectiveness of these models, managing large-scale code database presents significant challenges. Previous research proposes deep hashing-based methods, which generate hash codes for queries and code snippets and use Hamming distance for rapid recall of code candidates. However, this approach's reliance on linear scanning of the entire code base limits its scalability. To further improve the efficiency of large-scale code retrieval, we propose a novel approach SECRET (Scalable and Efficient Code Retrieval via SegmEnTed deep hashing). SECRET converts long hash codes calculated by existing deep hashing approaches into several short hash code segments through an iterative training strategy. After training, SECRET recalls code candidates by looking up the hash tables for each segment, the time complexity of recall can thus be greatly reduced. Extensive experimental results demonstrate that SECRET can drastically reduce the retrieval time by at least 95 % while achieving comparable or even higher performance of existing deep hashing approaches. Besides, SECRET also exhibits superior performance and efficiency compared to the classical hash table-based approach known as LSH under the same number of hash tables.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8727,
  title = {SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing},
  author = {Wenchao Gu and Ensheng Shi and Yanlin Wang and Lun Du and Shi Han and Hongyu Zhang and Dongmei Zhang and Michael R. Lyu},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00154}
}