ExploraCoder: Advancing Code Generation for Multiple Unseen APIs via Planning and Chained Exploration
Abstract: Large language models face intrinsic limitations in coding with APIs that are unseen in their training corpora. As libraries continuously evolve, it becomes impractical to exhaustively retrain LLMs with new API knowledge. This limitation hampers LLMs from solving programming problems which require newly introduced or privately maintained libraries.
Inspired by exploratory programming paradigm in human behavior, we propose **ExploraCoder**, a training-free framework that empowers LLMs to invoke multiple unseen APIs in code solution by (1) planning a complex problem into several API invocation subtasks, and (2) experimenting with correct API usage at intermediate steps through a novel chain-of-API-exploration.
We conduct evaluation on program synthesizing tasks involving complex API interactions. Experimental results demonstrate that ExploraCoder significantly improves performance for models lacking prior API knowledge, achieving absolute increases of up to 11.99\% over various RAG-based approaches and 17.28\% over pretraining methods in pass@10.
Paper Type: Long
Research Area: NLP Applications
Research Area Keywords: Large Language Models, Code Generation, Code Library, Retrieval Augmented Generation
Contribution Types: NLP engineering experiment, Data resources
Languages Studied: Code Language, Natural Language
Submission Number: 8110
Loading