arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.13832cs.SEcs.AI
收藏

FrontendBench:通过自动评估衡量大语言模型前端开发能力的基准

FrontendBench: A Benchmark for Evaluating LLMs on Front-End Development via Automatic Evaluation

Institute for Clarity in Documentation(清晰文档研究所);Inria Paris-Rocquencourt(巴黎-罗quant研究所);Rajiv Gandhi University(拉贾·甘地大学);Tsinghua University(清华大学);Palmer Research Laboratories(帕尔默研究实验室)

Hongda Zhu, Yiwen Zhang, Bing Zhao, Jingzhe Ding, Siyao Liu, Tong Liu, Dandan Wang, Yanan Liu, Zhaojian Li

AI总结:

针对现有前端代码生成基准任务简单、测试不严且缺乏端到端验证的问题,提出人机协同构建的FrontendBench基准,含148对测试用例,并引入沙盒自动评估框架,与专家评估吻合率达90.54%,揭示模型性能差异。

摘要:

大语言模型(LLMs)在前端代码生成方面取得了显著进展。然而,现有基准存在几个关键局限性:许多任务过于简单,测试用例往往缺乏严谨性,并且缺少端到端验证。这些问题阻碍了对模型性能的准确评估。为解决这些挑战,我们提出了FrontendBench,一个由人类和LLMs共同开发的基准。FrontendBench根据代码功能对任务进行分类,并纳入交互式测试场景,从而能够对前端代码生成能力进行更全面、更实用的评估。该基准包含148对精心设计的提示-测试用例,涵盖从基本UI元素到复杂交互功能的五个级别的Web组件。每项任务都反映了现实中的前端开发挑战。此外,我们引入了一个自动评估框架,该框架在沙盒环境中执行生成的代码,并使用预定义的测试脚本评估结果。该框架与专家人工评估的吻合率达到90.54%,显示出高可靠性。我们在FrontendBench上对几种最先进的LLMs进行了基准测试,并观察到它们在处理现实世界前端任务时存在显著的性能差异。这些结果凸显了FrontendBench作为一个可靠且可扩展的基准,支持一致的多模态评估,并为未来前端代码生成研究提供了坚实基础。我们的数据和代码将很快发布。

英文摘要:

Large Language Models (LLMs) have made significant strides in front-end code generation. However, existing benchmarks exhibit several critical limitations: many tasks are overly simplistic, test cases often lack rigor, and end-to-end validation is absent. These issues hinder the accurate assessment of model performance. To address these challenges, we present FrontendBench, a benchmark co-developed by humans and LLMs. FrontendBench categorizes tasks based on code functionality and incorporates interactive test scenarios, enabling a more comprehensive and practical evaluation of front-end code generation capabilities. The benchmark comprises 148 meticulously crafted prompt-test case pairs spanning five levels of web components, from basic UI elements to complex interactive features. Each task reflects realistic front-end development challenges. Furthermore, we introduce an automatic evaluation framework that executes generated code within a sandbox environment and assesses outcomes using predefined test scripts. This framework achieves a 90.54% agreement rate with expert human evaluations, demonstrating high reliability. We benchmark several state-of-the-art LLMs on FrontendBench and observe substantial performance disparities in handling real-world front-end tasks. These results highlight FrontendBench as a reliable and scalable benchmark, supporting consistent multimodal evaluation and providing a robust foundation for future research in front-end code generation. Our data and code will be released soon.

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

↑