Saved in:
Bibliographic Details
Main Authors: Wang, Yunkun, Zhang, Yue, Qin, Zhen, Zhi, Chen, Li, Binhua, Huang, Fei, Li, Yongbin, Deng, Shuiguang
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2412.05366
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • 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 retrieval-based approaches and 17.28% over pretraining-based methods in pass@10.