用视觉反馈提升代码生成,让AI能自动修好网页界面错误。
ReLook: Vision-Grounded RL with a Multimodal LLM Critic for Agentic Web Coding
- 用多模态大模型当视觉评委,看截图评分并提具体修改建议。
- 严格零奖励规则确保生成的页面能正确渲染,避免欺骗性优化。
- 训练时严苛、推理时轻量,适合需要快速生成高质量网页的场景。
尽管大语言模型在算法代码生成上表现优异,但在前端开发中因正确性依赖渲染效果和交互而面临挑战。我们提出 ReLook,一个基于视觉感知的智能体强化学习框架,通过引入多模态大模型(MLLM)作为工具,实现生成-诊断-修正的闭环。训练阶段,该框架将 MLLM 作为视觉评判者,依据截图对代码打分,并提供具象化、视觉相关的改进建议;通过为无效渲染设定严格零奖励机制,确保代码可渲染性并防止奖励作弊。为防止行为退化,引入强制优化策略,仅接受性能提升的修改版本,保证轨迹单调改进。推理阶段,解耦批评者角色,采用轻量级无评审核心自修正循环,在保持与基础解码相近延迟的同时,保留大部分性能增益。在三个常用基准测试中,ReLook 持续优于强基线模型,验证了智能体感知、视觉奖励以及训练-推理解耦的优势。
原文摘要 · Abstract (English)
While Large Language Models (LLMs) excel at algorithmic code generation, they struggle with front-end development, where correctness is judged on rendered pixels and interaction. We present ReLook, an agentic, vision-grounded reinforcement learning framework that empowers an agent to close a robust generate--diagnose--refine loop by invoking a multimodal LLM (MLLM) as a tool. During training, the agent uses the MLLM-in-the-loop both as a visual critic--scoring code with screenshots--and as a source of actionable, vision-grounded feedback; a strict zero-reward rule for invalid renders anchors renderability and prevents reward hacking. To prevent behavioral collapse, we introduce Forced Optimization, a strict acceptance rule that admits only improving revisions, yielding monotonically better trajectories. At inference, we decouple the critic and run a lightweight, critic-free self-edit cycle, keeping latency comparable to base decoding while retaining most of the gains. Across three widely used benchmarks, ReLook consistently outperforms strong baselines in vision-grounded front-end code generation, highlighting the benefits of agentic perception, visual rewards, and training-inference decoupling.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。