CoChat

Domain Adaptive Code Completion via Language Models and Decoupled Domain Databases

Tang, Ze, Ge, Jidong, Liu, Shangqing, Zhu, Tingwei, Xu, Tongtong, Huang, Liguo, Luo, Bin · 2023 · 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)
Cited by 36

The DOI matches its Crossref record; 26 of the 26 references it cites were found in a registry or an index.

Abstract

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$k$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$k$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$k$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.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1109/ase56229.2023.00076

Cites

26 of 26 references verified0 citation errors · 0 not checkable

Statistics

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Research works printed but not linked: 33

  1. 10.18653/v1/2022.acl-long.431 · doi:10.18653/v1/2022.acl-long.431 · Paper page
  2. 10.1145/3551349.3556943 · DOI
  3. guu, 2020, Retrieval augmented language model pre-training, International Conference on Machine Learning, 3929
  4. 10.1109/ICSE48619.2023.00028 · DOI
  5. zhou, 2019, Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks, Advances in neural information processing systems, 32
  6. 10.24963/ijcai.2022/329 · DOI · Paper page
  7. 10.1145/3196321.3196334 · DOI · Paper page
  8. 0, Openai's text embedding api
  9. 10.1007/3-540-45014-9_1 · DOI · Paper page
  10. joyce, 2003, Bayes' theorem, Stanford Encyclopedia of Philosophy
  11. 0, Openai's completion api
  12. huang, 2023, k nn-adapter: Efficient domain adaptation for black-box language models, ArXiv Preprint
  13. meng, 0, Gnn-lm: Language modeling based on global contexts via gnn, ICLR 2022 Workshop on Deep Learning on Graphs for Natural Language Processing
  14. 10.1109/ICSE48619.2023.00178 · DOI · Paper page
  15. 10.1145/3510003.3510141 · DOI · Paper page
  16. wang, 2022, A tree-structured transformer for program representation learning, ArXiv Preprint
  17. liu, 0, Retrieval-augmented generation for code summarization via hybrid gnn, International Conference on Learning Representations
  18. xu, 2022, Capturing structural locality in non-parametric language models, The Tenth International Conferenceon Learning Representations ICLR 2022 Virtual Event April 25-29 2022
  19. 0, ChatGPT plugin in VSCode
  20. bogomolov, 2022, Assessing project-level fine-tuning of ML4SE models, CoRR, abs 2206 3333
  21. 10.1145/3510003.3510096 · DOI · Paper page
  22. 0, GitHub Copilot website
  23. 10.1007/978-3-642-03013-0_15 · DOI · Paper page
  24. 10.24963/ijcai.2018/578 · DOI · Paper page
  25. guo, 0, Learning to complete code with sketches, International Conference on Learning Representations
  26. allamanis, 0, Learning to represent programs with graphs, International Conference on Learning Representations
  27. 10.1186/1471-2105-15-293 · DOI · Paper page
  28. peng, 2022, Revisiting, benchmarking and exploring api recommendation: How far are we?, IEEE Transactions on Software Engineering
  29. 10.1109/ICSE43902.2021.00145 · DOI
  30. wang, 2023, Practitioners' expectations on code completion, ArXiv Preprint
  31. 10.18653/v1/D18-1111 · DOI · Paper page
  32. alon, 0, code2seq: Generating sequences from structured representations of code, International Conference on Learning Representations
  33. 10.1109/MSR52588.2021.00014 · DOI

Cited by

See all 36

Metadata

Authors
Tang, Z., Ge, J., Liu, S., Zhu, T., Xu, T., Huang, L., & Luo, B.
Affiliations
  • Nanjing University,National Key Laboratory for Novel Software Technology,China
  • Nanyang Technological University,Singapore
  • Huawei Software Engineering Application Technology,China
  • Southern Methodist University,Department of Computer Science,USA
Venue
2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)
Publisher
IEEE
Published
2023-09-11
Pages
421-433
Cited by
36
References
26
Funders
  • National Key Research and Development Program of China (2022YFF0711404)
  • Natural Science Foundation of Jiangsu Province (BK20201250)

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.