arXiv:2603.25118cs.CV2026-03

用合成数据和强化学习,让AI更准生成网页文档。

AnyDoc: Enhancing Document Generation via Large-Scale HTML/CSS Data Synthesis and Height-Aware Reinforcement Optimization

  • 用自动合成生成26万份网页文档,覆盖111类风格
  • 三任务表现超越通用与专用模型,解决内容溢出问题
  • 适合网页生成、设计自动化等场景的开发者

文档生成在AI内容创作领域日益受关注。本文提出AnyDoc框架,可统一处理多种文档类型的生成任务,输出均为HTML/CSS格式。为克服现有手工标注数据集规模小、覆盖窄的问题,AnyDoc构建可扩展的数据合成管道,生成包含265,206个样本的大型数据集DocHTML,涵盖111个类别和32种风格,并附带设计意图、源代码、视觉资产及渲染截图等完整元信息。基于该数据集,AnyDoc微调多模态大模型(MLLMs),实现三项实用任务:意图到文档、文档反渲染、元素到文档。针对微调中出现的内容溢出问题,引入基于高度感知的强化学习(HARL)后训练机制,通过预测与目标高度差定义奖励函数,惩罚溢出并逐步缓解。定性和定量实验表明,AnyDoc在三项任务上均优于通用与专用基线模型。

原文摘要 · Abstract (English)

Document generation has gained growing attention in the field of AI-driven content creation. In this work, we push its boundaries by introducing AnyDoc, a framework capable of handling multiple generation tasks across a wide spectrum of document categories, all represented in a unified HTML/CSS format. To overcome the limited coverage and scale of existing human-crafted document datasets, AnyDoc first establishes a scalable data synthesis pipeline to automatically generate documents in HTML/CSS form. This pipeline yields DocHTML, a large-scale dataset containing 265,206 document samples, while spanning 111 categories and 32 distinct styles. Additionally, all documents are equipped with comprehensive metadata, including design intentions, HTML/CSS source code, visual assets, and rendered screenshots. Building on the curated dataset, AnyDoc fine-tunes multi-modal large language models (MLLMs) to achieve three practical document generation tasks: intention-to-document, document derendering, and element-to-document. To address the content overflow issue observed during fine-tuning, AnyDoc further incorporates a height-aware reinforcement learning (HARL) post-training procedure. By defining a reward function based on the difference between predicted and target document heights, overflow is penalized and gradually mitigated during HARL, thereby enhancing overall performance. Qualitative and quantitative experiments demonstrate that AnyDoc outperforms both general-purpose MLLMs and task-specific baselines across all three tasks.

文档生成HTML/CSS强化学习多模态

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