Source-linked AI summary

Zero-Shot Video Question Answering with Procedural Programs

Rohan Choudhury, Koichiro Niinuma, Kris M. Kitani, László A. Jeni

arXiv:2312.00937v1cs.CV

TL;DR

Answering video questions can require locating relevant frames before identifying details, motivating procedural reasoning for zero-shot video QA. ProViQ generates Python programs that compose visual modules, and reports improvements across diverse benchmarks, including a 25% gain on EgoSchema.

  • Problem

    Video questions can require finding relevant frames and then identifying an entity’s attributes, motivating procedural reasoning for zero-shot video question answering.

    Source: §1 · p. 1
  • Method

    ProViQ uses an LLM to generate Python programs that compose video modules to answer zero-shot queries and support tasks beyond question answering.

    Source: §1 · pp. 1–2, §3.2 · pp. 3–4
  • Results

    ProViQ reports improvements across zero-shot video QA benchmarks, including a 25% gain on the challenging EgoSchema benchmark.

    Source: §1 · p. 2, §4.2 · p. 6
  • Takeaways & Limitations

    ProViQ also supports query-based multi-object tracking and video editing without modifications to the method.

    Source: §1 · p. 2, §5 · p. 8

    On TVQA, ProViQ’s mistakes mostly occur during program generation, often because the LLM uses the wrong modality.

    Source: §4.4 · p. 8

Abstract

from arXiv · show

We propose to answer zero-shot questions about videos by generating short procedural programs that derive a final answer from solving a sequence of visual subtasks. We present Procedural Video Querying (ProViQ), which uses a large language model to generate such programs from an input question and an API of visual modules in the prompt, then executes them to obtain the output. Recent similar procedural approaches have proven successful for image question answering, but videos remain challenging: we provide ProViQ with modules intended for video understanding, allowing it to generalize to a wide variety of videos. This code generation framework additionally enables ProViQ to perform other video tasks in addition to question answering, such as multi-object tracking or basic video editing. ProViQ achieves state-of-the-art results on a diverse range of benchmarks, with improvements of up to 25% on short, long, open-ended, and multimodal video question-answering datasets. Our project page is at https://rccchoudhury.github.io/proviq2023.

1. Introduction

ProViQ addresses zero-shot video QA by using procedural reasoning: an LLM generates programs that compose visual modules to answer queries. The paper reports gains across video QA benchmarks and describes capabilities beyond question answering.

1. Introduction

  • Procedural decomposition is motivated by how people solve video questions through concrete steps, and the authors hypothesize it can improve zero-shot video QA.Existing zero-shot approaches are described as unable to carry out procedural reasoning explicitly; ViperGPT's image-centric approach was limited in generalizing to diverse video benchmarks.Source: §1 · p. 1
  • ProViQ uses an LLM to generate Python programs that break a video query into steps using an API of visual modules for detection, QA, retrieval, captioning, transcription, tracking, and summarization.The modules support reasoning over individual frames, clips, and whole videos.Source: §1 · pp. 1–2
  • The generated programs require no further training, expose module-level error attribution, and can compose modules for tasks such as query-based tracking and basic video editing.The paper also describes adding task-specific modules without fine-tuning.Source: §1 · p. 2
  • Up to 25% improvement is reported across six zero-shot QA benchmarks, with additional gains on EgoSchema and state-of-the-art performance on TVQA.The reported results include surpassing supervised state-of-the-art on some datasets.Source: §1 · p. 2

2. Related Work

Prior video QA methods largely rely on training with video data, while zero-shot approaches and code-generated modular reasoning each have limits. ProViQ builds on modular code generation and extends it to video with a broader visual API.

2.1. Video Question Answering

  • Video QA commonly relies on pretraining and fine-tuning, while zero-shot methods such as FrozenBiLM and transfer from image QA have limitations in training requirements or benchmark performance.Other video-conversation approaches using language models and visual inputs [24] [42] do not achieve strong quantitative results on standard benchmarks.Source: §2.1 · p. 2

