Backend
CodeHID: Learning an Addressable Hierarchical Code Index for Generative Code Retrieval
arXiv cs.IR0 views
arXiv:2608.24089v2 Announce Type: replace Abstract: Code retrieval models have predominantly relied on a flat matching paradigm that treats code snippets as independent candidates, making them less capable of distinguishing similar code candidates. Generative retrieval offers a solution by constructing a learnable index over the code corpus, guiding the retriever to better understand how code candidates are semantically organized and addressed. However, naively applying generative retrieval in the code retrieval task may result in operating over an identifier space whose prefixes do not correspond to meaningful code-semantic regions. In this paper, we propose CodeHID, a generative code retrieval framework that reformulates the code retrieval task from flat candidate matching to coarse-to-fine semantic address generation. CodeHID relies on two core components. First, Pseudo-Neighbor Guided DocID Learning constructs a globally static hierarchical index by applying multi-level residual quantization and $k$-nearest-neighbor pseudo-supervision, ensuring that semantically related code snippets share prefixes while preserving target-level separability. Second, Dual-Phase DocID Generation Guidance reliably navigates this fixed index by combining training-side ranking enhancements, using hard negatives and rank distillation, with inference-side candidate constraints and prefix-aware decoding. Extensive experiments on CoSQA and ProCQA benchmarks demonstrate that CodeHID outperforms existing sparse retrieval, pre-trained code models, dense code retrieval, and generative retrieval baselines by a large margin in most cases, achieving particularly strong improvements in rank-one retrieval metrics.
Source:https://arxiv.org/abs/2608.24089PreviousRecHarness: A Bandit-Routed Agentic Harness for Self-Evolving Recommender SystemsNextRetrieving Complementary Evidence for Multi-Hop RAG with Semantic Gain Graphs
Related posts
Autoscaling Adds Waiters, Not Ovens. Here's What Actually Breaks at 10x Load
0dev.to
[백엔드 모의면접] 중복 결제는 어떻게 막을까?
0dev.to
Server-Side Pagination Looked Easy. It Took Me Longer Than Any React Concept Yet.
0dev.to
Before You Create an AWS Account, Spend 45 Minutes Learning These Security Tools
0dev.to
Claude “Invalid Signature” in a Thinking Block: How to Debug It Safely
0dev.to
How to catch an expiring or broken SSL certificate before your visitors do
0dev.to