评测大模型生成网页自动化脚本的能力,发现主流模型虽能完成简单任务,但复杂流程仍失败。
MacroBench: A Novel Testbed for Web Automation Scripts via Large Language Models
- 基于真实网页构建7个自托管站点,覆盖681项任务,用HTML/DOM与Selenium评估生成代码
- GPT-4o-mini成功率96.8%,但复杂工作流全失败,无模型符合生产级编码规范
- 提供完整可复现的评估框架,适合研究自动化生成与LLM安全性的团队使用
我们提出MacroBench,一个以代码为核心的基准测试,评估大语言模型是否能从自然语言目标出发,通过阅读HTML/DOM并输出Selenium代码,生成可复用的浏览器自动化程序(宏)。MacroBench包含7个自托管网站,覆盖681项任务,涵盖交互复杂度与目标难度。我们的端到端评估协议通过静态检查、沙箱执行和结果验证(DOM断言、数据库快照)来验证生成代码,并配备安全套件,应对爬取、垃圾信息、滥用及凭据/隐私提示。在2,636次模型-任务运行中,观察到分层成功率:GPT-4o-mini(96.8%)、GPT-4o(95.3%)、Gemini(89.0%)、DeepSeek(83.4%)。模型对简单任务表现可靠(91.7%),但在复杂工作流中完全失败(0.0%),且尽管功能完成,无一模型符合生产质量编码实践。我们已将完整基准管道、评估框架与实验结果开源至https://github.com/hyunjun1121/MacroBench,支持可复现的宏生成评估。
原文摘要 · Abstract (English)
We introduce MacroBench, a code-first benchmark that evaluates whether LLMs can synthesize reusable browser-automation programs (macros) from natural-language goals by reading HTML/DOM and emitting Selenium. MacroBench instantiates seven self-hosted sites covering 681 tasks across interaction complexity and targeting difficulty. Our end-to-end protocol validates generated code via static checks, sandboxed execution, and outcome verification (DOM assertions, database snapshots), and includes a safety suite for scraping, spam/abuse, and credential/privacy prompts. Across 2,636 model-task runs, we observe stratified success: GPT-4o-mini (96.8%), GPT-4o (95.3%), Gemini (89.0%), DeepSeek (83.4%). Models handle simple tasks reliably (91.7%) but fail on complex workflows (0.0%), and none meet production-quality coding practices despite functional completion. We release our complete benchmark pipeline, evaluation framework, and experimental results at https://github.com/hyunjun1121/MacroBench to enable reproducible assessment of macro synthesis for web automation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。