Hostname: page-component-76d6cb85b7-2r2wp Total loading time: 0 Render date: 2026-07-19T09:23:43.982Z Has data issue: false hasContentIssue false

Explaining Neural Networks in Preference Learning: A Post Hoc Inductive Logic Programming Approach

Published online by Cambridge University Press:  29 June 2026

DANIELE FOSSEMÒ
Affiliation:
Department of Information Engineering, Computer Science and Mathematics, University of L’Aquila, Italy (e-mail: daniele.fossemo@graduate.univaq.it)
FILIPPO MIGNOSI
Affiliation:
Department of Information Engineering, Computer Science and Mathematics, University of L’Aquila, Italy (e-mail: filippo.mignosi@univaq.it)
GIUSEPPE PLACIDI
Affiliation:
Department of Life, Health and Environmental Sciences, University of L’Aquila, Italy (e-mail: giuseppe.placidi@univaq.it)
LUCA RAGGIOLI
Affiliation:
Department of Electrical Engineering and Information Technologies, University of Naples Federico II, Italy (e-mail: luca.raggioli@unina.it)
MATTEO SPEZIALETTI
Affiliation:
Department of Information Engineering, Computer Science and Mathematics, University of L’Aquila, Italy (e-mail: matteo.spezialetti@univaq.it)
FABIO AURELIO D’ASARO
Affiliation:
Department of Human Sciences, University of Verona, Italy (e-mail: fabioaurelio.dasaro@univr.it)
Rights & Permissions [Opens in a new window]

Abstract

In this paper, we propose using Learning from Answer Sets to approximate black-box models, such as Neural Networks (NN), in the specific case of learning user preferences. We specifically explore the use of ILASP (Inductive Learning of Answer Set Programs) to approximate preference learning systems through weak constraints. We have created a dataset on user preferences over a set of recipes, which is used to train the NNs that we aim to approximate with ILASP. Our experiments investigate ILASP both as a global and a local approximator of the NNs. These experiments address the challenge of approximating NNs working on increasingly high-dimensional feature spaces while achieving appropriate fidelity on the target model and limiting the increase in computational time. To handle this challenge, we propose a preprocessing step that exploits Principal Component Analysis to reduce the dataset’s dimensionality while keeping our explanations transparent.

Under consideration for publication in Theory and Practice of Logic Programming (TPLP).

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

Table 1. Recipes dataset features

Figure 1

Table 2. Survey structure

Figure 2

Fig. 1. Fig. 1 long description.Conceptual diagram of the overall approach, instantiating the approximation framework of Section 3. Given a dataset D$D$ and a pre-trained black box B:X→Y$B:X\to Y$ (in our case, a neural network), we first sample a training set Strain⊆X$S_{\text{train}} \subseteq X$ and a test set Stest⊆X$S_{\text{test}} \subseteq X$ uniformly at random from the feature space. These instances are then labeled with the corresponding black-box predictions B(Strain)$B(S_{\text{train}})$ and B(Stest)$B(S_{\text{test}})$, respectively. Dataset generation can follow either a global strategy (Figure 2a), where Strain$S_{\text{train}}$ and Stest$S_{\text{test}}$ are drawn from a task-relevant region Xrel⊆X$X_{\mathrm{rel}} \subseteq X$, or a local strategy (Figure 2b), where Strain$S_{\text{train}}$ is built by perturbing a neighborhood around specific query instances (cf. Definition of local explanation in Section 3). On these labeled data we optionally apply feature reduction via direct or indirect PCA (Section 5.1) to control the size of the ILASP search space. ILASP is then run on Strain$S_{\text{train}}$ with an appropriate language bias L$L$, producing a symbolic theory T$T$ consisting of weak constraints. At this stage we record the execution time and the length of the theory (i.e., the number of weak constraints in T$T$) as proxies for computational cost and complexity Ω(T)$\Omega (T)$. Finally, T$T$ is evaluated on Stest$S_{\text{test}}$ to obtain fidelity, precisionBB$_{BB}$ and recallBB$_{BB}$ with respect to B$B$, and on user ground truth (Section 5.3) to obtain accuracyGT$_{\textrm {GT}}$, precisionGT$_{\textrm {GT}}$ and recallGT$_{\textrm {GT}}$, thus jointly assessing approximation quality and human alignment.

Figure 3

Fig. 2. Generation of sampled datasets in the global (Figure 2a) and local (Figure 2b) approximation settings. In the global case, we sample N$N$ pairs (i1,i2)$(i_1, i_2)$ uniformly at random from the feature space X$X$ of ordered recipe pairs (cf. Section 3.1) to form Strain$S_{\text{train}}$, and we compute the corresponding labels B(i1,i2)$B(i_1,i_2)$ from the neural network B$B$, obtaining B(Strain)$B(S_{\text{train}})$. A disjoint test set Stest$S_{\text{test}}$ of size K$K$ is generated analogously. This realizes a global explanation in the sense of Section 3, with region A=Xrel⊆X$A = X_{\mathrm{rel}} \subseteq X$. In the local case, we first sample N$N$ query pairs Qn=(i1,i2)n$Q_n = (i_1,i_2)_n$ that we wish to explain. For each query Qn$Q_n$, we generate a local training set Strain(n)$S_{\text{train}}^{(n)}$ of M$M$ perturbed pairs (j1,j2)m=(i1,i2)n+Rm$(j_1,j_2)_m = (i_1,i_2)_n + R_m$ by adding Gaussian noise Rm$R_m$ to the feature representation of Qn$Q_n$ (Section 5.1.2). Each perturbed pair is labeled with B(j1,j2)m$B(j_1,j_2)_m$, and the original query Qn$Q_n$ together with its prediction B(Qn)$B(Q_n)$ is used as the corresponding test instance. This implements local explanations on metric balls Br(Qn)$B_r(Q_n)$ around each query, as in the formal definition of local approximation.

Figure 4

Fig. 3. Histogram of the absolute weights of the features for the first four principal components. When using indirect PCA, we select the features with weights in the ith$i^{th}$ PC that are to the right of the red line.

Figure 5

Fig. 4. Global fidelity, precision BB$_{\textrm {BB}}$, recall BB$_{\textrm {BB}}$, and execution time results for #maxp between 1$1$ and 5$5$, indirect PCA.

Figure 6

Table 3. ILASP as global approximator on training set of 45 pairs

Figure 7

Table 4. ILASP as global approximator on training set of 105 pairsTable 4 long description.

Figure 8

Table 5. ILASP as global approximator on training set of 190 pairs

Figure 9

Table 6. ILASP as classifier on preferences’ training set of 157 pairsTable 6 long description.

Figure 10

Table 7. ILASP as local approximator on training set of 45 pairs

Figure 11

Table 8. ILASP as local approximator on training set of 105 pairs

Figure 12

Table 9. ILASP as local approximator on training set of 190 pairs

Figure 13

Fig. 5. Fig. 5 long description.Execution time comparison for global approximation across No PCA, Indirect PCA, and Direct PCA. Indirect PCA preserves the exponential growth observed with No PCA, albeit at a reduced rate; Direct PCA instead exhibits an approximately linear scaling, with the slope decreasing as fewer principal components (PCs) are retained.

Figure 14

Table 10. ILASP as local approximator on training set of 105 pairs (std=0.1)

Figure 15

Table B1. Deep neural network obtained after the tuning of hyperparameters

Figure 16

Table C1. Recipes dataset features