# Learning Analogical Proportions with a Lightweight Neural Network

Stergos Afantenos, Emiliano Lorini, Van-Duy Ngo

► To cite this version:

Stergos Afantenos, Emiliano Lorini, Van-Duy Ngo. Learning Analogical Proportions with a Lightweight Neural Network. ECAI Workshop: Artificial Intelligence and Cognition (AIC 25), ECAI, Oct 2025, Bologna, Italy. hal-05492349

HAL Id: hal-05492349

https://hal.science/hal-05492349v1

Submitted on 4 Feb 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# Learning Analogical Proportions with a Lightweight Neural Network

Stergos Afantenos<fnref n="1" />, Emiliano Lorini<fnref n="2" /> and Van Duy Ngo<fnref n="1" />

**Abstract**

Analogical reasoning is often associated with statements of the form $\alpha : \beta :: \gamma : \delta$ that reads "$\alpha$ is to $\beta$ as $\gamma$ is to $\delta$". These are also called analogical proportions. In this paper, we view the elements of an analogical proportion as complete terms representing facts. We instantiate analogical proportions in a concrete perceptive scenario consisting of 4-cell images, the cell containing a shape along with a colour for the shape. We automatically generate a dataset of valid/invalid instances of analogical proportions for this scenario. We use this dataset to train a simple artificial neural network (ANN) to act as an evaluator. Our frugal models suggest that the evaluation of analogical proportions using machine learning models can be done with a competitive performance without resource-intensive architectures. We compare the performance of our ANN-based model with that of a state-of-the-art Large Language Model.

**Keywords**

analogy, analogical proportion, learning

## 1. Introduction

Analogies have initially been introduced in the works of Aristotle [1], although more philosophers in Ancient Greece, such as Theon of Smyrna, have also written about them. In recent years analogies have gained the attention of many researchers and have even been characterised as being “the core of cognition” [2]. Although such a strong stance might not be shared by all researchers, analogies have sparkled a new interest in the last fifteen or so years, especially after the works of Mikolov et al. and more recent advances in Large Language Models (LLMs). Although there is no consensus on how to model the phenomenon of analogies, a significant amount of work [4, 5, 6, 7, 8, 9, 10, 11] conceives analogies as statements of the form $\alpha : \beta :: \gamma : \delta$, which reads “$\alpha$ is to $\beta$ as $\gamma$ is to $\delta$”, with $\alpha, \beta, \gamma, \delta$ denoting logical formulas, concepts, or, more generally, multi-dimensional vectors. These are generally called analogical proportions.

In this paper, we focus on analogical proportions between vectors of binary (or Boolean) features. As shown in [12], these vectors can be viewed as complete terms in the sense of propositional logic—that is, conjunctions of literals in which each atomic proposition appears exactly once, either as a positive or a negative literal. Following [13], we consider a difference-based interpretation of the notion of analogical proportion. Roughly speaking, according to the difference-based interpretation, an analogical proportion of the form $\alpha : \beta :: \gamma : \delta$ means that “$\alpha$ differs from $\beta$ as $\gamma$ differs from $\delta$,” and “$\beta$ differs from $\alpha$ as $\delta$ differs from $\gamma$”. As shown in [13], this definition satisfies the following three properties, which are commonly considered rationality postulates for analogical proportion: *reflexivity* ($\alpha : \beta :: \alpha : \beta$), *symmetry* ($\alpha : \beta :: \gamma : \delta \Rightarrow \gamma : \delta :: \alpha : \beta$), and *central permutation* ($\alpha : \beta :: \gamma : \delta \Rightarrow \alpha : \gamma :: \beta : \delta$).

The aim of this paper is to investigate whether a simple artificial neural network (ANN) can learn such difference-based notion of analogical proportion, and to what extent. Additionally, we compare the performance of a simple, custom-built ANN with that of a large language model (LLM) in recognising valid analogical proportions, that is, proportions that hold under the difference-based interpretation.

AIC 2025: The 10th International Workshop on Artificial Intelligence and Cognition (held as part of ECAI 2025). October 25-26, 2025. Bologna, Italy

<figure><img src="image_2.png" /></figure>

stergos.afantenos@irit.fr (S. Afantenos); emiliano.lorini@irit.fr (E. Lorini); van-duy.ngo@irit.fr (V. D. Ngo)

