NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

An Empirical Study of GPT-3 for Few-Shot Knowledge-Based VQA

Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, Lijuan Wang

Introduction

Standard Visual Question Answering (VQA) systems have historically excelled at identifying objects and spatial relationships within an image. However, they often falter when faced with questions that require external knowledge not present in the pixels themselves—such as identifying the warmest temperature at which snow can occur. This sub-field, known as Knowledge-Based VQA, has traditionally relied on complex pipelines that query external databases.

In this study, researchers from Microsoft introduce PICa (Prompting GPT-3 via Image Captions), a method that treats GPT-3 as an implicit, unstructured knowledge base. By converting visual information into textual descriptions, PICa enables GPT-3 to perform knowledge-based reasoning in a few-shot setting, achieving state-of-the-art results without the need for extensive supervised training or explicit database retrieval.

The Challenge of Knowledge-Based VQA

Previously, the standard approach to knowledge-based VQA involved a rigid two-step pipeline. First, a system would retrieve facts from structured external databases like Wikipedia or ConceptNet. Second, a reasoning module would attempt to fuse these facts with visual features to predict an answer.

Comparison between traditional explicit knowledge retrieval and the PICa approach using implicit knowledge in GPT-3.

As illustrated in Figure 1, this "separate retrieval and reasoning" paradigm suffers from significant friction. The retrieval step is often noisy, and the process of "re-embedding" textual facts into a visual model's feature space can lead to a loss of semantic nuance. Furthermore, these models typically require massive amounts of supervised data to learn how to integrate these disparate information sources effectively.

Methodology: Prompting GPT-3 via Image Captions

The PICa framework bypasses the need for an external database by leveraging the vast implicit knowledge already stored within GPT-3. Because GPT-3 is a language-only model, the primary challenge is bridging the visual gap. PICa achieves this through a multi-stage pipeline:

  1. Image-to-Text Conversion: The system uses a state-of-the-art captioning model (VinVL) and object-tagging APIs to translate the image into a descriptive textual summary. This distills the visual scene into high-level concepts (e.g., "umbrellas," "snowing," "parking lot") that a language model can process.
  2. In-Context Example Selection: To guide GPT-3, the prompt includes several "in-context examples" consisting of image descriptions and question-answer pairs. To maximize relevance, PICa uses CLIP to select examples from the training set that are visually and semantically similar to the target test case.
  3. Few-Shot Prompting: A structured prompt is constructed, containing a prompt head (instructions), the selected in-context examples, and finally the description and question for the target image.
Detailed overview of the PICa prompting mechanism, including in-context example selection and the final query structure.

Figure 2 demonstrates how the "frozen" GPT-3 model processes this input. To further improve robustness, PICa employs a Multi-Query Ensemble strategy, querying the model multiple times with different example sets and selecting the best answer based on output log-probabilities.

Key Results and Insights

The researchers evaluated PICa on the OK-VQA dataset, the primary benchmark for knowledge-based VQA. Despite using only 16 in-context examples, PICa achieved 48.0% accuracy, a significant improvement over the previous supervised state-of-the-art (MAVEx), which reached 39.4%. This +8.6 point gain was achieved without any parameter updates to the core GPT-3 model.

On the broader VQAv2 dataset, which focuses on general image content, PICa reached 56.1%. While this outperforms other few-shot multimodal models like Frozen (38.2%), it still trails behind fully supervised models (73.8%). This gap highlights a critical limitation: the Information Bottleneck. When an image is abstracted into a short text string, fine-grained visual details—such as the exact count of small objects or specific textures—are often lost.

Conclusion and Future Work

PICa demonstrates that for knowledge-heavy tasks, text can be a sufficient abstraction of visual data. By treating GPT-3 as an implicit knowledge base, the researchers have shown that few-shot learning can outperform specialized, heavily supervised systems. Future work will likely focus on developing denser image descriptions to mitigate information loss and exploring end-to-end vision-language models that can retain GPT-3's reasoning power without the intermediate text bottleneck.

Summary updated

BibTeX
@inproceedings{yang2022empirical,
  author = {Zhengyuan Yang and Zhe Gan and Jianfeng Wang and Xiaowei Hu and Yumao Lu and Zicheng Liu and Lijuan Wang},
  title = {{An Empirical Study of GPT-3 for Few-Shot Knowledge-Based VQA}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i3.20215},
}
Figure