2.2. Modular Vision

  • Modular VQA methods compose visual modules, but many train the layout and modules together or cannot freely compose them [59]; ProViQ extends code-generated modular reasoning to video.CodeVQA, VISPROG, and ViperGPT generate short Python programs, while ViperGPT's image-centric approach was limited in temporal reasoning and broader video experiments.Source: §2.2 · p. 2, Figure 2 · p. 3

2.3. Prompting and Tool Use

  • ProViQ uses pretrained visual components including GroundingDINO [29], BLIP-2 [23], LaViLa, GPT3.5, and ByteTrack within its program-generation framework.Prior multimodal language models such as Flamingo, GPT-4, LLAVA, X-GPT, and MiniGPT-4 [62] are described as not incorporating video successfully.Source: §2.3 · p. 3

3. Method

ProViQ prompts an LLM with a video query, examples, and a visual API, then executes the generated program. Its modules cover frame-, clip-, and narrative-level reasoning, with benchmark-specific prompting and answer handling.

3.1. Program Generation

  • The LLM receives the video query, a documented visual API, and example programs, then generates a short Python program that calls modules and is executed on the video to produce an answer or modified video.The input can include multiple-choice options and other relevant information.Source: §3.1 · p. 3

3.2. Video Modules

  • The API provides frame- and clip-level tools such as filtering frames, detecting objects, finding object crops, and voting over frame-wise QA answers; it also includes transcript, caption, tracking, and option-selection modules.The API is intended as a flexible toolbox for a wide range of questions, though it is not necessarily exhaustive.Source: §3.2 · pp. 3–4

3.3. Long Video Summarization

  • For long-video narrative questions, get summary applies a video-to-text model to one-second chunks and uses an LLM to aggregate timestamped captions into a paragraph with sentences describing five-second intervals.Its effectiveness depends on caption quality; the paper reports stronger suitability for EgoSchema because Ego4D provides dense annotated narrations.Source: Figure 3 · p. 4, §3.3 · p. 5

3.4. Prompting and Examples

  • Benchmark-specific example programs are selected for the query, with examples sampled from training splits to avoid evaluation contamination.Prompts for LLM-based modules such as choose option and get summary remain fixed, using static example inputs.Source: §3.4 · p. 5

3.5. Open-Ended and Multiple-Choice Benchmarks

  • Multiple-choice answers are constrained to listed options, while open-ended outputs are mapped to the closest FastText vocabulary answer and may be restricted by question category.The embedding-based mapping is performed outside program execution to reduce calls.Source: §3.5 · pp. 5–6
  • Table 1 reports state-of-the-art zero-shot accuracy gains of up to 26% on open-ended and multiple-choice benchmarks, with performance competitive with supervised methods.Table 2 reports a large gain over end-to-end models on the held-out zero-shot EgoSchema test split for long-video understanding.Source: Table 1 · p. 6, Table 2 · p. 6

4. Experiments

ProViQ improves results across zero-shot video QA benchmarks, supports tracking and basic editing, and its ablations examine modules, examples, and error sources.

4.1. Experimental Setup

  • Evaluation covers open-ended, multiple-choice, and long-video QA datasets, using top-1 test accuracy on the full test split unless otherwise stated.Source: §4.1 · p. 6

4.2. Zero-Shot Video QA Results

  • 23% on iVQA, 25% on TGIF-QA, and 25% on EgoSchema; Table 3 reports ProViQ surpassing the supervised state-of-the-art on NeXT-QA.The authors report gains on open-ended and multiple-choice benchmarks.Source: §4.2 · p. 6, Table 3 · p. 6

4.3. Additional Capabilities

  • Composing modules enables query-based multi-object tracking and basic editing, including tracking dancers across frames and removing clips that fail input criteria.Source: §4.3 · p. 7, Figure 5 · p. 7

4.4. Ablation Studies

  • Video querying avoids single-frame errors and accounts for most gains on shorter datasets, while filtering and object filtering particularly help on longer datasets.Find helps with counting and color questions in ActivityNet; captioning boosts NeXT-QA on causal questions. More modules can slightly reduce individual-dataset performance or produce invalid programs, but broaden benchmark generalization.Source: §4.4 · pp. 7–8
  • A single in-context example greatly improves performance over providing none; additional examples help with diminishing returns, and three to four worked well across benchmarks.Source: §4.4 · p. 8, Figure 6 · p. 8
  • Error sources vary by dataset: lower-quality open-ended sets show annotation or module errors, while TVQA errors often arise from program generation selecting the wrong modality.On iVQA, the word-matching embedding model can misclassify a correct program output during post-processing.Source: §4.4 · p. 8, Figure 7 · p. 8