<figure><img src="image_3.png" /></figure>

© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).

<footnote n="1">¹IRIT, University of Toulouse, France</footnote>

<footnote n="2">²IRIT, CNRS, University of Toulouse, France</footnote>
To carry out our empirical analysis, we focus on what can be described as a micro-domain of image transformations [14, 15], where each image is represented as a grid of cells containing shapes of various types and colours. Within this framework, we examine analogical proportions between such images.

We construct both propositional logic and corresponding vector representations of analogical proportion instances. Using these vectorial forms, we automatically generate a dataset comprising valid and invalid instances of analogical proportions. This dataset is then used to train a simple multi-layer perceptron to distinguish between valid and invalid analogical proportion instances. Our results show that this simple model learns efficiently, quickly achieving a high level of accuracy.

We further compare our model's performance to that of a Large Language Model (LLM) in a zero-shot setting. Specifically, we provide the LLM with both natural language descriptions and vector representations of analogical proportion instances, asking it to determine—via a yes/no response—whether it considers the instances to be valid. We tested the Instruct version of LLaMA with 8 billion parameters. In all tested datasets and prompt configurations, the LLM performed significantly worse than our simple artificial neural network.

The paper is structured as follows. Section 2 outlines the theoretical foundations of the difference-based interpretation of analogical proportion. Section 3 introduces the perceptual task of identifying analogical proportions between images. In Section 4, we describe the neural network architecture and the training methodology. Section 5 presents our experimental results, and Section 6 compares the performance of our lightweight ANN-based approach with that of an LLM-based method. Finally, Section 7 concludes the paper with a discussion of directions for future research.

## 2. Background

As pointed out in the introduction, we consider analogical proportions between complete terms. A complete term can be represented as a subset $\alpha$ of atomic propositions from a set of atomic propositions $\mathbb{P}$. The atomic propositions in $\alpha$ are the true ones (the positive literals), those in $\mathbb{P} \setminus \alpha$ are the false ones (the negative literals). For example, suppose $\mathbb{P} = \{p, q, r\}$. Then, the subset $\{p, q\}$ corresponds to the complete term $p \land q \land \neg r$.

Given four terms $\alpha, \beta, \gamma, \delta \subseteq \mathbb{P}$, we say that “$\alpha$ is to $\beta$ as $\gamma$ is to $\delta$”, denoted $\alpha : \beta :: \gamma : \delta$, if

$$ \beta \setminus \alpha = \delta \setminus \gamma \text{ and } \alpha \setminus \beta = \gamma \setminus \delta \qquad (1) $$

As demonstrated in [12], this difference-based definition of analogical proportion between complete terms is equivalent to a formulation based on the concepts of "fore" and "back" transformations. In particular, $\alpha : \beta :: \gamma : \delta$ holds if

$$ \exists \mathbf{f}_1, \mathbf{t}_1, \mathbf{f}_2, \mathbf{t}_2 \subseteq \mathbb{P} \text{ such that } \alpha \xrightarrow{\mathbf{f}_1, \mathbf{t}_1} \beta, \gamma \xrightarrow{\mathbf{f}_1, \mathbf{t}_1} \delta, \beta \xrightarrow{\mathbf{f}_2, \mathbf{t}_2} \alpha \text{ and } \delta \xrightarrow{\mathbf{f}_2, \mathbf{t}_2} \gamma, $$

where, for every $\alpha, \beta, f, t \subseteq \mathbb{P}$, $\alpha \xrightarrow{f,t} \beta$ if and only if $\beta = (\alpha \setminus f) \cup t$.

For example, the analogical proportion $\{p, q\} : \{p, r\} :: \{q\} : \{r\}$ holds since $\{p, q\} \xrightarrow{\{q\}, \{r\}} \{p, r\}$, $\{q\} \xrightarrow{\{q\}, \{r\}} \{r\}$, $\{p, r\} \xrightarrow{\{r\}, \{q\}} \{p, q\}$ and $\{r\} \xrightarrow{\{r\}, \{q\}} \{q\}$. The alternative way to verify the validity of the previous analogical proportion is to check that:

