Analyzing Modular Approaches for Visual Question Decomposition

Apoorv Khandelwal, Ellie Pavlick, Chen Sun

Abstract: Modular neural networks without additional training have recently been shown to surpass end-to-end neural networks on challenging vision–language tasks. The latest such methods simultaneously introduce LLM-based code generation to build programs and a number of skill-specific, task-oriented modules to execute them. In this paper, we focus on ViperGPT and ask where its additional performance comes from and how much is due to the (state-of-art, end-to-end) BLIP-2 model it subsumes vs. additional symbolic components. To do so, we conduct a controlled study (comparing end-to-end, modular, and prompting-based methods across several VQA benchmarks). We find that ViperGPT's reported gains over BLIP-2 can be attributed to its selection of task-specific modules, and when we run ViperGPT using a more task-agnostic selection of modules, these gains go away. ViperGPT retains much of its performance if we make prominent alterations to its selection of modules: e.g. removing or retaining only BLIP-2. We also compare ViperGPT against a prompting-based decomposition strategy and find that, on some benchmarks, modular approaches significantly benefit by representing subtasks with natural language, instead of code. Our code is fully available at https://github.com/brown-palm/visual-question-decomposition.

Introduction

In the domain of Vision-Language (VL) tasks, there has been a notable shift from monolithic end-to-end neural networks toward "modular" systems. These systems leverage Large Language Models (LLMs) to decompose complex visual questions into a series of sub-tasks or executable Python programs. While these modular systems, such as ViperGPT, report state-of-the-art results, they introduce significant complexity by combining powerful base models with intricate prompt engineering and task-specific module selection. This study investigates the true source of these performance gains: is it the modular architecture itself, the underlying base model, or the manual effort involved in task-specific configuration?

Methodology

We conduct a controlled study comparing three distinct families of approaches for visual question answering:

  1. End-to-end: We utilize BLIP-2, a state-of-the-art vision-language model, as our primary baseline.
  2. Modular (ViperGPT): This represents the code-generation paradigm. An LLM generates Python code that invokes various API-like modules (including BLIP-2) to resolve the query.
  3. Successive Prompting: We introduce a natural language decomposition method. Instead of generating code, an LLM (InstructGPT) generates a sequence of follow-up questions in plain English. These are answered by BLIP-2, and the LLM synthesizes the final answer from the accumulated information.
Architectural comparison of end-to-end, modular (ViperGPT), and successive prompting approaches.

To ensure a fair comparison, we also evaluate a "task-agnostic" version of ViperGPT. Unlike previous reports that hand-pick modules for specific datasets, our task-agnostic version uses a consistent set of modules across all benchmarks to avoid inflating performance through manual engineering.

Experimental Setup

The study evaluates these models across five diverse Visual Question Answering (VQA) benchmarks:

  • VQAv2: Standard benchmark for primitive vision skills like classification and counting.
  • GQA: Focuses on compositional questions and spatial reasoning.
  • OK-VQA: Requires external knowledge not present in the image.
  • A-OKVQA: A more challenging version of OK-VQA requiring common sense and physical reasoning.
  • ScienceQA: Scientific questions requiring multi-step reasoning and background knowledge.

Results and Discussion

The Task-Specific Engineering Gap

Our findings indicate that much of ViperGPT’s reported advantage over BLIP-2 disappears in a task-agnostic setting. When the system is not pre-configured for a specific dataset, its average gain over BLIP-2 drops significantly from +8.7% to -0.8%. This suggests that the perceived superiority of modular systems is often a byproduct of task-specific module selection rather than the modular architecture itself.

The Dominance of the Base Model

Ablation studies reveal that the BLIP-2 module is the primary driver of performance. Removing BLIP-2 causes performance to crater, while a configuration that retains only BLIP-2 as a module maintains approximately 95% of the system's task-agnostic performance. In many cases, ViperGPT simply generates code that calls the end-to-end VQA module directly, bypassing the intended modular decomposition.

Qualitative examples of question decomposition using code-based (ViperGPT) and natural language (Successive Prompting) strategies.

Natural Language vs. Code Decomposition

For complex reasoning tasks like A-OKVQA and ScienceQA, our "Successive Prompting" method outperformed the code-based ViperGPT. This suggests that the rigid logic of a programming language may be less effective than the flexible reasoning interface of natural language when orchestrating multiple models. Furthermore, modular systems are prone to runtime errors—up to 18% on out-of-distribution tasks like ScienceQA—where the LLM generates syntactically or logically invalid code.

Conclusion

While modular systems offer a promising path toward interpretable and flexible vision-language reasoning, their current success is heavily dependent on the strength of their underlying end-to-end components and manual task-specific tuning. Our results suggest that natural language prompting can be a more robust and effective decomposition strategy than code generation for complex reasoning. Future work should focus on enhancing the robustness of modular systems to out-of-distribution data and better integrating logical code structures with the flexibility of natural language reasoning.

Summary updated

BibTeX
@inproceedings{khandelwal2023analyzing,
  author = {Apoorv Khandelwal and Ellie Pavlick and Chen Sun},
  title = {{Analyzing Modular Approaches for Visual Question Decomposition}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=pk0OZZkYMP},
}
Figure