5. Conclusions

The paper concludes that ProViQ extends modular vision methods to zero-shot video QA and reports improved performance and additional video capabilities.

  • ProViQ extends modular vision methods to zero-shot video question answering and improves over the state of the art using language-model temporal reasoning with code.Source: §5 · p. 8
  • The conclusion describes grounded tracking and text-based video editing as additional capabilities requiring no modifications to the method.Source: §5 · p. 8
  • The authors suggest procedural reasoning may improve performance on vision tasks more broadly and present ProViQ as a prospective video QA baseline.Source: §5 · p. 8

A. Implementation Details

Implementation uses a modified ViperGPT codebase, pretrained visual modules, and uniformly sampled video frames.

B.1. Datasets

The benchmarks span short and longer videos, open-ended and multiple-choice QA, and visual, narrative, and multimodal questions.

  • TGIF-QA, MSVD-QA, and MSRVTT-QA are open-ended benchmarks generated from captions with some manual annotations; their questions use one-word or phrase answers.Source: §B.1 · p. 12
  • iVQA uses instructional videos and multiple correct answers per question, while ActivityNet-QA covers videos up to three minutes and nine question categories.Source: §B.1 · p. 12
  • TVQA combines visual and narrative questions with scene transcripts, EgoSchema tests long-term understanding in three-minute videos, and NeXT-QA targets causal and temporal reasoning.TVQA and NeXT-QA each provide five answer choices; EgoSchema has a held-out test split and no training data.Source: §B.1 · p. 12

B.2. Metrics

The section explains why top-1 accuracy is retained for fair comparisons despite open-ended questions sometimes admitting multiple valid answers. It rejects LLM-based scoring as unreliable for answer accuracy.

B.2. Metrics

  • Top-1 accuracy is retained as the fairest comparison metric, while conversational-evaluation works are omitted from the analysis.The authors report that LLM-based evaluation often gives incorrect answer-accuracy judgments.Source: §B.2 · p. 12
  • Top-1 accuracy requires a single correct answer even when an open-ended question may have multiple valid answers.Source: §B.2 · p. 12
  • LLM-based evaluation compares generated text with a ground-truth answer and prompts GPT-3.5 for binary correctness and subjective conversational scores.Source: §B.2 · p. 12

B.3. Per-dataset Results

The section points readers to per-question-category QA result breakdowns across ActivityNet-QA, TGIF-QA, NeXT-QA, MSVD, and MSR-VTT.

B.3. Per-dataset Results

  • ActivityNet-QA results are broken down by question category in Table 5.Source: §B.3 · p. 12
  • Table 6 reports per-category results for TGIF-QA and NeXT-QA.Source: §B.3 · p. 12
  • Table 7 reports per-category results for MSVD and MSR-VTT QA.Source: §B.3 · p. 12

C. Additional Ablations

The ablations examine open-ended answer-vocabulary choices, while the prompt appendix documents dataset-specific APIs and examples.

C. Additional Ablations

  • The Word Matcher maps model outputs to the semantically nearest word or phrase in the output vocabulary, avoiding automatic errors for out-of-vocabulary predictions.FastText is used, though BERT or word2vec are possible alternatives.Source: C. Additional Ablations · p. 12
  • For open-ended benchmarks, the output vocabulary uses the 1,000 most common training answers and can be further constrained by question category.The method can dynamically alter this vocabulary without training.Source: C. Additional Ablations · p. 12
  • Vocabulary size matters most on lower-quality-label datasets, while its effect is minimal on TGIF and iVQA.Vocabulary restriction significantly boosts performance on poor-label, ambiguously phrased MSRVTT-QA.Source: Table 8 · p. 13, C. Additional Ablations · p. 13

D. Prompt

  • The prompt excludes methods not applicable to a dataset and appends dataset-specific in-context examples alongside the API prompt and query.Source: D. Prompt · p. 13
Loading 2312.00937v1…