arXiv:2412.08859cs.CV2024-12CVPR被引 4

用视觉单元测试提升视觉编程模型的可靠性。

ViUniT: Visual Unit Tests for More Robust Visual Programming

  • 通过生成图像与答案对,自动验证视觉程序逻辑正确性。
  • 使模型性能提升11.4%,错误理由问题减少40%。
  • 适合需要高可靠性的视觉推理系统开发者使用。

基于编程的方法显著扩展了模型回答视觉场景问题的能力。然而,在基准视觉推理数据集上,当模型答对时,其生成的程序有33%是错误的,常因错误原因而正确,新数据上易出现意外失败。单元测试在代码正确性保障中起基础作用,可用来修复此类问题。我们提出视觉单元测试(ViUniT)框架,通过自动生成单元测试来提升视觉程序的可靠性。在该框架中,单元测试以新颖的图像与答案对形式表示,用于验证给定查询所生成程序的逻辑正确性。方法利用语言模型生成图像描述与预期答案,并通过图像合成生成对应图像。我们全面分析了有效视觉单元测试套件的构成,探索了测试生成、采样策略、图像生成方法及程序与测试数量变化的影响。此外,引入四种应用:最优程序选择、答案拒绝、重提示和强化学习的无监督奖励设计。在两个模型、三个数据集上的实验表明,ViUniT使模型性能提升11.4%。显著地,7B开源模型平均优于gpt-4o-mini 7.7%,且将‘正确但理由错误’的程序发生率降低40%。

原文摘要 · Abstract (English)

Programming based approaches to reasoning tasks have substantially expanded the types of questions models can answer about visual scenes. Yet on benchmark visual reasoning data, when models answer correctly, they produce incorrect programs 33% of the time. These models are often right for the wrong reasons and risk unexpected failures on new data. Unit tests play a foundational role in ensuring code correctness and could be used to repair such failures. We propose Visual Unit Testing (ViUniT), a framework to improve the reliability of visual programs by automatically generating unit tests. In our framework, a unit test is represented as a novel image and answer pair meant to verify the logical correctness of a program produced for a given query. Our method leverages a language model to create unit tests in the form of image descriptions and expected answers and image synthesis to produce corresponding images. We conduct a comprehensive analysis of what constitutes an effective visual unit test suite, exploring unit test generation, sampling strategies, image generation methods, and varying the number of programs and unit tests. Additionally, we introduce four applications of visual unit tests: best program selection, answer refusal, re-prompting, and unsupervised reward formulations for reinforcement learning. Experiments with two models across three datasets in visual question answering and image-text matching demonstrate that ViUniT improves model performance by 11.4%. Notably, it enables 7B open-source models to outperform gpt-4o-mini by an average of 7.7% and reduces the occurrence of programs that are correct for the wrong reasons by 40%.

视觉编程单元测试模型可靠性生成式AI

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。