We introduce API Pack, a massive multi-programming language dataset containing more than 1 million instruction-API call pairs to improve the API call generation capabilities of large language models. By fine-tuning CodeLlama-13B on 20,000 Python instances from API Pack, we achieved around 10% and 5% higher accuracy compared to GPT-3.5 and GPT-4, respectively, in generating unseen API calls. Fine-tuning on API Pack enables cross-programming language generalization by leveraging a large amount of data in one language and small amounts of data from other languages. Scaling the training data to 1 million instances further improves the model's generalization to new APIs not encountered during training. We open-source the API Pack dataset, trained models, and associated source code at https://github.com/zguo0525/API-Pack to facilitate further research.
翻译:本文介绍API Pack,一个包含超过100万条指令-API调用对的大规模多编程语言数据集,旨在提升大语言模型的API调用生成能力。通过在API Pack中的20,000个Python实例上对CodeLlama-13B进行微调,我们在生成未见过的API调用时,相比GPT-3.5和GPT-4分别实现了约10%和5%的准确率提升。利用API Pack进行微调能够通过整合一种语言的大量数据与其他语言的少量数据,实现跨编程语言的泛化能力。将训练数据规模扩展至100万实例可进一步提升模型对训练中未见过的新API的泛化性能。我们在https://github.com/zguo0525/API-Pack开源了API Pack数据集、训练模型及相关源代码,以促进后续研究。