ViUniT: Visual Unit Tests for More Robust Visual Programming
Not on the map. Why?
Abstract (arXiv)
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%.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 52 of its 60 references that are in the map. First posted on arXiv 12 Dec 2024.
Builds on
52 of 60 references.
References · 52
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Visual Instruction Tuningcited by 7,869
- 2023BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Modelscited by 6,137
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
38 more
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2023Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detectioncited by 3,332
- 2023Mistral 7Bcited by 3,164
- 2023InstructBLIP: Towards General-purpose Vision-Language Models with Instruction Tuningcited by 2,876
- 2016Making the V in VQA Matter: Elevating the Role of Image Understanding in Visual Question Answeringcited by 2,516
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2019Towards VQA Models That Can Readcited by 1,718
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2023PaLM 2 Technical Reportcited by 1,162
- 2019OK-VQA: A Visual Question Answering Benchmark Requiring External Knowledgecited by 1,121
- 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 739
- 2023CogAgent: A Visual Language Model for GUI Agentscited by 704
- 2023ViperGPT: Visual Inference via Python Execution for Reasoningcited by 603
- 2022Winoground: Probing Vision and Language Models for Visio-Linguistic Compositionalitycited by 529
- 2023MM-REACT: Prompting ChatGPT for Multimodal Reasoning and Actioncited by 517
- 2022Visual Programming: Compositional visual reasoning without trainingcited by 516
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2023Chameleon: Plug-and-Play Compositional Reasoning with Large Language Modelscited by 356
- 2021An Empirical Study of GPT-3 for Few-Shot Knowledge-Based VQAcited by 301
- 2023LLM-grounded Diffusion: Enhancing Prompt Understanding of Text-to-Image Diffusion Models with Large Language Modelscited by 243
- 2023SugarCrepe: Fixing Hackable Benchmarks for Vision-Language Compositionalitycited by 243
- 2024CodeGemma: Open Code Models Based on Gemmacited by 150
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 99
- 2024Editable Scene Simulation for Autonomous Driving via Collaborative LLM-Agentscited by 91
- 2023X-InstructBLIP: A Framework for aligning X-Modal instruction-aware representations to LLMs and Emergent Cross-modal Reasoningcited by 80
- 2023PanGu-Coder2: Boosting Large Language Models for Code with Ranking Feedbackcited by 69
- 2023Visual Program Distillation: Distilling Tools and Programmatic Reasoning into Vision-Language Modelscited by 66
- 2023CLOVA: A Closed-Loop Visual Assistant with Tool Usage and Updatecited by 43
- 2023Goodhart's Law in Reinforcement Learningcited by 41
- 2023A3Test: Assertion-Augmented Automated Test Case Generationcited by 33
- 2024Synthesize Step-by-Step: Tools, Templates and LLMs as Data Generators for Reasoning-Based Chart VQAcited by 19
- 2024Towards Truly Zero-shot Compositional Visual Reasoning with LLMs as Programmerscited by 14
- 2023XGen-7B Technical Reportcited by 12
- 2024Self-Training Large Language Models for Improved Visual Program Synthesis With Visual Reinforcementcited by 12
- 2023Recursive Visual Programmingcited by 6
- 2024Image Translation as Diffusion Visual Programmerscited by 5
50 most cited of 52 All 52 (JSON)
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025Explain Before You Answer: A Survey on Compositional Visual Reasoningcited by 28
- 2026Staying VIGILant: Mitigating Visual Laziness via Counterfactual Visual Alignment in MLLMscited by 8
- 2026Tool-IQA: Augmenting Image Quality Assessment with Simple Toolscited by 1
- 2026VETR: Execution-Grounded Self-Improving Agent for Symbolic Graphics Reasoningcited by 0
- 2026VETR: Execution-Grounded Self-Improving Agent for Symbolic Graphics Reasoning9 Oct 2026
- 2026Staying VIGILant: Mitigating Visual Laziness via Counterfactual Visual Alignment in MLLMs24 Jun 2026
- 2026Tool-IQA: Augmenting Image Quality Assessment with Simple Tools15 Jun 2026
- 2025Explain Before You Answer: A Survey on Compositional Visual Reasoning24 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2025CodeV: Code with Images for Faithful Visual Reasoning via Tool-Aware Policy Optimization
- 2026TACIT Benchmark: A Programmatic Visual Reasoning Benchmark for Generative and Discriminative Models
- 2026VisualCoding: Learning Executable Skills for Reliable Visual Reasoning
- 2026Visual Set Program Synthesizer
- 2024VDebugger: Harnessing Execution Feedback for Debugging Visual Programs
- 2026VBVR-Pro: A Scalable and Verifiable Suite for Native Visual Reasoning
- 2025V-REX: Benchmarking Exploratory Visual Reasoning via Chain-of-Questions
- 2025VisualSphinx: Large-Scale Synthetic Vision Logic Puzzles for RL