PreprintCited by 39Software Engineering ResearchTopic ModelingInformation Retrieval and Search Behavior

The DOI matches its DataCite record.

When Language Model Meets Private Library

Open access
Zan, Daoguang, Chen, Bei, Lin, Zeqi, Guan, Bei, Wang, Yongji, Lou, Jian-Guang·2022·arXiv

Abstract

With the rapid development of pre-training techniques, a number of language models have been pre-trained on large-scale code corpora and perform well in code generation. In this paper, we investigate how to equip pre-trained language models with the ability of code generation for private libraries. In practice, it is common for programmers to write code using private libraries. However, this is a challenge for language models since they have never seen private APIs during training. Motivated by the fact that private libraries usually come with elaborate API documentation, we propose a novel framework with two modules: the APIRetriever finds useful APIs, and then the APICoder generates code using these APIs. For APIRetriever, we present a dense retrieval system and also design a friendly interaction to involve uses. For APICoder, we can directly use off-the-shelf language models, or continually pre-train the base model on a code corpus containing API information. Both modules are trained with data from public libraries and can be generalized to private ones. Furthermore, we craft three benchmarks for private libraries, named TorchDataEval, MonkeyEval, and BeatNumEval. Experimental results demonstrate the impressive performance of our framework.

Overview

Integrity signals

Registry

DataCite · 10.48550/arxiv.2210.17236

Cites

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

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?

Citations

Cited by

Sorted by citations

Metadata

Authors
Zan, D., Chen, B., Lin, Z., Guan, B., Wang, Y., & Lou, J.-G.
Affiliations
  • Chinese Academy of Sciences (CN)
  • Microsoft Research Asia (China) (CN)
Venue
arXiv
Publisher
arXiv
Published
2022
Pages
277-288
OpenAlex
W4385574207
Cited by
39
References
0
Citations by year
2026: 10 · 2025: 15 · 2024: 11 · 2023: 3
FWCI
6.48
Type
conference paper
Language
en
Open access
Locations
  • Findings of the Association for Computational Linguistics: EMNLP (Findings of EMNLP) (publishedVersion, cc-by)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University) (cc-by)
Funders
  • Microsoft Research
  • Microsoft Research Asia
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Information Systems › Information Retrieval and Search Behavior
Keywords
private libraries, code generation, API documentation, dense retrieval, pre-trained language models

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