Hierarchical Embedding Fusion for Retrieval-Augmented Code Generation
- URL: http://arxiv.org/abs/2603.06593v1
- Date: Wed, 04 Feb 2026 14:56:11 GMT
- Title: Hierarchical Embedding Fusion for Retrieval-Augmented Code Generation
- Abstract summary: We present Hierarchical Embedding Fusion (HEF), a two-stage approach to repository representation for code completion.<n>HEF achieves exact-match accuracy comparable to snippet-based retrieval baselines.<n>Compared to graph-based and iterative retrieval systems, HEF reduces median end-to-end latency by 13 to 26 times.
- Score: 6.4453302264198165
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Retrieval-augmented code generation often conditions the decoder on large retrieved code snippets. This ties online inference cost to repository size and introduces noise from long contexts. We present Hierarchical Embedding Fusion (HEF), a two-stage approach to repository representation for code completion. First, an offline cache compresses repository chunks into a reusable hierarchy of dense vectors using a small fuser model. Second, an online interface maps a small number of retrieved vectors into learned pseudo-tokens that are consumed by the code generator. This replaces thousands of retrieved tokens with a fixed pseudo-token budget while preserving access to repository-level information. On RepoBench and RepoEval, HEF with a 1.8B-parameter pipeline achieves exact-match accuracy comparable to snippet-based retrieval baselines, while operating at sub-second median latency on a single A100 GPU. Compared to graph-based and iterative retrieval systems in our experimental setup, HEF reduces median end-to-end latency by 13 to 26 times. We also introduce a utility-weighted likelihood signal for filtering training contexts and report ablation studies on pseudo-token budget, embedding models, and robustness to harmful retrieval. Overall, these results indicate that hierarchical dense caching is an effective mechanism for low-latency, repository-aware code completion.
Related papers
- Matryoshka Hash Representations for Model-Aware Compact Semantic Retrieval [0.4859781642217615]
We introduce Matryoshka Hash Representations (MHR), a two-stage procedure that separates full-width training from prefix organization.<n>MHR reaches.5561 NDCG@10 and.6535 Recall@100 at 32 bytes, surpassing the best baseline of the same budget.<n>The code also strengthens two common pipelines: shortlisting candidates for full-precision reranking, and pruning a low-storage graph index.
arXiv Detail & Related papers (2026-09-07T09:38:28Z) - REIGN: Refurbished Embeddings with Integrated Guidance Networks for Efficient Context-Length Scaling [0.0]
REIGN is a bi-encoder that operates on sequences of contextualised chunk embeddings from a frozen Guidance Network (GN) rather than on raw tokens.<n>We release a synthetic long-document retrieval benchmark for contrastive training and evaluation at long context lengths.<n>A paired significance test puts it on par with models 1.6-4.3x larger on the patent task, and it stays within 0.65 nDCG@10 of a 20x-larger model on LoCo.
arXiv Detail & Related papers (2026-08-30T16:50:38Z) - No More K-means: Single-Stage Sparse Coding for Efficient Multi-Vector Retrieval [51.43543998583709]
Single-stage Sparse Retrieval (SSR) is a paradigm shift that replaces expensive clustering with efficient sparse coding.<n>It reduces indexing time by 15x compared to ColBERTv2, halves retrieval latency, and simultaneously improves retrieval performance.
arXiv Detail & Related papers (2026-05-28T15:53:34Z) - Towards Practical Lossless Neural Compression for LiDAR Point Clouds [84.36825469211375]
extreme sparsity of high-precision geometric details hinders efficient context modeling.<n>Our framework comprises two lightweight modules.<n>Experiments demonstrate competitive compression performance at real-time speed.
arXiv Detail & Related papers (2026-03-26T10:02:07Z) - Multi-Vector Index Compression in Any Modality [73.7330345057813]
Late interaction has emerged as a dominant paradigm for information retrieval in text, images, visual documents, and videos.<n>We introduce four approaches for index compression: sequence resizing, memory tokens, hierarchical pooling, and a novel attention-guided clustering (AGC)<n>AGC uses an attention-guided mechanism to identify the most semantically salient regions of a document as cluster centroids and to weight token aggregation.
arXiv Detail & Related papers (2026-02-24T18:57:33Z) - Multivector Reranking in the Era of Strong First-Stage Retrievers [11.098422338598454]
We reproduce several state-of-the-art multivector retrieval methods on two publicly available datasets.<n>We show that replacing the token-level gather phase with a single-vector document retriever produces a smaller and more semantically coherent candidate set.<n>Our two-stage approach achieves over $24times$ speedup over the state-of-the-art multivector retrieval systems, while maintaining comparable or superior retrieval quality.
arXiv Detail & Related papers (2026-01-08T18:22:18Z) - On Pretraining for Project-Level Code Completion [0.061386715480643554]
Repository-level pretraining is commonly used to enable large language models for code to leverage-wide context.<n>In this work, we investigate how different repository-processing strategies affect in-context learning in OpenCoder.
arXiv Detail & Related papers (2025-10-15T15:55:19Z) - Paper2Code: Automating Code Generation from Scientific Papers in Machine Learning [70.04746094652653]
We introduce PaperCoder, a framework that transforms machine learning papers into functional code repositories.<n>PaperCoder operates in three stages: planning, designs the system architecture with diagrams, identifies file dependencies, and generates configuration files.<n>We then evaluate PaperCoder on generating code implementations from machine learning papers based on both model-based and human evaluations.
arXiv Detail & Related papers (2025-04-24T01:57:01Z) - RepoCoder: Repository-Level Code Completion Through Iterative Retrieval
and Generation [96.75695811963242]
RepoCoder is a framework to streamline the repository-level code completion process.
It incorporates a similarity-based retriever and a pre-trained code language model.
It consistently outperforms the vanilla retrieval-augmented code completion approach.
arXiv Detail & Related papers (2023-03-22T13:54:46Z) - Parallel Actors and Learners: A Framework for Generating Scalable RL
Implementations [14.432131909590824]
Reinforcement Learning (RL) has achieved significant success in application domains such as robotics, games, health care and others.
Current implementations exhibit poor performance due to challenges such as irregular memory accesses and synchronization overheads.
We propose a framework for generating scalable reinforcement learning implementations on multicore systems.
arXiv Detail & Related papers (2021-10-03T21:00:53Z) - Progressively Pretrained Dense Corpus Index for Open-Domain Question
Answering [87.32442219333046]
We propose a simple and resource-efficient method to pretrain the paragraph encoder.
Our method outperforms an existing dense retrieval method that uses 7 times more computational resources for pretraining.
arXiv Detail & Related papers (2020-04-30T18:09:50Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.