Learning to Generate Structured Output with Schema Reinforcement Learning
Yaxi Lu, Haolun Li, Xin Cong, Zhong Zhang, Yesai Wu, Yankai Lin, Zhiyuan Liu, Fangming Liu, Maosong Sun
Abstract
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. 1
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 55cb0061-be46-483f-8dc8-e88de34a2582Cited by top-tier papers4
- When Grammar Guides the Attack: Uncovering Control-Plane Vulnerabilities in LLMs with Structured OutputShuoming Zhang, Jiacheng Zhao, Hanyuan Dong, Ruiyuan Xu et al.CCS 2026 · 6 citations
- Training-Free Multimodal Large Language Model OrchestrationTianyu Xie, Yuexiao Ma, Yuhang Wu, Wang Chen et al.ICML 2026 · 2 citations
- ZipLJP: Zipped Information Processor for Legal Judgment PredictionFanghao Lou, Qiqi Wang, Guanyu Chen, Kaiqi Zhao et al.AAAI 2026
- SelPE: Progressive Selection for Private Structured Text SynthesisXuancheng Zhu, Guoshun Nan, Han Zhang, Ben Niu et al.KDD 2026
Builds on12
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu et al.NeurIPS 2023 · 5,989 citations
- SGLang: Efficient Execution of Structured Language Model ProgramsLianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun et al.NeurIPS 2024 · 1,586 citations
- GLM-130B: An Open Bilingual Pre-trained ModelAohan Zeng, Xiao Liu, Zhengxiao Du, Zihan Wang et al.ICLR 2023 · 295 citations
Related papers
- SO-Bench: A Structural Output Evaluation of Multimodal LLMDi Feng, Kaixin Ma, Feng Nan, Haofeng Chen et al.CVPR 2026
- Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification InferenceThanh Le-Cong, Bach Le, Toby MurrayACL 2025
- Unveiling the Potential of Diffusion Large Language Model in Controllable GenerationZhen Xiong, Yujun Cai, Zhecheng Li, Yiwei WangICLR 2026 · 19 citations
- LLMs Caught in the Crossfire: Malware Requests and Jailbreak ChallengesHaoyang Li, Huan Gao, Zhiyuan Zhao, Zhiyu Lin et al.ACL 2025
- ReFF: Reinforcing Format Faithfulness in Language Models Across Varied TasksJiashu Yao, Heyan Huang, Zeming Liu, Haoyu Wen et al.AAAI 2025 · 1 citation
