Abstract
In task-oriented conversational systems, the ability to accurately translate natural language into structured API calls is critical. This paper explores the challenge of "argument filling"—the process of extracting specific parameters from dialogue to populate API schemas. We present a specialized framework that utilizes a two-step instruction-tuning pipeline for open-source models and a multi-step prompting strategy for closed-source models. Our results demonstrate that a fine-tuned 7B-parameter model can significantly outperform much larger zero-shot baselines by reducing syntax errors and hallucinations, achieving high robustness even in out-of-domain scenarios.
Introduction
Task-oriented conversational systems, such as those used for booking flights or scheduling appointments, rely on a seamless transition from user intent to machine-executable actions. This process typically involves three distinct phases: selecting the appropriate API, filling its required arguments (e.g., date, time, location), and generating a natural language response.
While Large Language Models (LLMs) have shown promise in general reasoning, "argument filling" remains a significant bottleneck. Current models frequently struggle with two primary failure modes:
- Syntax Errors: The generation of keys or formats that do not exist within the pre-defined API schema.
- Hallucinations: The inclusion of values not present in the dialogue history, such as fabricated times or locations.
This paper addresses the challenge of grounding LLMs, ensuring they remain strictly faithful to both the provided API schema and the specific context of the conversation.
Methodology
Instruction-Tuning for Open-Source Models
For models where weights are accessible, such as LLaMA-v1-7B, we propose a two-phase instruction-tuning framework designed to improve adherence to structured outputs.
- Phase I: Model Bootstrapping (SFT): The model undergoes Supervised Fine-Tuning on labeled datasets to learn the fundamental task of outputting arguments in a structured dictionary-like format.
- Phase II: Rejection Sampling (RS) with a Custom Reward Function: To improve robustness, the model generates multiple candidate outputs for each prompt. These candidates are evaluated by a custom reward function that penalizes four specific error types: Non-existent Keys (NK), Missing Keys (MK), Schema-grounded but Incorrect Values (SV), and Hallucinated Values (HV). High-scoring samples—including those that are "noisy" but corrected—are used for a final round of fine-tuning. This process teaches the model to navigate and correct its own potential mistakes.
Multi-step Prompting for Closed-Source Models
Since closed-source models like ChatGPT cannot be fine-tuned, we developed a Multi-step Prompting Scheme. Rather than attempting to fill all arguments in a single pass, the system prompts the model to identify and fill one argument at a time. By providing "hints" about required slots and restricting the generative search space, this method prevents the model from drifting away from the schema constraints.
Experimental Setup
Datasets
We validated our framework using two major benchmarks:
- STAR: Comprising 5,820 realistic dialogues across 24 tasks and 13 domains (e.g., weather, hotel booking).
- SGD (Schema-Guided Dialogue): A large-scale dataset featuring over 22,000 dialogues across 20 domains, characterized by complex and diverse API schemas.
Performance was measured in both in-domain (seen tasks) and out-of-domain (unseen tasks) scenarios to evaluate the generalization capabilities of the models.
Key Results and Insights
Performance Metrics
The LLaMA-v1-7B model, utilizing the SFT + Rejection Sampling pipeline, achieved an F-1 score of 0.7834 on the SGD dataset. This significantly outperformed ChatGPT’s zero-shot performance, which reached only 0.4802. Furthermore, the pipeline demonstrated strong out-of-domain robustness, maintaining an F-1 score of 0.7608 on unseen SGD tasks.
The "Noisy Data" Advantage
A critical finding of this research is that fine-tuning on rejection-sampled, model-generated data (Phase II) provides superior results compared to using human-labeled data alone. This "noisy" training data effectively prepares the model for the types of errors it is likely to encounter during inference, making it more resilient.
Grounding vs. Reasoning
The study suggests that for argument filling, the primary hurdle is not the model's general intelligence but its adherence to constraints. By categorizing errors into measurable types (NK, MK, SV, HV), we transform a linguistic challenge into a structured optimization task. Our results show that a smaller, specialized 7B model can provide more reliable structured output than a massive general-purpose model used in a zero-shot context.
Limitations and Future Work
While the proposed framework significantly improves accuracy, several challenges remain:
- Inference Latency: LLMs are computationally expensive, and their inference time is higher than traditional modular systems, which may impact real-time applications.
- Model Evolution: This study focused on LLaMA-v1; future work should evaluate the framework on more recent architectures like Llama-3 or Mistral.
- Targeted Decoding: Future research could explore modifying the decoding process itself to programmatically prevent the generation of tokens that violate the API schema, ensuring 100% syntax compliance.
Conclusion
By combining specialized instruction-tuning with rejection sampling, we demonstrate that even relatively small LLMs can be transformed into highly effective tools for API argument filling. This approach prioritizes grounding and schema adherence, providing a robust foundation for the next generation of task-oriented conversational AI.
Summary updated