arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.18878cs.CL
收藏

学习使用模式强化学习生成结构化输出

Learning to Generate Structured Output with Schema Reinforcement Learning

Tsinghua University(清华大学);Renmin University of China(中国人民大学);Peng Cheng Laboratory(鹏城实验室)

Yaxi Lu, Haolun Li, Xin Cong, Zhong Zhang, Yesai Wu, Yankai Lin, Zhiyuan Liu, Fangming Liu, Maosong Sun

AI总结:

本研究调查LLMs在给定模式下生成有效JSON的能力,提出包含约40K个模式的SchemaBench基准,并利用细粒度模式验证器结合强化学习显著提升了模型生成有效JSON及下游任务的性能。

摘要:

本研究调查了大型语言模型(LLMs)的结构化生成能力,重点是在给定模式(schema)下生成有效的JSON输出。尽管JSON在将语言模型与程序集成中被广泛使用,但目前缺乏对这些能力的全面分析和基准测试。我们探索了JSON生成的各个方面,如结构理解、转义和自然语言描述,以确定如何评估并使LLMs生成有效的响应。在此基础上,我们提出了SchemaBench,包含约40K个不同的JSON模式,以获取和评估模型生成有效JSON的能力。我们发现最新的LLMs在生成有效JSON字符串方面仍然存在困难。此外,我们证明将强化学习与细粒度模式验证器(Fine-grained Schema Validator)结合可以进一步增强模型对JSON模式的理解,从而提升性能。我们的模型在生成JSON输出和下游任务中均展现出显著改善。

英文摘要:

This study investigates the structured generation capabilities of large language models (LLMs), focusing on producing valid JSON outputs against a given schema. Despite the widespread use of JSON in integrating language models with programs, there is a lack of comprehensive analysis and benchmarking of these capabilities. We explore various aspects of JSON generation, such as structure understanding, escaping, and natural language description, to determine how to assess and enable LLMs to generate valid responses. Building upon this, we propose SchemaBench features around 40K different JSON schemas to obtain and assess models' abilities in generating valid JSON. We find that the latest LLMs are still struggling to generate a valid JSON string. Moreover, we demonstrate that incorporating reinforcement learning with a Fine-grained Schema Validator can further enhance models' understanding of JSON schema, leading to improved performance. Our models demonstrate significant improvement in both generating JSON outputs and downstream tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