$$ \{p, r\} \setminus \{p, q\} = \{r\} = \{r\} \setminus \{q\} \text{ and } \{p, q\} \setminus \{p, r\} = \{q\} = \{q\} \setminus \{r\}. $$

## 3. Perceptive Task

In this section, we introduce the perceptive scenario that will later serve to evaluate the ability of an artificial neural network to learn analogical proportions. In this scenario, an analogical proportion is defined between images of a grid whose cells may contain shapes of various colours. In particular, we
consider a $n \times n$ grid, $k$ possible shape types, and $m$ possible colours. Our logical encoding of the scenario requires the following set of atomic propositions:

$$ \mathbb{P} = \{ \mathbf{t}_{x,y,z} : x, y \in D \text{ and } z \in T \} \cup \{ \mathbf{c}_{x,y,z} : x, y \in D \text{ and } z \in C \}, $$

where $D = \{1, \dots, n\}$, $T = \{t_1, \dots, t_k\}$, and $C = \{c_1, \dots, c_m\}$ are, respectively, the set of grid dimensions, the set of shape types, and the set of colours. The atomic proposition $\mathbf{t}_{x,y,z}$ stands for “there is a shape of type $z$ in the cell $(x, y)$ of the grid”, while the atomic proposition $\mathbf{c}_{x,y,z}$ stands for “there is a shape of colour $z$ in the cell $(x, y)$ of the grid”. It is easy to verify that $|\mathbb{P}| = |D| \times |D| \times |T| \times |C|$. For example, in the scenario of a $2 \times 2$ grid with 2 possible shape types and 2 possible colours, we have $|\mathbb{P}| = 16$. Thus, to represent the image of the grid, we need a vector with 16 binary dimensions. In the scenario of a $2 \times 2$ grid with 2 possible shape types and 3 possible colours, $|\mathbb{P}| = 24$. Hence, in this case, to represent the image of the grid, we need a vector with 24 binary dimensions.

Figure 1 provides an instance of analogical proportion in the case of a $2 \times 2$ grid, with a set of two shape types $T = \{t, c\}$, and set of three colours $C = \{r, g, b\}$, where $t, c, r, g$ and $b$ stand, respectively, for ‘triangle’, ‘circle’, ‘red’, ‘green’ and ‘blue’. The analogical proportion shown in the figure can be formally represented as follows:

$$ \begin{aligned} \{\mathbf{t}_{2,1,t}, \mathbf{c}_{2,1,g}\} &:: \{\mathbf{t}_{2,1,t}, \mathbf{c}_{2,1,r}, \mathbf{t}_{1,1,c}, \mathbf{c}_{1,1,r}, \mathbf{c}_{1,2,t}, \mathbf{c}_{1,2,b}\} \\ \{\mathbf{t}_{2,1,c}, \mathbf{c}_{2,1,g}\} &:: \{\mathbf{t}_{2,1,c}, \mathbf{c}_{2,1,r}, \mathbf{t}_{1,1,c}, \mathbf{c}_{1,1,r}, \mathbf{c}_{1,2,t}, \mathbf{c}_{1,2,b}\} \end{aligned} \quad (2) $$

It is routine to verify that this is a valid analogical proportion according to the difference-based interpretation formally defined in Section 2.

Not all subsets of $\mathbb{P}$ are possible. Indeed, each cell in the grid can either be empty or contain a single shape type in a given colour. This means that, in this perceptive scenario, the terms $\alpha, \beta, \gamma$ and $\delta$ of an analogical proportions $\alpha : \beta :: \gamma : \delta$ can only be generated from the following set:

$$ \text{PossTerm} = \{ \alpha \subseteq \mathbb{P} : (\forall x, y \in D, \forall z, z' \in T \text{ if } \mathbf{t}_{x,y,z}, \mathbf{t}_{x,y,z'} \in \alpha \text{ then } z = z'), \\ (\forall x, y \in D, \forall z, z' \in C \text{ if } \mathbf{c}_{x,y,z}, \mathbf{c}_{x,y,z'} \in \alpha \text{ then } z = z'), \\ (\forall x, y \in D, \forall z \in T \text{ if } \mathbf{t}_{x,y,z} \in \alpha \text{ then } \exists z' \in C \text{ s.t. } \mathbf{c}_{x,y,z'} \in \alpha), \text{ and} \\ (\forall x, y \in D, \forall z \in T \text{ if } \mathbf{c}_{x,y,z} \in \alpha \text{ then } \exists z' \in T \text{ s.t. } \mathbf{t}_{x,y,z'} \in \alpha) \}. \quad (3) $$

