arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2512.18996cs.IRcs.SE
收藏

模块化布局合成(MLS):通过结构规范化和约束生成实现前端代码

Modular Layout Synthesis (MLS): Front-end Code via Structure Normalization and Constrained Generation

Nanjing University(南京大学)

Chong Liu, Ming Zhang, Fei Li, Hao Zhou, Xiaoshuang Chen, Ye Yuan

AI总结:

本文提出模块化布局合成(MLS),通过结构规范化和约束生成,提升前端代码的模块化和重用性,适用于多种现代开发框架。

摘要:

自动化前端工程显著减少了开发周期并最小化了手动编码的开销。尽管生成式AI在将设计转换为代码方面显示出潜力,但当前解决方案往往生成单一的脚本,无法原生支持现代生态系统,如React、Vue或Angular。此外,生成的代码经常模块化较差,难以维护。为弥合这一差距,我们引入了模块化布局合成(MLS),一种分层框架,将视觉理解与结构规范化相结合。最初,一个视觉-语义编码器将屏幕捕获映射为序列化的树形拓扑结构,捕捉到布局层次结构的本质。与其简单的解析不同,我们应用启发式去重和模式识别来隔离可重用的块,创建框架无关的模式。最后,基于约束的生成协议指导LLM生成生产就绪的代码,具有严格的类型和组件属性。评估显示,MLS在现有基线中表现显著优于,确保在多个框架中更优越的代码重用性和结构完整性。

英文摘要:

Automated front-end engineering drastically reduces development cycles and minimizes manual coding overhead. While Generative AI has shown promise in translating designs to code, current solutions often produce monolithic scripts, failing to natively support modern ecosystems like React, Vue, or Angular. Furthermore, the generated code frequently suffers from poor modularity, making it difficult to maintain. To bridge this gap, we introduce Modular Layout Synthesis (MLS), a hierarchical framework that merges visual understanding with structural normalization. Initially, a visual-semantic encoder maps the screen capture into a serialized tree topology, capturing the essential layout hierarchy. Instead of simple parsing, we apply heuristic deduplication and pattern recognition to isolate reusable blocks, creating a framework-agnostic schema. Finally, a constraint-based generation protocol guides the LLM to synthesize production-ready code with strict typing and component props. Evaluations show that MLS significantly outperforms existing baselines, ensuring superior code reusability and structural integrity across multiple frameworks

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

↑