Lune

SIGIR2026顶会

Hierarchical Embedding Fusion for Retrieval-Augmented Code Generation

Nikita Sorokin, Ivan Sedykh, Valentin Malykh

摘要

Retrieval-augmented code generation commonly conditions a decoder on large retrieved snippets, which couples online cost to repository size and introduces long-context noise. We present Hierarchical Embedding Fusion (HEF), a two-stage repository representation for code completion: (i) an offline cache that compresses repository chunks into a reusable hierarchy of dense vectors using a small fuser model, and (ii) an online interface that maps a small number of retrieved vectors into learned pseudo-tokens consumed by a code generator. This replaces thousands of retrieved tokens with a fixed pseudo-token budget while retaining access to repository-level information.

On RepoBench and RepoEval, HEF with a 1.8B pipeline attains comparable exact-match accuracy to snippet-based retrieval baselines while operating at sub-second median latency on a single A100. Compared to graph-and iterative-retrieval systems in our setup, HEF reduces median end-to-end latency by 13×-26×. We additionally introduce a utility-weighted likelihood signal to filter training contexts and report ablations over pseudo-token budget, embedding models, and robustness to harmful retrieval. These results support hierarchical dense caching as an effective mechanism for low-latency repository-aware code completion.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Big Bird: Transformers for Longer Sequences 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Retrieval Augmented Language Model Pre-Training
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper17

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
  2. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 3,159 次引用
  3. Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat 等ICML 2020 · 2,937 次引用
  4. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 次引用
  5. Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai 等ICML 2022 · 1,629 次引用

相关 Paper

  1. RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and GenerationFengji Zhang, Bei Chen, Yue Zhang, Jacky Keung 等EMNLP 2023 · 110 次引用
  2. Repoformer: Selective Retrieval for Repository-Level Code CompletionDi Wu, Wasi Uddin Ahmad, Dejiao Zhang, Murali Krishna Ramanathan 等ICML 2024 · 78 次引用
  3. AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code CompletionTianyue Jiang, Yanlin Wang, Yanli Wang, Daya Guo 等ASE 2025 · 2 次引用
  4. Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and BeyondMinh Le-Anh, Huyen Nguyen, Khanh An Tran, Nam Le Hai 等FSE 2026
  5. GraphCoder: Enhancing Repository-Level Code Completion via Coarse-to-fine Retrieval Based on Code Context GraphWei Liu, Ailun Yu, Daoguang Zan, Bo Shen 等ASE 2024 · 11 次引用
黄昏的海面,两侧是细线勾勒的悬崖