Measuring and Mitigating Constraint Violations of In-Context Learning for Utterance-to-API Semantic Parsing

05/24/2023
by   Shufan Wang, et al.
0

In executable task-oriented semantic parsing, the system aims to translate users' utterances in natural language to machine-interpretable programs (API calls) that can be executed according to pre-defined API specifications. With the popularity of Large Language Models (LLMs), in-context learning offers a strong baseline for such scenarios, especially in data-limited regimes. However, LLMs are known to hallucinate and therefore pose a formidable challenge in constraining generated content. Thus, it remains uncertain if LLMs can effectively perform task-oriented utterance-to-API generation where respecting API's structural and task-specific constraints is crucial. In this work, we seek to measure, analyze and mitigate such constraints violations. First, we identify the categories of various constraints in obtaining API-semantics from task-oriented utterances, and define fine-grained metrics that complement traditional ones. Second, we leverage these metrics to conduct a detailed error analysis of constraints violations seen in state-of-the-art LLMs, which motivates us to investigate two mitigation strategies: Semantic-Retrieval of Demonstrations (SRD) and API-aware Constrained Decoding (API-CD). Our experiments show that these strategies are effective at reducing constraints violations and improving the quality of the generated API calls, but require careful consideration given their implementation complexity and latency.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/06/2022

Binding Language Models in Symbolic Languages

Though end-to-end neural approaches have recently been dominating NLP ta...
research
12/01/2020

Designing Voice-Controllable APIs

The main purpose of a voice command system is to process a sentence in n...
research
02/02/2022

Retrieve-and-Fill for Scenario-based Task-Oriented Semantic Parsing

Task-oriented semantic parsing models have achieved strong results in re...
research
12/09/2021

Compositional Generalization for Natural Language Interfaces to Web APIs

This paper presents Okapi, a new dataset for Natural Language to executa...
research
04/12/2021

Learning from Executions for Semantic Parsing

Semantic parsing aims at translating natural language (NL) utterances on...
research
05/24/2023

Gorilla: Large Language Model Connected with Massive APIs

Large Language Models (LLMs) have seen an impressive wave of advances re...
research
03/28/2023

On Codex Prompt Engineering for OCL Generation: An Empirical Study

The Object Constraint Language (OCL) is a declarative language that adds...

Please sign up or login with your details

Forgot password? Click here to reset