Lune

EMNLP Findings2022

When Language Model Meets Private Library

Daoguang Zan, Bei Chen, Zeqi Lin, Bei Guan, Yongji Wang, Jian-Guang Lou

摘要

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 Torch-DataEval, MonkeyEval, and BeatNumEval. Experimental results demonstrate the impressive performance of our framework. 1 .

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 Learning and Evaluating Contextual Embedding of Source Code
  • Large Language Models Meet NL2Code: A Survey 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Monitor-Guided Decoding of Code LMs with Static Analysis of Repository Context 引用了 Learning and Evaluating Contextual Embedding of Source Code
  • CodeBERT: A Pre-Trained Model for Programming and Natural Languages 引用了 Learning and Evaluating Contextual Embedding of Source Code
  • Learning and Evaluating Contextual Embedding of Source Code 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Repoformer: Selective Retrieval for Repository-Level Code Completion 引用了 RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation 引用了 RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper27

  1. RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and GenerationFengji Zhang, Bei Chen, Yue Zhang, Jacky Keung 等EMNLP 2023 · 110 次引用
  2. Large Language Models Meet NL2Code: A SurveyDaoguang Zan, Bei Chen, Fengji Zhang, Dianjie Lu 等ACL 2023 · 104 次引用
  3. Repoformer: Selective Retrieval for Repository-Level Code CompletionDi Wu, Wasi Uddin Ahmad, Dejiao Zhang, Murali Krishna Ramanathan 等ICML 2024 · 78 次引用
  4. Monitor-Guided Decoding of Code LMs with Static Analysis of Repository ContextLakshya A. Agrawal, Aditya Kanade, Navin Goyal, Shuvendu K. Lahiri 等NeurIPS 2023 · 55 次引用
  5. LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and MitigationZiyao Zhang, Chong Wang, Yanlin Wang, Ensheng Shi 等ISSTA 2025 · 53 次引用

它引用的 Paper12

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  2. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  3. Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text RetrievalLee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang 等ICLR 2021 · 1,547 次引用
  4. CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
  5. Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 次引用

相关 Paper

  1. ExploraCoder: Advancing Code Generation for Multiple Unseen APIs via Planning and Chained ExplorationYunkun Wang, Yue Zhang, Zhen Qin, Chen Zhi 等ACL 2025 · 13 次引用
  2. DocPrompting: Generating Code by Retrieving the DocsShuyan Zhou, Uri Alon, Frank F. Xu, Zhengbao Jiang 等ICLR 2023 · 18 次引用
  3. Example Quality Matters: Multi-Aspects Example Augmentation for Private Library ProgrammingYuhao Li, Haifeng Sun, Xuesong Zhang, Shu Yao 等ACL 2026
  4. DocCGen: Document-based Controlled Code GenerationSameer Pimparkhede, Mehant Kammakomati, Srikanth Tamilselvam, Prince Kumar 等EMNLP 2024 · 4 次引用
  5. APIRecX: Cross-Library API Recommendation via Pre-Trained Language ModelYuning Kang, Zan Wang, Hongyu Zhang, Junjie Chen 等EMNLP 2021 · 21 次引用
黄昏的海面,两侧是细线勾勒的悬崖