arXiv:2602.06384cs.CL2026-02

提升大模型生成规范Markdown的能力,解决格式错误影响使用的问题。

FMBench: Adaptive Large Language Model Output Formatting

  • 构建FMBench基准,评估模型在复杂指令下的格式适应能力。
  • 结合SFT与强化学习,使生成内容既准确又符合结构要求。
  • 适合需要高质量文档输出的AI助手、自动化系统开发者使用。

让大语言模型生成满足语义意图和格式约束的输出,对用户交互和系统集成至关重要。本文聚焦于广泛使用的Markdown格式,该格式在助手、文档及工具增强流程中常见,但常出现难以察觉的错误(如断裂列表、格式错误表格、标题不一致、无效代码块),严重影响下游可用性。为此,我们提出FMBench,一个用于评估自适应Markdown输出格式的基准,涵盖多样化的指令遵循场景和复杂的结构需求。该基准强调真实世界中的格式行为,如多级组织结构、自然语言与列表/表格/代码混合内容,以及严格遵守用户指定布局。为提高格式合规性而不依赖硬性解码约束,我们设计了一种轻量级对齐流水线,结合监督微调(SFT)与强化学习微调。从基础模型出发,先进行指令-响应对的SFT,再优化包含语义一致性与结构正确性的复合目标。在两个模型家族(OpenPangu和Qwen)上的实验表明,SFT持续提升语义对齐度,而强化学习在强SFT策略初始化下进一步增强对复杂指令的鲁棒性。结果还揭示了语义与结构目标间的固有权衡,凸显精心设计奖励函数的重要性。代码已开源:https://github.com/FudanCVL/FMBench。

原文摘要 · Abstract (English)

Producing outputs that satisfy both semantic intent and format constraints is essential for deploying large language models in user-facing and system-integrated workflows. In this work, we focus on Markdown formatting, which is ubiquitous in assistants, documentation, and tool-augmented pipelines but still prone to subtle, hard-to-detect errors (e.g., broken lists, malformed tables, inconsistent headings, and invalid code blocks) that can significantly degrade downstream usability. We present FMBench, a benchmark for adaptive Markdown output formatting that evaluates models under a wide range of instruction-following scenarios with diverse structural requirements. FMBench emphasizes real-world formatting behaviors such as multi-level organization, mixed content (natural language interleaved with lists/tables/code), and strict adherence to user-specified layout constraints. To improve Markdown compliance without relying on hard decoding constraints, we propose a lightweight alignment pipeline that combines supervised fine-tuning (SFT) with reinforcement learning fine-tuning. Starting from a base model, we first perform SFT on instruction-response pairs, and then optimize a composite objective that balances semantic fidelity with structural correctness. Experiments on two model families (OpenPangu and Qwen) show that SFT consistently improves semantic alignment, while reinforcement learning provides additional gains in robustness to challenging Markdown instructions when initialized from a strong SFT policy. Our results also reveal an inherent trade-off between semantic and structural objectives, highlighting the importance of carefully designed rewards for reliable formatted generation. Code is available at: https://github.com/FudanCVL/FMBench.

大模型格式生成Markdown强化学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。