atlas

Research map / Large language models / Instruction and fine-tuning

API Pack: A Massive Multi-Programming Language Dataset for API Call Generation

ICLR 2025 · Large language models › Instruction and fine-tuning · approach: Gradient-free adaptation and merging · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces API Pack, a 1.1M-instance multi-language instruction dataset of API call code, and shows fine-tuned CodeLlama-13B beats GPT-3.5/GPT-4 on unseen APIs.

Problem

LLMs struggle to generate correct HTTP API call code, especially for unseen APIs and across programming languages, and no large open dataset existed for API call code generation.

Approach

Build a large multi-language instruction-API call dataset from OpenAPI specs (rendered into 10 languages via openapi-snippet), with LLM-generated and LLM-filtered instructions, and evaluate generalization across three levels of API novelty.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Fine-tune CodeLlama-13B on 20,000 Python API Pack instances with the 3-shot template instead of the 0-shot template (ablation)CodeLlama-13B · Level 3 (unseen APIs and endpoints), 3-shot retrieved evaluationAPI Call accuracy: 44.1% to 49.5%Helped
Fine-tune CodeLlama-13B on 20,000 Python API Pack instancesCodeLlama-13B · Level 3 (unseen APIs and endpoints), 3-shot retrieved evaluationAPI Call accuracy: 49.5% compared to 39.5% for GPT-3.5 and 44.3% for GPT-4Helped
Use retrieved relevant examples instead of randomly selected examplesFine-tuned Mistral-7B and CodeLlama-13B · Levels 1–3API Call accuracy: 52.9 to 55.5 (Level 1); 49.2 to 51.4 (Level 2); 49.3 to 49.5 (Level 3)Helped
Add generic reranking to retrieved examples (ablation)Fine-tuned CodeLlama-13B · Level 1 (seen APIs and endpoints)API Call accuracy: 55.5% to 52.9%Hurt
Replace one retrieved example with the oracle example (ablation)Fine-tuned CodeLlama-13B · Levels 1–3API Call accuracy: 71.2; 64.1; 59.3Helped
Combine 100,000 cURL instances with 1,000 instances in each of nine additional languagesCross-language mixture model · API call generation across ten programming languagesAPI call performanceHelped
Increase API Pack fine-tuning data from 0 to 1 million instancesCodeLlama-13B · Levels 1–3, 0-shot evaluationEndpoint and API call accuracyHelped
Increase fine-tuning data toward 1 million instancesCodeLlama-13B · Levels 2 and 3, 3-shot evaluationEndpoint and API call accuracyMixed
Train on APIs from four sources instead of ToolBench's single sourceCodeLlama-13B · Levels 1–3, 0-shot and 3-shotEndpoint and API Call accuracy: 37.8 to 55.5 (Level 1 API Call, 3-shot); 36.4 to 51.4 (Level 2 API Call, 3-shot); 38.1 to 49.1 (Level 3 API Call, 3-shotHelped
Replace 45% of filtered instructions with non-filtered instructions (ablation)API Pack fine-tuning · Levels 1–3, 0-shot and 3-shotEndpoint and API Call accuracy: 54.9 to 55.5 (Level 1 API Call, 3-shot); 48.7 to 51.4 (Level 2 API Call, 3-shot); 49.5 to 49.1 (Level 3 API Call, 3-shotHurt

Surprising findings

Limitations

Experimental setup

Datasets: API Pack ToolBench Magicoder

Benchmarks: API Pack test split (Level 1, Level 2, Level 3) HumanEval+ MBPP

Metrics: API call accuracy endpoint accuracy intent accuracy difflib SequenceMatcher similarity >= 0.9

Baselines: GPT-3.5 GPT-4 Mistral-7b Llama-2-13b ToolBench-trained CodeLlama-13b Magicoder

Builds on: Self-Instruct Evol-Instruct Gorilla ToolBench

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy