Abstract
Visual Question Answering (VQA) requires multimodal processing and complex reasoning. While modular neurosymbolic systems offer high interpretability through declarative representations, the manual creation of reasoning rules remains a significant bottleneck. This paper presents a novel approach for declarative knowledge distillation from Large Language Models (LLMs). By prompting an LLM to extend an initial Answer-Set Programming (ASP) theory using VQA examples, we create an automated feedback loop for rule generation, validation, and mending. Our results on the CLEVR and GQA datasets demonstrate that LLMs can effectively serve as automated logic engineers, offering a promising alternative to purely data-driven rule learning.
Introduction
Visual Question Answering (VQA) is a cornerstone of multimodal AI, tasking systems with answering natural language questions about visual content. Current state-of-the-art solutions typically fall into two categories: end-to-end neural networks and neurosymbolic systems. While neural networks are powerful, they often operate as "black boxes," lacking transparency in their reasoning processes. Conversely, neurosymbolic systems use formal logic to provide interpretable results but rely heavily on human experts to hand-code complex logical rules, often in languages like Answer-Set Programming (ASP).
To address this scalability issue, we propose a framework that utilizes LLMs to automatically "distill" logical reasoning rules. This method bridges the gap between the flexibility of neural models and the transparency of symbolic reasoning by using LLMs as automated logic engineers.
Methodology: Declarative Knowledge Distillation
The core of our approach is a Declarative Knowledge Distillation framework. Instead of traditional end-to-end training, we leverage the latent structural knowledge within pre-trained LLMs (such as GPT-4) to generate and refine ASP rules through an iterative feedback loop.
As illustrated in the figure above, the process consists of several key stages:
- Preprompting: The LLM receives a system prompt defining the ASP syntax, scene representations (objects, attributes, and relations), and the reasoning objective.
- The Distillation Loop: When the system fails to answer a question, the LLM is provided with the scene data, the question, and the ground-truth answer. It is then prompted to suggest a new ASP rule.
- Automated Validation: New rules are processed by an ASP solver. If a syntax error occurs, the error message is fed back to the LLM for immediate correction. If the rule runs but yields an incorrect answer (a semantic error), the LLM is prompted to revise its logic.
- Regression Testing: To maintain system integrity, the framework re-tests previously successful examples to ensure new rules do not introduce regressions.
Experimental Setup and Datasets
We evaluated our framework on two prominent VQA benchmarks:
- CLEVR: A synthetic dataset featuring geometric shapes that requires multi-step compositional reasoning (e.g., identifying objects based on complex attribute combinations).
- GQA: A real-world dataset based on the Visual Genome, involving a vast vocabulary of objects and complex spatial relations, presenting a more significant challenge for automated rule generation.
Results and Discussion
Our experiments focused on the system's ability to "rediscover" essential reasoning rules (like select or filter) after they were intentionally removed from the theory.
As shown in the results tables, there is a significant performance gap between LLM versions. GPT-4 demonstrated a remarkable ability to restore system accuracy, often reaching 95-100% recovery for specific operations on the GQA dataset. In contrast, GPT-3.5 struggled with the strict requirements of ASP syntax and complex logic.
Key insights from our evaluation include:
- Interpretability by Design: The distilled output consists of human-readable logic rules, ensuring the system remains fully transparent and verifiable.
- The Necessity of Mending: The iterative feedback loop is critical. LLMs frequently produce "mostly correct" logic that requires the automated syntax and semantic checks to reach functional perfection.
- Zero-Shot Potential: Our GS-VQA system achieved 39.5% accuracy on GQA without any dataset-specific training, approaching the performance of some end-to-end models (like BLIP-2 at 44.7%) while maintaining full logical transparency.
Conclusion and Future Work
This research confirms that distilling declarative knowledge from LLMs is a viable path for building interpretable VQA systems. While the approach is sensitive to the underlying LLM's capabilities and can incur API costs, strategies like batching help mitigate these hurdles. Future work will explore combining this distillation method with Inductive Logic Programming (ILP) to create more robust hybrid systems and extending the framework to non-visual symbolic reasoning tasks.
Summary updated