The cardinality of the set PossTerm can be easily computed by noting that each cell in the grid admits the following number of possible configurations:

$$ \text{n.cell} = (|T| \times |C|) + 1 \quad (4) $$

Indeed, a cell can either be empty or contain a shape from $T$ in a colour from $C$. Thus, the following is the number of possible images of the grid:

$$ \text{n.img} = \text{n.cell}^{|D| \times |C|} \quad (5) $$

The number n.img corresponds to the cardinality of the set PossTerm. Since an analogical proportion is a quadruplet of images of the grid (i.e., of elements of PossTerm), the following is the number of possible analogical proportions that can be generated:

$$ \text{n.ap} = \text{n.img}^4 \quad (6) $$

For example, in the case of a $2 \times 2$ grid, with a set of two shape types and a set of three colours, approximately $33 \times 10^{12}$ analogical proportions can be generated.

The visual representation of the grids that are in analogical quadruplets resemble, one could argue, the dataset in the pioneering work of Chollet [16]. Our work though differs in several key aspects from [16]. More specifically, in [16] the grids can vary in size, while each cell in the grid does not contain
<figure><img src="image_4.png" /><figcaption>**Figure 1:** A valid instance of analogical proportion</figcaption></figure>

any shape but instead contains only colours. As such, the goal of [16] is to measure the degree to which Large Language Models or other architectures are capable of identifying and producing analogical transformations based mostly on visual analogies that involves grids of variable sizes. While our goal is *recognition* of analogies, Chollet is mostly concerned with *generation* of analogies. He provides two examples of transformations and then provides a fifth image requiring from the participants to transform it in an *analogous* way to the transformation that happened in the first two images.

# 4. Neural Architecture and Dataset

In this section, we elaborate on the realisation of material work, including the construction of the dataset, and the training and evaluation of the analogical models.

## 4.1. Dataset

To generate the data necessary for the experiments, we determine the set of shape types *T*, of colours *C*, following our example in Figure 1 that features *D* = 2 dimensions thus 2 × 2 grids. We then gradually generate the cells, the images, and the analogical proportions accordingly with the types and colours. For the experiments, we created two datasets on different scales. The smaller dataset has |*T*| = 1 and |*C*| = 2 while the larger one has |*T*| = 2 and |*C*| = 3. The statistics of the elements in the dataset are outlined in Table 1.

<table><thead><tr><th>|T|, |C|</th><th>1, 2</th><th>2, 3</th></tr></thead><tbody><tr><td>n.cell</td><td>3</td><td>7</td></tr><tr><td>n.img</td><td>81</td><td>2,401</td></tr><tr><td>n.ap</td><td>≈ 43 × 10<sup>6</sup></td><td>≈ 33 × 10<sup>12</sup></td></tr></tbody></table>

**Table 1**

Cell, image, and analogical proportion counts wrt the number of shapes and colours

Note that the size of the dataset grows exponentially with the number of shapes and colours. To keep the dataset practically manageable, we restrict ourselves to using 2 shapes and 3 colours, which we find to be a reasonable compromise.<fnref n="1" /> The generated datasets are also publicly accessible via our repository.<fnref n="2" />

## 4.2. Model

As part of this study, which is aimed at providing insights into how accurately and how quickly a simple artificial neural network can learn analogical proportions, we strive to keep the experimental setup as intuitive as possible. The objective is to develop a model capable of automatically recognising valid and invalid instances of analogical proportions, based on the difference-based interpretation. To this end,

<footnote n="1">¹The script used for generating the analogical proportions is available in the repository.</footnote>

<footnote n="2">²https://github.com/thebugcreator/learning-ap-ann</footnote>
we design, train, and evaluate a binary classifier that takes the vector representation of an analogical
proportion instance as input and outputs whether the instance is valid or invalid.

**Architecture** The model starts off with a simple feed-forward architecture, which contains a few linear layers, along with dropouts and activation functions sandwiched between the linear layers. We experimented with different numbers of linear layers, trying to keep it as low as possible without sacrificing the performance of the model. The overall design of the model can be found in the Analogical Model part of our pipeline in Figure 2.

