Lune

ASE2023顶会

Domain Adaptive Code Completion via Language Models and Decoupled Domain Databases

Ze Tang, Jidong Ge, Shangqing Liu, Tingwei Zhu, Tongtong Xu, Liguo Huang, Bin Luo

摘要

Large Language Models (LLMs) have demonstrated remarkable performance in code completion. However, due to the lack of domain-specific knowledge, they may not be optimal in completing code that requires intensive domain knowledge for example completing the library names. Although there are several works that have confirmed the effectiveness of fine-tuning techniques to adapt language models for code completion in specific domains. They are limited by the need for constant fine-tuning of the model when the project is in constant iteration. To address this limitation, in this paper, we propose <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">kk</tex> NM-LM, a retrieval-augmented language model (R-LM), that integrates domain knowledge into language models without fine-tuning. Different from previous techniques, our approach is able to automatically adapt to different language models and domains. Specifically, it utilizes the in-domain code to build the retrieval-based database decoupled from LM, and then combines it with LM through Bayesian inference to complete the code. The extensive experiments on the completion of intra-project and intra-scenario have confirmed that <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">kk</tex> NM-LM brings about appreciable enhancements when compared to CodeGPT and UnixCoder. A deep analysis of our tool including the responding speed, storage usage, specific type code completion, and API invocation completion has confirmed that <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">kk</tex> NM-LM provides satisfactory performance, which renders it highly appropriate for domain adaptive code completion. Furthermore, our approach operates without the requirement for direct access to the language model's parameters. As a result, it can seamlessly integrate with black-box code completion models, making it easy to integrate our approach as a plugin to further enhance the performance of these models.

问 Lune

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

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

已有 12 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Attribution-guided Adversarial Code Prompt Generation for Code Completion Models 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Attribution-guided Adversarial Code Prompt Generation for Code Completion Models 引用了 FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion
  • ReACC: A Retrieval-Augmented Code Completion Framework 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • GraphCoder: Enhancing Repository-Level Code Completion via Coarse-to-fine Retrieval Based on Code Context Graph 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • GraphCoder: Enhancing Repository-Level Code Completion via Coarse-to-fine Retrieval Based on Code Context Graph 引用了 ReACC: A Retrieval-Augmented Code Completion Framework
  • GraphCoder: Enhancing Repository-Level Code Completion via Coarse-to-fine Retrieval Based on Code Context Graph 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • GraphCoder: Enhancing Repository-Level Code Completion via Coarse-to-fine Retrieval Based on Code Context Graph 引用了 FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion
  • Nearest Neighbor Machine Translation 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • Retrieval Augmented Language Model Pre-Training 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion 引用了 ReACC: A Retrieval-Augmented Code Completion Framework
  • FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion 引用了 Retrieval Augmented Language Model Pre-Training
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper12

  1. What Makes a High-Quality Training Dataset for Large Language Models: A Practitioners' PerspectiveXiao Yu, Zexian Zhang, Feifei Niu, Xing Hu 等ASE 2024 · 15 次引用
  2. FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code CompletionQi Guo, Xiaohong Li, Xiaofei Xie, Shangqing Liu 等ISSTA 2024 · 14 次引用
  3. 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 次引用
  4. Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real ProgramsHongyan Gao, Yibiao Yang, Maolin Sun, Jiangchang Wu 等ICSE 2025 · 6 次引用
  5. Attribution-guided Adversarial Code Prompt Generation for Code Completion ModelsXueyang Li, Guozhu Meng, Shangqing Liu, Lu Xiang 等ASE 2024 · 5 次引用

它引用的 Paper22

  1. Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat 等ICML 2020 · 2,937 次引用
  2. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  3. Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer 等ICLR 2020 · 1,038 次引用
  4. Nearest Neighbor Machine TranslationUrvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer 等ICLR 2021 · 323 次引用
  5. ReACC: A Retrieval-Augmented Code Completion FrameworkShuai Lu, Nan Duan, Hojae Han, Daya Guo 等ACL 2022 · 208 次引用

相关 Paper

  1. AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code CompletionTianyue Jiang, Yanlin Wang, Yanli Wang, Daya Guo 等ASE 2025 · 2 次引用
  2. Code Search is All You Need? Improving Code Suggestions with Code SearchJunkai Chen, Xing Hu, Zhenhao Li, Cuiyun Gao 等ICSE 2024 · 31 次引用
  3. CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code CompletionSheng Zhang, Yifan Ding, Shuquan Lian, Shun Song 等EMNLP 2025 · 3 次引用
  4. Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language ModelsJiaqi Cao, Jiarui Wang, Rubin Wei, Qipeng Guo 等NeurIPS 2025 · 14 次引用
  5. RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and GenerationFengji Zhang, Bei Chen, Yue Zhang, Jacky Keung 等EMNLP 2023 · 110 次引用
黄昏的海面,两侧是细线勾勒的悬崖