FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and Reranking

Zhuoer Wang, Leonardo F. R. Ribeiro, Alexandros Papangelis, Rohan Mukherjee, Tzu-Yen Wang +4 more
7/18/2024
cs.CL

No official code found. Best implementation: Edillower/FANTASE (0 stars, last commit 2025-01-02).

Abstract

API call generation is the cornerstone of large language models' tool-using ability that provides access to the larger world. However, existing supervised and in-context learning approaches suffer from high training costs, poor data efficiency, and generated API calls that can be unfaithful to the API documentation and the user's request. To address these limitations, we propose an output-side optimization approach called FANTASE. Two of the unique contributions of FANTASE are its State-Tracked Constrained Decoding (SCD) and Reranking components. SCD dynamically incorporates appropriate API constraints in the form of Token Search Trie for efficient and guaranteed generation faithfulness with respect to the API documentation. The Reranking component efficiently brings in the supervised signal by leveraging a lightweight model as the discriminator to rerank the beam-searched candidate generations of the large language model. We demonstrate the superior performance of FANTASE in API call generation accuracy, inference efficiency, and context efficiency with DSTC8 and API Bank datasets.

View on arXivView PDF

Code Implementations(1)

Edillower/FANTASECommunity69%

FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and Reranking

00Oct 29, 20241 years ago

Similar Papers

Cite this paper

@article{wang2024fantastic,
  title  = {FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and Reranking},
  author = {Zhuoer Wang and Leonardo F. R. Ribeiro and Alexandros Papangelis and Rohan Mukherjee and Tzu-Yen Wang and Xinyan Zhao and Arijit Biswas and James Caverlee and Angeliki Metallinou},
  year   = {2024},
  eprint = {2407.13945},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.13945v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.13945.svg)](https://codeofpaper.com/paper/2407.13945)

Discussion