APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhong, Hua, Jiang, Shan, Khurshid, Sarfraz
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911183995404288
author Zhong, Hua
Jiang, Shan
Khurshid, Sarfraz
author_facet Zhong, Hua
Jiang, Shan
Khurshid, Sarfraz
contents APIs are central to modern software development, yet composing new APIs from large libraries is difficult due to the exponential search space; traditional component-based synthesis relies on costly exploration and hand-crafted specifications. While large language models (LLMs) can generate implementations from natural language, hallucinations and limited access to up-to-date contextual information often yield incorrect code. In this paper, we present APRIL, an approach that combines LLM-based synthesis with Automatic Prompt Optimization (APO) and Reinforcement Learning from Verifiable Rewards (RLVR): APO iteratively refines prompts for a frozen model, while RLVR fine-tunes the policy toward functional correctness, producing an efficient synthesis pipeline. Evaluated on 81 real-world APIs from widely used scientific Python libraries and benchmarked against instruction-tuned but unfine-tuned LLMs guided by expert prompts, APRIL achieves substantial improvements. These results indicate that integrating APO and RLVR provides a robust, scalable path for component-based API synthesis in large libraries.
format Preprint
id arxiv_https___arxiv_org_abs_2509_25196
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning
Zhong, Hua
Jiang, Shan
Khurshid, Sarfraz
Software Engineering
Artificial Intelligence
Machine Learning
Programming Languages
APIs are central to modern software development, yet composing new APIs from large libraries is difficult due to the exponential search space; traditional component-based synthesis relies on costly exploration and hand-crafted specifications. While large language models (LLMs) can generate implementations from natural language, hallucinations and limited access to up-to-date contextual information often yield incorrect code. In this paper, we present APRIL, an approach that combines LLM-based synthesis with Automatic Prompt Optimization (APO) and Reinforcement Learning from Verifiable Rewards (RLVR): APO iteratively refines prompts for a frozen model, while RLVR fine-tunes the policy toward functional correctness, producing an efficient synthesis pipeline. Evaluated on 81 real-world APIs from widely used scientific Python libraries and benchmarked against instruction-tuned but unfine-tuned LLMs guided by expert prompts, APRIL achieves substantial improvements. These results indicate that integrating APO and RLVR provides a robust, scalable path for component-based API synthesis in large libraries.
title APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning
topic Software Engineering
Artificial Intelligence
Machine Learning
Programming Languages
url https://arxiv.org/abs/2509.25196