Pattern over Pixels: Measuring Pattern Completion Bias in Multimodal Code Generation

📄 arXiv: 2608.03691v1 📥 PDF

作者: Khai-Nguyen Nguyen, Oscar Chaparro, Antonio Mastropaolo

分类: cs.SE, cs.AI, cs.CV

发布日期: 2026-08-04

备注: 41st IEEE/ACM International Conference on Automated Software Engineering

DOI: 10.1145/3832783.3834443


💡 一句话要点

提出视觉模式完成偏差基准以提升多模态代码生成准确性

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 多模态代码生成 视觉模式偏差 用户界面设计 模型评估 深度学习

📋 核心要点

  1. 现有的多模态代码生成方法在处理重复的用户界面模式时,容易产生视觉上不正确的输出,影响准确性。
  2. 本文提出了一种新的基准测试方法,通过扰动重复模式中的局部元素,评估模型在恢复被遮蔽的宽度或字体大小时的表现。
  3. 实验结果显示,所有评估的MLLM在处理重复模式时均表现出显著偏差,平均准确率低于25%,揭示了模型的潜在失效模式。

📝 摘要(中文)

多模态大型语言模型(MLLMs)在将网页截图转换为前端代码的过程中,重复的用户界面模式可能导致模型产生视觉上不正确但模式一致的输出。本文测试了重复网页模式如何影响MLLM的准确性,提出了第一个视觉模式完成偏差基准。通过对30个网页的1440个截图进行评估,发现所有模型在重复基线下表现出强烈的偏差,卡片宽度和文本字体大小的平均偏差率分别达到69.78%和80.22%。尽管Codex-5.3表现最佳,但在文本处理上准确率仍下降至13.89%。噪声和细微扰动进一步增加了偏差率,研究结果揭示了多模态代码生成中的具体失效模式,并表明其严重性与视觉显著性密切相关。

🔬 方法详解

问题定义:本文旨在解决多模态大型语言模型在处理重复用户界面模式时的偏差问题,现有方法在此情境下的准确性显著下降,导致生成的代码不符合预期。

核心思路:通过引入视觉模式完成偏差基准,研究如何通过扰动重复模式中的局部元素来评估模型的恢复能力,从而揭示模型的偏差特征。

技术框架:研究基于30个网页构建了1440个评估截图,涵盖结构卡片和文本样式模式,采用标准和噪声叠加条件进行测试,评估五个前沿的多模态大型语言模型。

关键创新:提出了视觉模式完成偏差的基准测试,首次系统性地量化了模型在处理重复模式时的偏差程度,揭示了模型在面对视觉显著性时的失效模式。

关键设计:在实验中,采用了扰动特定元素的方式来测试模型的恢复能力,设置了多种噪声条件,并分析了模型的推理过程与偏差之间的关系。实验还表明,推理努力程度与偏差呈负相关。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,所有评估的多模态大型语言模型在处理卡片宽度和文本字体大小的扰动时,平均偏差率分别达到69.78%和80.22%。尽管Codex-5.3在卡片处理上表现最佳,准确率为68.61%,但在文本处理上降至13.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. Codex-5.3 performs best but still drops from 68.61% accuracy on cards to 13.89% on text, while Flash-3.0 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