<figure><img src="image_5.png" /><figcaption>**Figure 2:** Pipeline architecture: the encoder and the model</figcaption></figure>

**Training Data** We build the data necessary for the training and evaluation of our model from the datasets described in Table 1. For the configuration concerning 1 type and 2 colours, we use all 81 images to generate all the possible analogical proportions, obtaining a dataset whose the vast majority of records are negative analogies. We balance the dataset by taking all positive analogies, then sample the same number of negative instances from the rest to obtain the balanced *ds12* dataset of 183290 instances. Regarding the configuration with 2 types and 3 colours, since generating analogies from all of the images available for the *ds23* dataset is computationally exorbitant, we decided to randomly sample just 81 images to build analogies from<fnref n="3" />. To achieve a balanced dataset, we employ the same techniques that we used on *ds12*, obtaining *ds23* with 29210 instances. It is intuitive that the smaller size of *ds23* compared to *ds12*, despite having the same number of images to build analogies from, is due to a lower ratio of positive analogies as the wider sets of types and colours are considered. We employ the widely accepted standard train-dev-test split of the dataset in each experimental setting, in which we use 70% for training, 10% for validation, and 20% for evaluation. The number of instances for each experimental setting after balancing can be found in Table 2.

<table><thead><tr><th>Dataset</th><th>|T|, |C|</th><th>all</th><th>train</th><th>dev</th><th>test</th></tr></thead><tbody><tr><td><i>ds12</i></td><td>1, 2</td><td>183 290</td><td>128 303</td><td>18 329</td><td>36 658</td></tr><tr><td><i>ds23</i></td><td>2, 3</td><td>29 210</td><td>20 447</td><td>2 921</td><td>5 842</td></tr></tbody></table>

**Table 2**

Number of instances in each data portion wrt experimental settings

Regarding the vector representations, for every analogical instance, we encode the images using the concatenated one-hot encoding vectors, which is the numerical values of the literals that describe each cell within the image. We simply convert the boolean value of every literal into a number, that is 0 if there is a negation and 1 if not. We then concatenate all four representations of four cells into one

<footnote n="3">³Which is equivalent to the number of images we use in the previous smaller configuration.</footnote>
single vector for that of the image. The instance upon the encoding of colour and shape following the demonstration in Equation 2, plus partial concatenation, becomes a quadruplet of the following format:

$$ 
\begin{aligned}
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] & : [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0] \\
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] & : [0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0]
\end{aligned}
\qquad (7) $$

The vector representations (with *n* coordinates each) of the four images in an analogical proportion are once again merged together to obtain the vector representation of the instance of size 4n:

$$ 
\begin{bmatrix}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \\
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
\end{bmatrix}
\qquad (8) $$

**Training** With the encoded vectors from the aforementioned train-dev-test split, we train an analogical model under the realms of a binary classifier of two classes: 0 (negative/invalid) and 1 (positive/valid). We experimented with different hyperparameters for an optimal training process. These hyperparameters include the number of intermediate blocks, the dropout rate, the reduction function for linear transformation, and the activation function, all stored in a parameter grid. Our experiments suggest that the training is optimal with 2 intermediate blocks, a dropout rate of 0.3, a geometric progression function for feature reduction, and Rectified Linear Unit (ReLU<fnref n="4" />) as an activation function. Apart from that, a learning rate of 10⁻³ and a batch size of 64 are also applied on the training. This setting, though is universal across the experiments, can be adjusted to optimise accordingly with each input configuration.

# 5. Experiments and Results

In this section, we specify our experimental settings and report the corresponding results.

**With 1 shape and 2 colours** We train our ANN model on the dataset built with regards to 1 shape and 2 colours each cell as described in Table 2. The training took less than one minute to complete and reached 99.23% training accuracy on the dev set with just 473 parameters. The training accuracy and loss are shown in Figure 3. On the test set, the evaluation shows an impressive 99.27 accuracy score, along with the precision, recall, and f1 scores reported in Table 3.

