Open-domain Implicit Format Control for Large Language Model Generation

Yiqun Yao,Wenjia Ma,Xuezhi Fang,Xin Jiang,Xiang Li,Xuying Meng,Peng Han,Jing Li,Aixin Sun,Yequan Wang
2024-08-08
Abstract:Controlling the format of outputs generated by large language models (LLMs) is a critical functionality in various applications. Current methods typically employ constrained decoding with rule-based automata or fine-tuning with manually crafted format instructions, both of which struggle with open-domain format requirements. To address this limitation, we introduce a novel framework for controlled generation in LLMs, leveraging user-provided, one-shot QA pairs. This study investigates LLMs' capabilities to follow open-domain, one-shot constraints and replicate the format of the example answers. We observe that this is a non-trivial problem for current LLMs. We also develop a dataset collection methodology for supervised fine-tuning that enhances the open-domain format control of LLMs without degrading output quality, as well as a benchmark on which we evaluate both the helpfulness and format correctness of LLM outputs. The resulting datasets, named OIFC-SFT, along with the related code, will be made publicly available at <a class="link-external link-https" href="https://github.com/cofe-ai/OIFC" rel="external noopener nofollow">this https URL</a>.
Computation and Language
What problem does this paper attempt to address?
The paper aims to address the issue of controlling the format in the output generated by large language models (LLMs). Current methods typically rely on constrained decoding with rule-based automata or fine-tuning using hand-crafted format instructions, which perform poorly in open-domain format requirements. To overcome this limitation, the researchers introduce a new framework that utilizes user-provided one-shot QA pairs to achieve format control in LLM-generated content. Specifically, this study explores the ability of LLMs to replicate the example answer format according to open-domain one-shot constraints and finds that this is a non-trivial problem for existing LLMs. Additionally, the research team developed a data collection method to enhance the open-domain format control capabilities of LLMs through supervised fine-tuning, without compromising output quality. They also established a benchmark test set to evaluate the helpfulness and format correctness of LLM outputs. The final dataset, OIFC-SFT, and related code will be publicly released. Experimental results indicate that even under basic fine-tuning settings, using OIFC-SFT data can significantly improve format control capabilities without noticeably affecting the quality of the original responses.