paper-with-me

Papers

Compositional API Recommendation for Library-Oriented Code Generation

2024-02-29 · Zexiong Ma, Shengnan An, Bing Xie, Zeqi Lin

Large language models (LLMs) have achieved exceptional performance in code generation. However, the performance remains unsatisfactory in generating library-oriented code, especially for the libraries not present in the training data of LLMs. Previous work utilizes API recommendation technology to help LLMs use libraries: it retrieves APIs related to the user requirements, then leverages them as context to prompt LLMs. However, developmental requirements can be coarse-grained, requiring a combination of multiple fine-grained APIs. This granularity inconsistency makes API recommendation a challenging task. To address this, we propose CAPIR (Compositional API Recommendation), which adopts a "divide-and-conquer" strategy to recommend APIs for coarse-grained requirements. Specifically, CAPIR employs an LLM-based Decomposer to break down a coarse-grained task description into several detailed subtasks. Then, CAPIR applies an embedding-based Retriever to identify relevant APIs corresponding to each subtask. Moreover, CAPIR leverages an LLM-based Reranker to filter out redundant APIs and provides the final recommendation. To facilitate the evaluation of API recommendation methods on coarse-grained requirements, we present two challenging benchmarks, RAPID (Recommend APIs based on Documentation) and LOCG (Library-Oriented Code Generation). Experimental results on these benchmarks, demonstrate the effectiveness of CAPIR in comparison to existing baselines. Specifically, on RAPID's Torchdata-AR dataset, compared to the state-of-the-art API recommendation approach, CAPIR improves recall@5 from 18.7% to 43.2% and precision@5 from 15.5% to 37.1%. On LOCG's Torchdata-Code dataset, compared to code generation without API recommendation, CAPIR improves pass@100 from 16.0% to 28.0%.

📄 PDF Abstract BibTeX arXiv:2402.19431

Code (0)

등록된 구현이 없습니다.

Tasks

Code GenerationLibrary-Oriented Code Generation

Similar Papers 제목 키워드 기반

ProcFunc: Function-Oriented Abstractions for Procedural 3D Generation in Python

2026-04-29 · Alexander Raistrick, Karhan Kayan, Jack Nugent, David Yan 외 arxiv

We introduce ProcFunc, a library for Blender-based procedural 3D generation in Python. ProcFunc provides a library of easy-to-use Python functions, which streamline creating, combining, analyzing, and executing procedura…

Synthetic Data Generation3D Generation

A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models

2024-09-23 · Yixi Wu, Pengfei He, Zehao Wang, Shaowei Wang 외

Large language models (LLMs) like GitHub Copilot and ChatGPT have emerged as powerful tools for code generation, significantly enhancing productivity and accelerating software development. However, existing benchmarks pr…

Code GenerationRetrieval-augmented GenerationTask 2

CodeGen4Libs: A Two-Stage Approach for Library-Oriented Code Generation

2023-09-11 · IEEE/ACM International Conference on Automated Software Engineering 2023 9 · Mingwei Liu, Tianyong Yang, Yiling Lou, Xueying Du 외

Automated code generation has been extensively studied in recent literature. In this work, we first survey 66 participants to motivate a more pragmatic code generation scenario, i.e., library-oriented code generation, wh…

Code GenerationLibrary-Oriented Code Generation

Toward Compositional Generalization in Object-Oriented World Modeling

2022-04-28 · Linfeng Zhao, Lingzhi Kong, Robin Walters, Lawson L. S. Wong

Compositional generalization is a critical ability in learning and decision-making. We focus on the setting of reinforcement learning in object-oriented environments to study compositional generalization in world modelin…

Decision MakingObjectreinforcement-learningReinforcement Learning (RL)

CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generation

2022-06-14 · Daoguang Zan, Bei Chen, Dejian Yang, Zeqi Lin 외

Code generation is a longstanding challenge, aiming to generate a code snippet based on a natural language description. Usually, expensive text-code paired data is essential for training a code generation model. Recently…

Code GenerationLibrary-Oriented Code Generation