**With 2 shapes and 3 colours** Using the same setup except with regards to 2 shapes and 3 colours as described in Table 2, we train another analogical model. The model of just 1440 parameters reached 99.60% training accuracy on the dev set after less than one minute of training. The training accuracy and loss are also shown in Figure 3 along with those of the preceding experimental settings. For the results of the model on the corresponding test set, refer to Table 3.

The results of both experiments indicate that a simple artificial neural network can efficiently learn to distinguish between valid and invalid instances of analogical proportions. The network is not only simple in terms of architecture, but also lightweight with respect to the number of parameters. In terms of resources, the computational requirements for training are minimal, and energy consumption is virtually negligible. Each model required only about one minute of training on a single Tesla A40 GPU, amounting to approximately 10Wh in total for both models. Remarkably, despite their frugality, the models achieved near-perfect performance on the task.

<footnote n="4">⁴https://docs.pytorch.org/docs/stable/generated/torch nn .ReLU.html</footnote>
<figure><img src="image_6.png" /><figcaption>**Figure 3:** Training accuracy and loss for the model trained on *ds12* (left) and *ds23* (right) datasets, over 10 epochs each.</figcaption></figure>

# 6. Comparison with an LLM-based approach

To compare our approach with Large Language Models (LLMs), we also evaluate the performance of certain LLMs on the analogy validation task. We keep the dataset splits identical while adapting LLMs to solve the task under two methods: Prompts with text descriptions, and with vectors. As we intend to use an *Instruct* model of the *Llama*<fnref n="5" /> family, we provide the LLM with an instruction. The instruction along with the formatting of the representations of our analogical instances are dependent on the experiments and will be discussed in this section. Once the instruction is set for the context, we proceed to pass the representations of our analogical instances to the model. The model’s “yes” is count as the answer for “positive” and “no” for “negative” analogy. All the results are reported in comparison with our binary classifiers in Table 3.

## 6.1. Prompts with text descriptions

For the text description as a prompt, given the instance in Figure 1, with three colours (red, green, and blue) and two shapes (circle and triangle), we can encode the instance as in Figure 4. In this experiment, the instruction below is used:

「Given the descriptions of four images with four parts each image, answer only yes or no whether the four images constitute a valid analogy.」

We build the descriptions of the images using the format below:

<figure><img src="image_7.png" /></figure>

in which the text descriptions of the corresponding cell are formatted into the placeholders (namely 1, 2, 3, and 4).

<figure><img src="image_8.png" /><figcaption>**Figure 4:** Analogical instance with encoded cells (in text)</figcaption></figure>

Upon the completion of this step, we concatenate the descriptions of the four images in an instance together to build the description of the instance to pass to the model. For example, considering the instance shown in Figure 4 we automatically build the description as follows:

<footnote n="5">⁵https://huggingface.co/meta-llama</footnote>
top left: empty, top right: empty, bottom left: green triangle, bottom right: empty

top left: red circle, top right: blue triangle, bottom left: red triangle, bottom right: empty

top left: empty, top right: empty, bottom left: green circle, bottom right: empty

top left: red circle, top right: blue triangle, bottom left: red circle, bottom right: empty

## 6.2. Prompts with vectors

In this experiment, we use the instruction below:

「Given the descriptions of four images in the form of boolean values, answer only yes or no whether they constitute a valid analogy.」

Then instead of building the text description for every cell, we retrieve the vector representation of each image and use them directly for the presentation of the image itself. For example, with the instance shown in Equation 7, we build the following description:

<figure><img src="image_9.png" /></figure>

## 6.3. Comparison

Table 3 shows the comprehensive evaluation results to facilitate the comparison of the performance of our simple ANN model versus the chosen LLM Llama-3.1-8B-Instruct<fnref n="6" /> that is hereafter referred to as Llama. It is instantly noticeable that Llama demonstrates better performance when the prompt describes the analogical instances in literal values than text descriptions; in both datasets, Llama with literal values significantly outperforms the same model with text input. Regarding the inferior scores of Llama with both inputs, it is worth noting that the model occasionally fails to comply with the instruction since apart from the yes/no answer, it sometimes returns questions. We count the response without an answer as a negative answer as the model is uncertain if the instance is valid.

Ultimately, when compared to the analogical model, Llama falls short with its best accuracy scores of 55.73% and 66.09%, considering the nature of the binary classification problem and the borderline perfect scores the analogical model achieved. Evidently, the analogical model also vastly shadows Llama on all other scores regardless of the experimental settings.

