一句话:首次构建视觉模式补全偏差基准,揭示多模态代码生成模型强烈偏向重复 UI 模式而忽略局部异常。
多模态大语言模型常用于从网页截图生成前端代码,但重复 UI 模式可能使其输出视觉错误却模式一致的结果。本文在 screenshot-to-code 填空任务上测量该偏差,并构建首个视觉模式补全偏差基准:扰动重复模式中的一个局部元素,要求模型从截图和 HTML 上下文恢复被掩码的 width 或 font-size。基于 Design2Code 的 30 个网页,生成 1,440 个截图,覆盖卡片与文本样式及噪声条件。评估五个前沿 MLLM 显示,所有模型均强烈偏向重复基线:卡片宽度与文本字号的偏差率分别达 69.78% 和 80.22%,平均准确率仅 21.17% 和 7.89%。噪声、细微扰动和边界位置加剧偏差;推理努力越高偏差越低,但模型仍可能识别异常后选择模式一致答案。该工作揭示了多模态代码生成的具体失败模式,其严重程度与视觉显著性密切相关。
Multimodal large language models (MLLMs) are increasingly used to translate webpage screenshots into front-end code, but repeated UI patterns may sway them toward visually incorrect yet pattern-consistent outputs. In this work, we test how repeated webpage patterns hurt MLLM accuracy on an objective screenshot-to-code fill-in-the-blank task. We introduce the first benchmark for visual pattern-completion bias, where one localized element in a repeated UI pattern is perturbed and the model must recover the masked width or font-size value from the screenshot and HTML context. Starting from 30 webpages curated from the Design2Code dataset, we build 1,440 evaluated screenshots spanning structural card and text-style patterns under standard and noise-overlaid conditions. We evaluate five frontier MLLMs and find that all are strongly biased toward the repeated baseline. Mean bias rate reaches 69.78% on card-width perturbations and 80.22% on text font-size perturbations, while mean accuracy is only 21.17% and 7.89%, respectively. performs best but still drops from 68.61% accuracy on cards to 13.89% on text, while reaches 96.11% bias on text. Noise, subtler perturbations, and boundary positions further increase bias rate. Reasoning analysis further shows that greater reasoning effort correlates with lower bias, yet qualitative evidence reveals that models can identify the anomalous element and still override it with the pattern-consistent answer. Our results identify a concrete failure mode in multimodal code generation and show that its severity is strongly associated with visual saliency.