Hostname: page-component-74656f9884-p6fvt Total loading time: 0 Render date: 2026-11-03T21:04:49.666Z Has data issue: false hasContentIssue false

Distilling Answer-Set Programming Rules from LLMs for Neurosymbolic Visual Question Answering

Published online by Cambridge University Press:  31 July 2026

NELSON HIGUERA RUIZ
Affiliation:
Technische Universität Wien, Austria (e-mail: nelson.ruiz@tuwien.ac.at)
JOHANNES OETSCH
Affiliation:
Jönköping University, Sweden (e-mail: johannes.oetsch@gmail.com)
THOMAS EITER
Affiliation:
Institute of Logic and Computation, Technische Universität Wien, Austria (e-mail: eiter@kr.tuwien.ac.at)
Rights & Permissions [Opens in a new window]

Abstract

Visual Question Answering (VQA) is the task of answering questions about images, requiring the integration of multimodal input and reasoning. Modular approaches that incorporate logic-based representations into the reasoning component offer clear advantages over end-to-end trained systems, particularly in terms of interpretability. However, adapting or extending these representations when task requirements change can place a significant burden on developers. To address this challenge, we present an approach for distilling rules from Large Language Models (LLMs). Our method prompts an LLM to extend an initial VQA reasoning theory, expressed as an answer-set program, to meet new requirements of the task. Examples from VQA datasets guide the LLM, validate the results, and help correct erroneous rules by leveraging feedback from the ASP solver. We demonstrate that our approach is effective across diverse VQA datasets. Notably, only a few examples are needed to elicit correct rules from LLMs. Our experiments suggest that rule distillation from LLMs is a promising alternative to traditional data-driven rule learning approaches. Under consideration in Theory and Practice of Logic Programming.1

Information

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2026. Published by Cambridge University Press
Figure 0

Fig. 1. Example scenes and questions from GQA (a), CLEVR (b), and CLEGRV$\mbox{CLEGR}^V$ (c).

Figure 1

Fig. 2. Generic Neurosymbolic VQA pipeline with three main components: (i) vision module, (ii) language module and (iii) reasoning module. Our distillation method operates on the symbolic representations of scenes and questions, ASP theory, as well as the ground-truth answers to the questions.

Figure 2

Algorithm 1 Rule distillation from LLMs.Algorithm 1 long description.

Figure 3

Table 1. Restoring the initial theory T$\mathrm{T}$ of GQA after removing all rules mentioning predicate P$P$Table 1 long description.

Figure 4

Table 2. Restoring the initial theory T$\mathrm{T}$ of CLEVR after removing all rules mentioning predicate P$P$Table 2 long description.

Figure 5

Table 3. Restoring the initial theory T$\mathrm{T}$ of CLEGRV$\mbox{CLEGR}^V$ after removing all rules mentioning predicate P$P$Table 3 long description.

Figure 6

Table 4. Average number of examples used by model and datasetTable 4 long description.

Figure 7

Table 5. Average and standard deviation token usage per dataset and modelTable 5 long description.

Figure 8

Table 6. Average accuracy by model and ablation condition. For each dataset, best configuration per model is in bold, best model under full configuration is underscoredTable 6 long description.

Figure 9

Table 7. Distillation for producing new predicates removing all rules mentioning predicate P$P$. Best average accuracy per predicate in boldTable 7 long description.

Figure 10

Algorithm 2 Rule redundancy elimination.Algorithm 2 long description.

Figure 11

Fig. 3. Average number of rules pruned for each predicate across different models on the GQA, CLEVR, and CLEGRV$\mbox{CLEGR}^V$ datasets.