<table><caption>**Table 3**</caption><thead><tr><th>Dataset</th><th>Input</th><th>Model</th><th>Precision</th><th>Recall</th><th>F1 score</th><th>Accuracy</th></tr></thead><tbody><tr><td rowspan="3">ds12</td><td>Text</td><td>Llama</td><td>60.11/51.99</td><td>18.60/87.71</td><td>28.41/65.28</td><td>53.24</td></tr><tr><td>Vector</td><td>Llama</td><td>53.11/79.64</td><td>95.97/15.69</td><td>68.38/26.21</td><td>55.73</td></tr><tr><td>Vector</td><td>Ours</td><td>100.0/98.49</td><td>98.46/100.0</td><td>99.22/99.24</td><td><strong>99.27</strong></td></tr><tr><td rowspan="3">ds23</td><td>Text</td><td>Llama</td><td>73.02/55.24</td><td>26.90/90.08</td><td>39.32/68.49</td><td>58.52</td></tr><tr><td>Vector</td><td>Llama</td><td>62.21/73.53</td><td>81.84/50.38</td><td>70.69/59.79</td><td>66.09</td></tr><tr><td>Vector</td><td>Ours</td><td>100.0/99.22</td><td>99.21/100.0</td><td>99.60/99.61</td><td><strong>99.60</strong></td></tr></tbody></table>

Evaluation scores with different approaches. Precision, Recall, and F1 scores are calculated regarding two classes: negative and positive

Our ANN-based model, despite being frugal, seems to retain superior robustness regardless of the increased complexity of input data. From the *ds12* to *ds23* dataset, though the number of features in the

<footnote n="6">⁶https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct</footnote>
input vectors increases and the number of training instances drops, our ANN model performs visibly better concerning its scores across all of the metrics. It is promising for further research and remains to be explored how the complexity of input data affects the model in this analogy recognition task.

# 7. Conclusion

To summarise, we have trained a simple artificial neural network (ANN) to recognise analogical proportions based on the difference-based interpretation. Our results show that the ANN learns this task both rapidly and with high accuracy. We further compared its performance to that of a large language model (LLM) in a zero-shot setting. The experimental findings suggest that analogical proportions can be efficiently learned by a lightweight machine learning model, and that energy-intensive LLMs offer no advantage in this context.

There are several promising directions for future research. In this paper, we employed the Instruct model of Llama with 8 billion parameters to evaluate the capability of a state-of-the-art large language model (LLM) to recognise analogical proportions in a zero-shot setting, without any additional training. In future work, we intend to explore techniques such as model fine-tuning and prompt engineering to enhance the LLM's performance. This will allow for a more comprehensive comparison with the performance of our frugal ANN approach.

We plan to extend our analysis to additional forms of analogy discussed in the literature on analogical reasoning, including reverse analogy, paralogy, and inverse paralogy (see [13]). In particular, we aim to investigate whether these notions can likewise be efficiently learned by a simple ANN model.

Furthermore, we intend to move from verifying analogical proportions to generating them. In other words, given three images in sequence, we ask the neural network to generate a fourth image in order to form a valid analogical proportion. This will require designing a different neural architecture.

As a longer-term objective, we plan to investigate the relationship between learning analogical proportions and the level of abstraction in image representation. In the present paper, we have considered only zero-level abstraction—that is, shape type (e.g., triangle, circle) and color (e.g., red, green) are treated as primitive and independent features. At higher levels of abstraction, these features can be grouped together so that the primitives become combined concepts such as ‘green triangle’, ‘red triangle’, ‘green circle’, ‘red circle’, and so on. Note that under this higher abstraction level, the quadruplet in Figure 1 no longer constitutes a valid analogical proportion: the difference between the first and second images (from ‘green triangle’ to ‘red triangle’) is no longer the same as the difference between the third and fourth images (from ‘green circle’ to ‘red circle’). More specifically, we plan to generate a dataset of valid and invalid analogical proportions for each abstraction level, use these datasets to train the ANN, and compare the performance of the trained network depending on the level of abstraction in the image representation.

Last but not least, we plan to investigate the degree to which our approach can capture more perceptual analogies such as the ones presented in [16].

