2025-02-24 · 专家 · 自然语言处理 · 机器学习

Think Inside the JSON: Reinforcement Strategy for Strict LLM Schema Adherence

该论文提出了一种基于强化学习和监督微调的严格模式遵守策略,用于提高大型语言模型生成结构化文本的准确性。

更新于 2025-02-24。作者:Bhavik Agarwal、Ishan Joshi、Viktoria Rojkova。

中文摘要

在这篇论文中,我们通过利用大型语言模型(LLM)的推理能力来解决在LLM生成中强制执行严格模式遵守的挑战。基于DeepSeek R1强化学习框架,我们的方法通过一种新颖的流程训练了一个1.5B参数模型的有序推理技能,该流程结合了合成推理数据集构建和自定义奖励函数,在集团相对策略优化(GRPO)下进行。具体来说,我们首先在20K样本的非结构化到结构化数据集上执行R1强化学习,与原始DeepSeek R1方法相呼应,以建立核心推理能力。随后,我们在一个独立的10K推理样本数据集上进行了监督微调,重点关注下游任务的模式遵守的细化。尽管训练范围相对较小,大约需要20小时在8xH100 GPU集群上用于GRPO训练,以及3小时在1xA100上用于SFT,但我们的模型在强制执行模式一致性方面表现出稳健的性能。我们将我们的ThinkJSON方法与原始DeepSeek R1(671B)、DeepSeek R1的蒸馏版本(Qwen-1.5B和Qwen-7B)以及Gemini 2.0 Flash(70B)进行了比较,展示了其在实际应用中的有效性。我们的结果强调了资源高效框架在模式约束文本生成中的实际效用。

英文摘要

In this paper, we address the challenge of enforcing strict schema adherence in large language model (LLM) generation by leveraging LLM reasoning capabilities. Building on the DeepSeek R1 reinforcement learning framework, our approach trains structured reasoning skills of a 1.5B parameter model through a novel pipeline that combines synthetic reasoning dataset construction with custom reward functions under Group Relative Policy Optimization (GRPO). Specifically, we first perform R1 reinforcement learning on a 20K sample unstructured-to-structured dataset, mirroring the original DeepSeek R1 methods, to establish core reasoning abilities. Subsequently, we performed supervised fine-tuning on a separate 10K reasoning sample dataset, focusing on refining schema adherence for downstream tasks. Despite the relatively modest training scope, requiring approximately 20 hours on an 8xH100 GPU cluster for GRPO training and 3 hours on 1xA100 for SFT, our model demonstrates robust performance in enforcing schema consistency. We compare our ThinkJSON approach against the original DeepSeek R1 (671B), distilled versions of DeepSeek R1 (Qwen-1.5B and Qwen-7B), and Gemini 2.0 Flash (70B), showcasing its effectiveness in real-world applications. Our results underscore the practical utility of a resource-efficient framework for schema-constrained text generation.

解读

一句话总结

该论文提出了一种基于强化学习和监督微调的严格模式遵守策略,用于提高大型语言模型生成结构化文本的准确性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt