arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.01619cs.CVcs.AIcs.CLcs.LG
收藏

通过数据合成推进前端开发中的视觉-语言模型

Advancing vision-language models in front-end development via data synthesis

KE Holdings Inc.(贝壳找房);Alibaba Group(阿里巴巴集团)

Tong Ge, Yashu Liu, Jieping Ye, Tianyi Li, Chao Wang

AI总结:

提出反思性智能体工作流合成前端开发图文数据,结合三种数据合成策略训练视觉-语言模型Flame,显著提升从设计图像生成React代码的准确性与功能性。

摘要:

现代前端(FE)开发,特别是在利用 React 和 Vue 等框架的独特功能时,面临着独特的挑战。这些挑战包括管理模块化架构、确保数据与声明式渲染的视觉输出之间的同步,以及将可复用组件适配到各种场景。这些复杂性使得最先进的大型视觉-语言模型(VLMs)难以直接从设计图像生成准确且功能完备的代码。为了解决这些问题,我们提出了一种反思性智能体工作流,用于合成高质量的图文数据,以捕捉前端开发的多样化特征。该工作流自动化地从真实项目中提取自包含的代码片段,渲染相应的视觉输出,并生成将设计元素与功能代码关联的详细描述。为进一步扩展合成的范围和实用性,我们引入了三种数据合成策略:基于进化的合成,实现可扩展且多样化的数据集扩展;基于瀑布模型的合成,生成源自系统需求的逻辑连贯代码;以及增量开发合成,迭代地增加人工编写组件的复杂性。我们构建了一个大型视觉-语言模型 Flame,并在合成数据集上进行训练,通过 $\text{pass}@k$ 指标展示了其在生成 React 代码方面的有效性。结果表明,在生成代码前训练视觉-语言模型解释图像可能会取得更好的性能。

英文摘要:

Modern front-end (FE) development, especially when leveraging the unique features of frameworks like React and Vue, presents distinctive challenges. These include managing modular architectures, ensuring synchronization between data and visual outputs for declarative rendering, and adapting reusable components to various scenarios. Such complexities make it particularly difficult for state-of-the-art large vision-language models (VLMs) to generate accurate and functional code directly from design images. To address these challenges, we propose a reflective agentic workflow that synthesizes high-quality image-text data to capture the diverse characteristics of FE development. This workflow automates the extraction of self-contained\footnote{A \textbf{self-contained} code snippet is one that encapsulates all necessary logic, styling, and dependencies, ensuring it functions independently without requiring external imports or context.} code snippets from real-world projects, renders the corresponding visual outputs, and generates detailed descriptions that link design elements to functional code. To further expand the scope and utility of the synthesis, we introduce three data synthesis strategies: Evolution-based synthesis, which enables scalable and diverse dataset expansion; Waterfall-Model-based synthesis, which generates logically coherent code derived from system requirements; and Additive Development synthesis, which iteratively increases the complexity of human-authored components. We build a large vision-language model, Flame, trained on the synthesized datasets and demonstrate its effectiveness in generating React code via the $\text{pass}@k$ metric. Our results suggest that a code VLM trained to interpret images before code generation may achieve better performance.

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

↑