# Acknowledgments

We would like to thank the AT2TA project under the grant ANR-22-CE23-0023 financed by the French National Research Agency (Agence Nationale de la Recherche - ANR).

# Declaration on Generative AI

We hereby declare that we do not use Generative AI regarding any of the use cases stated in the respective CEUR-WS policy. Though our experiments involved the Generative AI model of Llama, its output is solely used for the evaluation of the model itself.
References

[1] Aristotle, Poetics, 384–322 BC.

[2] D. R. Hofstadter, Analogy as the Core of Cognition, in: D. Gentner, K. J. Holyoak, B. N. Kokinov (Eds.), The Analogical Mind: Perspectives from Cognitive Science, The MIT Press, Cambridge, Massachusetts, 2001, pp. 499–538.

[3] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, J. Dean, Distributed representations of words and phrases and their compositionality, in: Advances in Neural Information Processing Systems, volume 26, Curran Associates Inc., 2013, pp. 3111–3119.

[4] H. Prade, G. Richard, Analogical proportions: Why they are useful in AI, in: Proceedings of the 30th International Joint Conference on Artificial Intelligence (IJCAI’21), ijcai.org, 2021, pp. 4568–4576.

[5] L. Miclet, H. Prade, Handling analogical proportions in classical logic and fuzzy logics settings, in: Symbolic and Quantitative Approaches to Reasoning with Uncertainty, Lecture Notes in Computer Science (LNCS), Springer, 2009, pp. 638–650.

[6] N. Barbot, L. Miclet, H. Prade, G. Richard, A new perspective on analogical proportions, in: G. Kern-Isberner, Z. Ognjanovic (Eds.), Proceedings of the 15th European Conference on Symbolic and Quantitative Approaches to Reasoning with Uncertainty (ECSQARU’19), volume 11726 of LNCS, Springer, 2019, pp. 163–174.

[7] N.-E. Mbengue, M. Couceiro, Y. Lepage, P. Monnin, Which pairs to choose? exploring analogical competency for knowledge graph pruning, in: IARML 2025-Workshop on the Interactions between Analogical Reasoning and Machine Learning at IJCAI 2025, 2025.

[8] M. Couceiro, P.-A. Murena, Proceedings of the 3rd workshop on the interactions between analogical reasoning and machine learning (iarml 2024) co-located with the international joint conference on artificial intelligence (ijcai 2024), in: 3rd Workshop on the Interactions between Analogical Reasoning and Machine Learning (IARML 2024) co-located with the International Joint Conference on Artificial Intelligence (IJCAI 2024), 2025.

[9] F. Olivier, M. Couceiro, Z. Bouraoui, Probing large language models to perform analogical transformation, in: between Analogical Reasoning and Machine Learning (IARML 2024) co-located with the International Joint Conference on Artificial Intelligence (IJCAI 2024), volume 1613, 2024, p. 75.

[10] Y. Lepage, M. Couceiro, Any four real numbers are on all fours with analogy, arXiv preprint arXiv:2407.18770 (2024).

[11] E. Marquer, M. Couceiro, Solving morphological analogies: from retrieval to generation, Annals of Mathematics and Artificial Intelligence (2024) 1–36.

[12] A. Herzig, E. Lorini, H. Prade, A Novel View of Analogical Proportion Between Formulas, in: ECAI 2024, Frontiers in Artificial Intelligence and Applications, IOS Press, Santiago de Compostela, SPAIN, Spain, 2024.

[13] H. Prade, G. Richard, Analogical proportions and analogical reasoning – an introduction, in: Proceedings of the 25th International Conference on Case-Based Reasoning (ICCBR 2017), volume 10339 of LNCS, Springer, 2017, pp. 16–32.

[14] M. Mitchell, Analogy Making as Perception: A Computer Model, Neural Network Modeling and Connectionism, The MIT Press, 1993.

[15] D. R. Hofstadter, M. Mitchell, The copycat project: A model of mental fluidity and analogy-making, in: K. J. Holyoak, J. A. Barnden (Eds.), Advances in Connectionist and Neural Computation Theory, volume 2, Ablex, 1994.

[16] F. Chollet, On the measure of intelligence, arXiv preprint arXiv:1911.01547 (2019).