TL;DR
Current multimodal LLMs struggle with complex, multi-step reasoning over collections of objects, such as finding the item with the lowest price or sugar content on a supermarket shelf. This paper introduces the Visual Set Program Synthesizer (VSPS), a neuro-symbolic framework that translates visual queries into executable symbolic programs, guided by a novel dense reward function called CASTER. This approach dramatically outperforms standard end-to-end models, boosting accuracy from 38.6% to 93.8% on a new 110k-image benchmark called Set-VQA.
What Problem Does This Paper Address?
While modern Multimodal Large Language Models (MLLMs) excel at basic object recognition, they frequently stumble on queries requiring explicit, set-based logical operations—such as filtering, sorting, comparing, and aggregating collections of items (e.g., "Which soda on the shelf contains the least sugar?").
Standard end-to-end models attempt to resolve these multi-step problems implicitly within a single black-box inference step, which often leads to brittle logical errors. Tool-augmented systems offer some help but still express their reasoning steps in unconstrained natural language, making it difficult to verify intermediate logic or diagnose precisely where a multi-step calculation went wrong.
Methods
The authors frame set-based visual reasoning as a Visual Program Synthesis problem. Instead of directly predicting an answer, the MLLM acts as a programmer, generating an executable symbolic program within a domain-specific language (DSL). This DSL includes core set operators such as FILTER, SELECT, COUNT, SORT, and MIN/MAX. A separate, deterministic execution engine then runs this program by grounding it via a perception stack (YOLO-World for object detection and PaddleOCR for text extraction) and an external knowledge base.
To train this synthesizer effectively without relying on sparse binary rewards (i.e., simply checking if the final answer is right or wrong), the authors introduce CASTER (Compositional Actor-Set Theoretic Reward):
- AST Parsing: Both the generated program and the ground-truth program are parsed into Abstract Syntax Trees (ASTs), where each node represents a sub-program.
- Semantic Grounding: The execution engine runs each sub-program node to produce intermediate sets of visually grounded object identifiers.
- Optimal Alignment: The similarity between generated and ground-truth nodes is calculated using the Jaccard Index of their resulting object sets. The framework then applies the Hungarian algorithm to solve a maximum weight bipartite matching problem across the trees.
This provides a dense, semantics-aware reward signal that gives partial credit for partially correct code structures and handles logically equivalent variations gracefully. The policy is optimized using Group Relative Policy Optimization (GRPO).
Datasets
The paper evaluates its approach across three distinct benchmarks:
- Set-VQA (New): The primary benchmark introduced in this paper, consisting of 110k images (60k synthetic, 50k real-world egocentric photos of store shelves, desktops, etc.) paired with complex set-based queries, ground-truth programs, and final answers.
- GQA-Set: A challenging test split of 5,000 questions adapted from the GQA dataset to assess generalization to new visual domains and scene graphs.
- PTR-Count: A test split of 3,000 samples from the Part-based visual reasoning (PTR) dataset, focusing on counting object parts in 3D space.
Key Insights and Ideas
- Paradigm Over Scale: The choice of the underlying language model matters far less than the reasoning paradigm itself. Moving from black-box end-to-end inference to explicit program synthesis is the primary driver of performance, allowing a 7B model to vastly outperform a 72B model.
- Semantic vs. Syntactic Matching: Rewarding models based on the semantic outputs of intermediate code blocks (the actual sets of objects they resolve) rather than strict string matching allows the system to recognize logically equivalent but structurally unique programs.
- Shifting Bottlenecks: Fine-grained error analysis revealed that CASTER effectively "solved" the logical composition challenge. The remaining errors are largely perceptual, shifting the primary bottleneck of visual AI assistants from reasoning logic back to basic perception (like OCR accuracy).
Key Results
- Massive Accuracy Gains: On the Set-VQA benchmark, CASTER-Qwen achieved a 93.8% Final Answer Accuracy (AA), completely blowing away the strongest monolithic end-to-end baseline, Qwen2.5-VL-72B, which scored just 38.6% AA.
- Logic, Not Information: Even when end-to-end models were given the exact same external knowledge directly inside their text prompts, their performance only improved modestly (up to 42.1% AA), proving that their failure mode is a lack of compositional logic, not a lack of data.
- Compositional Generalization: When tested on a "Compositional-Split" featuring completely unseen, deeply nested program structures, CASTER maintained an impressive answer accuracy of ~88%, whereas standard end-to-end architectures suffered near-absolute failure (e.g., Qwen2.5-VL-72B dropped to 9.8% on unseen comparative tasks).
Limitations and Future Work
While the framework drastically reduces the "logic gap" (down to 4.9%), it remains fundamentally bounded by the performance of its underlying perception stack. A small but persistent "perception gap" (1.3% overall, rising to 3.1% on text-heavy filters) highlights that highly cluttered environments and small text labels still pose a challenge for current open-vocabulary detectors and OCR modules. The authors note that future work should focus directly on upgrading these underlying visual detectors and text extraction tools to build even more robust multi-modal systems.
Summary updated