# Proceedings of the 4th Workshop on the Interactions between Analogical Reasoning and Machine Learning (IARML 2025) co-located with the International Joint Conference on Artificial Intelligence (IJCAI 2025)

Zied Bouraoui, Miguel Couceiro

► To cite this version:

Zied Bouraoui, Miguel Couceiro. Proceedings of the 4th Workshop on the Interactions between Analogical Reasoning and Machine Learning (IARML 2025) co-located with the International Joint Conference on Artificial Intelligence (IJCAI 2025). 4th Workshop on the Interactions between Analogical Reasoning and Machine Learning (IARML 2025) co-located with the International Joint Conference on Artificial Intelligence (IJCAI 2025), Aug 2025, Montréal, Canada. 2025. hal-05211149v2

HAL Id: hal-05211149

https://hal.science/hal-05211149v2

Submitted on 27 Nov 2025

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 Attribution 4.0 International License
Proceedings

4th IJCAI Workshop

“Interactions between
Analogical Reasoning and Machine Learning”

IARML 2025

August 17, 2025

Montréal, Canada

Editors

Zied Bouraoui (CRIL, CNRS, U. Artois, France)

Miguel Couceiro (INESC-ID, IST, U. Lisbon, Portugal)

https://iarml-workshop.github.io/
Preface<fnref n="1" />

Analogical reasoning is a remarkable human capability that is used to solve hard reasoning
tasks. It involves transferring knowledge from a source domain to a different but somewhat
similar target domain by relying simultaneously on similarities and differences. Analogies
have preoccupied humanity at least since antiquity (cf the works of Atistotle, Theon of
Smyrna, among others) and have been in more recent years characterized as being "at the
core of cognition" (Hofstadter 2001) showing that they permeate almost every aspect of
cognition (Hofstadter and Sanders, 2013). Analogies have been tackled from various angles.
Traditionally, analogical proportions, i.e., statements of the form "A is to B as C is to D", are
the basis of analogical inference. They contributed to case-based reasoning and to multiple
machine learning tasks such as classification, decision making and machine translation with
competitive results.

Also, analogical extrapolation can support dataset augmentation (analogical extension) for model learning, especially in environments with few labeled examples. Other approaches include the Structure Mapping approach of Dedre Gentner, which is based on logical descriptions (in the form of predicate-argument structures) of two domains: the more relational similarity one has between the two domains, the more analogous they can be considered. According to Hofstadter and the Fluid Analogies Research Group, analogy making is intimately related with abstraction and the search of a “common essence”, which can lead to deep understanding of any concept or situation.

Recent neural techniques, such as representation learning, enabled efficient approaches to
detecting and solving analogies in domains where symbolic approaches had shown their limits.
Transformer architectures trained using vast amounts of data have given us Large Language
Models (LLMs) such as Chat-GPT, LLama and Mistral, which are capable of exhibiting
human-like conversational and analogy making capacities (Webb et al. 2022). However,
better evaluation metrics are needed in order to measure elusive concepts such as intelligence
and understanding (Mitchel 2023). More than ever, we need to understand the role that
analogies, abstraction and similarities between concepts play in language and cognition.

The series of workshops *Interactions between Analogical Reasoning and Machine Learning (IARML)*, organized on behalf of the International Joint Conferences on Artificial Intelligence (IJCAI), aims to bring together AI researchers at the crossroads of machine learning, natural language processing, knowledge representation and reasoning, who are interested in the various applications of analogical reasoning in machine learning or, conversely, of machine learning techniques to improve analogical reasoning. The first three editions were co-located with the IJCAI-ECAI 2022 (Vienna, Austria) and IJCAI 2023 (Macao, China), and IJCAI 2024 (Jeju, Korea) conferences, respectively. These first editions showed a promising impact with contributions from 5 continents, and that led to the edition of a special volume in *Annals of Mathematics and Artificial Intelligence* (under final reviewing), in addition to the CEUR and HAL workshop proceedings (*e.g.*, IARML2022, IARML2023 and IARML2024).

This fourth edition of the IARML workshop was hosted by the 34th International Joint
Conference on Artificial Intelligence (IJCAI) and took place on August 17, 2025 in Montréal,
Canada. It welcomed submissions of research papers on all topics at the intersection of ana-
logical reasoning and machine learning. The submissions were subjected to a strict reviewing
process that resulted in the selection of five original contributions, one contributed and three
keynote talks:

<footnote n="1">¹Copyright © 2025 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</footnote>
**Plenary talks:**

*From analogical learning on formal analogies to diagnosing lexico-semantic limitations of LLMs* by Philippe Langlais (University of Montreal, Canada)

*Computational Argumentation for Explainable Case-Based Predictions* by Francesca Toni (Imperial College London, UK)

*Analogy-Driven AI: A Neuro-Symbolic Approach* by Dafna Shahaf (Hebrew University of Jerusalem, Israel)

**Contributed talks:**

*A General Semantics for Analogical Reasoning* by Emiliano Lorrini (IRIT, CNRS, France)

*Towards number sequence completion through the analysis of number sequence patterns using numerical analogy* by Yunhui Qi (University of Waseda, Japan)

*Analogical pooling for image reconstruction* by Miguel Couceiro (University of Lisbon, Portugal)

*Supported Abstract Argumentation for Case-Based Reasoning* by Adam Gould (Imperial College London, UK)

*Which Pairs to Choose? Exploring Analogical Competency for Knowledge Graph Pruning* by Miguel Couceiro (University of Lisbon, Portugal)

*A new approach to clustering based on an analogy-related logical proportion* by Henri Prade (IRIT, CNRS, France)

We are truly thankful to the IJCAI workshop chairs for their help in the organization of this event, and to the scientific committee for their reviews and suggestions for improving the accepted contributions.

Zied Bouraoui
Miguel Couceiro
## Organising Committee

Miguel Couceiro (INESC-ID, IST, U. Lisbon, Portugal)

Zied Bouraoui (CRIL, CNRS, U. Artois, France)

## Scientific Committee

Fadi Badra (Université Sorbonne Paris Nord, LIMICS, FR)

Nelly Barbot (Université de Rennes 1, IRISA, FR)

Tarek R. Besold (DEKRA DIGITAL, Eindhoven University of Technology, NL)

Myriam Bounhas (LARODEC-ISGT, TU, UAE)

Adrien Coulet (Inria Paris, FR)

Sebastien Destercke (CNRS, Université de Technologie de Compiegne, Heudiasyc, FR)

Mehdi Kaytoue (Infologic, FR)

Sundong Kim (GIST, KR)

David B. Leake (Indiana University, USA)

Yves Lepage (Waseda University, JA)

Jean Lieber (University of Lorraine, CNRS, LORIA, FR)

Esteban Marquer (CRIL, CNRS, U. Artois, FR)

Laurent Miclet (Université de Rennes, FR)

Pierre Monnin (Université Côte d'Azur, FR)

Amedeo Napoli (University of Lorraine, CNRS, LORIA, FR)

Henri Prade (CNRS, Université Paul Sabatier, IRIT, FR)

Steven Schockaert (Cardiff University, IR)
# Table of Contents

<table><tr><td>Preface</td><td>II</td></tr><tr><td>Keynote talks</td><td>1</td></tr><tr><td>From analogical learning on formal analogies to diagnosing lexico-semantic limitations of LLMs<br>Philippe Langlais</td><td>2</td></tr><tr><td>Computational Argumentation for Explainable Case-Based Predictions<br>Francesca Toni</td><td>3</td></tr><tr><td>Analogy-Driven AI: A Neuro-Symbolic Approach<br>Dafna Shahaf</td><td>4</td></tr><tr><td>Accepted papers</td><td>6</td></tr><tr><td>A General Semantics for Analogical Reasoning<br>Emiliano Lorini, Andreas Herzig</td><td>8</td></tr><tr><td>Towards number sequence completion through the analysis of number sequence patterns using numerical analogy<br>Yunhui Qi, Yuxuan Yang, Yves Lepage</td><td>14</td></tr><tr><td>Analogical pooling for image reconstruction<br>Jakub Pilimon, Miguel Couceiro, Yves Lepage</td><td>27</td></tr><tr><td>Which Pairs to Choose? Exploring Analogical Competency for Knowledge Graph Pruning<br>Ndeye-Emilie Mbengue, Miguel Couceiro, Yves Lepage, Pierre Monnin</td><td>43</td></tr><tr><td>A new approach to clustering based on an analogy-related logical proportion<br>Myriam Bounhas, Henri Prade</td><td>59</td></tr></table>
Keynote talks
**Title.** From analogical learning on formal analogies to diagnosing lexico-semantic limitations of LLMs

**Abstract.** In this talk, I will present three types of analogical studies I have been involved in. The first uses analogical learning on formal analogies to solve mapping problems (such as machine translation) and which presents specific algorithmic challenges. The second focusses on training (neural) models to solve (primarily) semantic analogies at the sentence level. The third explores prompting large language models to assess their ability to capture fine-grained lexico-semantic information. Those studies, conducted over the past twenty years, reflect the evolution of Natural Language Processing – from dedicated algorithms to prompting large language models.

**Short Bio.** Philippe Langlais is a full professor at the Computer Science and Operational Research department of University of Montreal, working on Natural Language Processing at RALI. He did his PhD at University of Avignon (on the use of prosody in Speech Recognition). He visited IDIAP/Martigny for some years (collecting a large speech database), KTH/Stockholm (working on Speech Technology for 2nd Language Acquisition), and LIMSI, Paris-Orsay (now LISN). He his interested in many NLP related topics, including core-technology components (e.g. named-entity recognition, information extraction), and specific applications (e.g. Question-Answering, Machine Translation, Legal Prediction).
**Title.** Computational Argumentation for Explainable Case-Based Predictions

**Abstract.** AI is increasingly embedded in decision-making systems, making explainability a critical requirement for their trustworthy deployment—especially when these systems rely on data that may carry biases. In this talk, I will explore how transparent, explainable predictions can be generated from casebases by drawing on computational argumentation. I will present two complementary approaches grounded in established argumentation frameworks and analyse the formal connections between them. In the first approach, based on abstract argumentation, cases in a casebase are treated as pre-constructed arguments that interact through an attack relation. In the second approach, using assumption-based argumentation, reasoning from cases contributes to the construction of general frameworks from which arguments are systematically derived. The talk will also discuss argumentative explanations for predictions produced by these approaches. Finally, I will discuss neuro-symbolic extensions of both approaches, which combine the strengths of symbolic reasoning with the adaptability of neural models.

**Short Bio.** Francesca Toni is Professor in Computational Logic and Royal Academy of Engineering/JP Morgan Research Chair on Argumentation-based Interactive Explainable AI (XAI) at the Department of Computing, Imperial College London, UK, as well as the founder and leader of the CLArg (Computational Logic and Argumentation) research group and of the Research Centre in XAI. She holds an ERC Advanced grant on Argumentation-based Deep Interactive eXplanations (ADIX). Her research interests lie within the broad area of Explainable AI, at the intersection of Knowledge Representation and Reasoning, Machine Learning, Computational Argumentation, Argument Mining, and Multi-Agent Systems. She is EurAI fellow, IJCAI Trustee, in the Board of Directors for KR Inc., member of the editorial board for Theory and Practice of Logic Programming, and general chair for IJCAI2026.
**Title.** Analogy-Driven AI: A Neuro-Symbolic Approach

**Abstract.** Analogy is a cornerstone of human reasoning, yet remains elusive for current AI systems. In this talk, I present a pipeline view of analogy in the age of large language models, spanning four recent lines of work. Taken together, these works illustrate how analogy can serve as a bridge between the creative flexibility of LLMs and the rigor of symbolic reasoning, pointing toward a neuro-symbolic path for building AI systems that reason, explain, and innovate.

**Short Bio.** Dafna Shahaf is a Full Professor in Computer Science at the Hebrew University of Jerusalem. Prof. Shahaf's research uses digital traces of human activity to better understand human capacities such as humor and creativity, and to develop computer systems that can support these capacities. She received her PhD from Carnegie Mellon University, and was a postdoctoral fellow at Stanford University and at Microsoft Research. Prof. Shahaf has won multiple awards, including best research paper awards at KDD 2010 and KDD 2017, an ERC starting grant, IJCAI Early Career Award. a Microsoft Research Fellowship, a Siebel Scholarship, Wolf's Foundation Krill Award, as well as MIT Tech Review's "Most thought-provoking paper of the week".
Accepted papers
# A General Semantics for Analogical Reasoning

Andreas Herzig, Emiliano Lorini

IRIT, CNRS, Toulouse University, France

**Abstract**

We present a general semantics for analogical proportion between logical formulas, as well as a modal language for analogical reasoning interpreted through it.

**Keywords**

Analogical Reasoning, Formal Semantics, Analogical Proportion

## 1. Introduction

The idea that relations between objects are at the core of analogical reasoning is emphasized in Gentner’s cognitive theory of analogy, known as the Structure-Mapping Theory (SMT) [1]. Gentner’s relational approach to analogy is closely related to the so-called functional view [2], which conceives analogy primarily as a cognitive mechanism that is ubiquitous and involved in perception, concept formation, and, more generally, our understanding of the world. Specifically, according to this view, an analogy can be seen as the cognitive process of applying an operation to transform a first mental representation into a second representation, and applying the same operation to transform a third representation into a fourth one. For example, the analogy “3 is to 9 as 2 is to 4” can be drawn by recognizing that 3 can be transformed into 9, and 2 into 4, by the function $x \mapsto 2^x$. Another example is the analogy “great roadrunner is to coyote as canary is to falcon,” which holds because coyotes are recognized as predators of great roadrunners, and similarly, falcons are recognized as predators of canaries. From a mathematical point of view, the relational approach to analogy is more general than the functional one, since the latter can be seen as a special case of the former under the assumption that the relations between objects are functional.

In this paper, we provide a model-theoretic foundation for the relational approach to analogy, where the objects involved in analogical reasoning are facts, expressed at the syntactic level by logical formulas. In particular, we focus on analogical patterns of the form “$X_1$ is to $X_2$ as $X_3$ is to $X_4$”, which is interpreted as: there exists a relation that relates $X_1$ to $X_2$ and $X_3$ to $X_4$. Such patterns are referred to as analogical proportions (AP) in the literature on analogical reasoning [3, 4].

IARML@IJCAI'2025: Workshop on the Interactions between Analogical Reasoning and Machine Learning, at IJCAI'2025, August, 2025, Montreal, Canada

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

Andreas.Herzig@irit.fr (A. Herzig); Emiliano.Lorini@irit.fr (E. Lorini)

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

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

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

CEUR Workshop Proceedings (CEUR-WS.org)
## 2. Formal semantics

The following notion of relational model is the key element of our semantics: a set of possible worlds equipped with a valuation function for atomic propositions and a set of relations between sets of worlds. We assume that a countable infinite set of atomic propositions $\mathbb{P}$ is given.

**Definition 1 (Relational model).** A relational model is a tuple $M = (W, \Theta, \mathcal{V})$ where:

* $W$ is a non-empty set of possible worlds;

* $\Theta \subseteq \wp(\wp(W) \times \wp(W))$ is a set of relations between facts;

* $\mathcal{V}: W \to 2^{\mathbb{P}}$ is a valuation function.

The class of relational models is denoted by $\mathbf{M}$.

Elements of $\Theta$ are denoted by $\mathcal{R}, \mathcal{R}', \dots$ and elements of $\wp(W)$ are denoted by $X, X', \dots$. For notational convenience, we write $X\mathcal{R}X'$ instead of $(X, X') \in \mathcal{R}$.

Thanks to relational models, we can give a formal interpretation of the relational view of AP. Given $X_1, X_2, X_3, X_4 \in \wp(W)$:

> "$X_1$ is to $X_2$ as $X_3$ is to $X_4$" iff $\exists \mathcal{R} \in \Theta$ such that $X_1\mathcal{R}X_2$ and $X_3\mathcal{R}X_4$.

In the next section, we introduce a modal language that allows us to express the syntactic counterpart of the previous notion of AP—namely, AP between logical formulas.

## 3. Language and its interpretation

Our modal language $\mathcal{L}$ has two main constructs: one unary modality quantifying over the set of relations, and a dyadic modality relating two formulas. It is defined by the following grammar:

$$ \varphi ::= p \mid \neg\varphi \mid \varphi \wedge \varphi \mid \varphi \leadsto \varphi \mid \Box\varphi, $$

with $p$ ranging over $\mathbb{P}$. The dual of the modality $\Box$ is defined as usual: $\Diamond\varphi \stackrel{\text{def}}{=} \neg\Box\neg\varphi$.

Formulas of the language $\mathcal{L}$ are interpreted relative to a relational model, a relation within it, and a world. Let $M = (W, \Theta, \mathcal{V}) \in \mathbf{M}, \mathcal{R} \in \Theta, w \in W$. Then:

$$ (M, \mathcal{R}, w) \models p \iff p \in \mathcal{V}(w), $$

$$ (M, \mathcal{R}, w) \models \neg\varphi \iff (M, \mathcal{R}, w) \not\models \varphi, $$

$$ (M, \mathcal{R}, w) \models \varphi \wedge \psi \iff (M, \mathcal{R}, w) \models \varphi \text{ and } (M, \mathcal{R}, w) \models \psi, $$

$$ (M, \mathcal{R}, w) \models \varphi \leadsto \psi \iff [[\varphi]]_M \mathcal{R} [[\psi]]_M, $$

$$ (M, \mathcal{R}, w) \models \Box\varphi \iff \forall \mathcal{R}' \in \Theta, (M, \mathcal{R}', w) \models \varphi, $$

with $[[\varphi]]_M = \{v \in W : \forall \mathcal{R} \in \Theta, (M, \mathcal{R}, v) \models \varphi\}$.

The set $[[\varphi]]_M$ is the truth set of $\varphi$ relative to $M$. It captures the fact corresponding to the formula $\varphi$ relative to $M$.

Notions of satisfiability and validity are defined in the usual way. A formula $\varphi$ of the language $\mathcal{L}$ is said to be valid, denoted by $\models_M \varphi$, if $(M, \mathcal{R}, w) \models \varphi$ for all $M = (W, \Theta, \mathcal{V}) \in \mathbf{M}, \mathcal{R} \in \Theta, w \in W$. It is said to be satisfiable, if $\neg\varphi$ is not valid.

The following definition introduces the concept of AP between formulas.
**Definition 2.** $M = (W, \Theta, \mathcal{V}) \in \mathbf{M}, \mathcal{R} \in \Theta, w \in W$. Then,

$$ (M, \mathcal{R}, w) \models \varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \text{ iff } \exists \mathcal{R}' \in \Theta \text{ such that } [[\varphi_1]]_M \mathcal{R}' [[\varphi_2]]_M \text{ and} \\ [[\varphi_3]]_M \mathcal{R}' [[\varphi_4]]_M. $$

It says that “$\varphi_1$ is to $\varphi_2$ as $\varphi_3$ is to $\varphi_4$” if there is a relation that relates the fact corresponding to $\varphi_1$ to the fact corresponding to $\varphi_2$, and the fact corresponding to $\varphi_3$ to the fact corresponding to $\varphi_4$.

The following fact shows that Definition 2 can be syntactically expressed in the language $\mathcal{L}$.

**Fact 1.** We have:

$$ (M, \mathcal{R}, w) \models \varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \text{ iff } (M, \mathcal{R}, w) \models \Diamond((\varphi_1 \rightsquigarrow \varphi_2) \wedge (\varphi_3 \rightsquigarrow \varphi_4)). $$

Thus, in the light of the previous fact, AP between formulas can be represented as an abbreviation:

$$ \varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \stackrel{\text{def}}{=} \Diamond((\varphi_1 \rightsquigarrow \varphi_2) \wedge (\varphi_3 \rightsquigarrow \varphi_4)). $$

## 4. Constraints on relations

In the literature on analogical proportion, several rationality postulates are considered. The three fundamental postulates of AP are *reflexivity* (*refl*), *symmetry* (*sym*), and *central permutation* (*cperm*):

(refl) $\varphi_1:\varphi_2 :: \varphi_1:\varphi_2$,

(sym) If $\varphi_1:\varphi_2 :: \varphi_3:\varphi_4$ then $\varphi_3:\varphi_4 :: \varphi_1:\varphi_2$,

(cperm) If $\varphi_1:\varphi_2 :: \varphi_3:\varphi_4$ then $\varphi_1:\varphi_3 :: \varphi_2:\varphi_4$.

The following two postulates of unicity (unic) and transitivity (trans) are not universally accepted, but are discussed in the literature:

(unic) If $\varphi_1:\varphi_2 :: \varphi_3:\varphi_4$ and $\varphi_1:\varphi_2 :: \varphi_3:\varphi_5$ then $\varphi_4 = \varphi_5$,

(trans) If $\varphi_1:\varphi_2 :: \varphi_3:\varphi_4$ and $\varphi_3:\varphi_4 :: \varphi_5:\varphi_6$ then $\varphi_1:\varphi_2 :: \varphi_5:\varphi_6$.

In the rest of this section, we identify some constraints that must be imposed on relational models to ensure the satisfaction of the previous postulates. The postulate (*sym*) holds by construction. Indeed, we have the following validity:

$$ \models_M \varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \rightarrow \varphi_3:\varphi_4 :: \varphi_1:\varphi_2. \qquad (1) $$

We consider the following three constraints on relational models:

(C1) $\forall X_1, X_2 \in \wp(W), \exists \mathcal{R} \in \Theta$ such that $X_1 \mathcal{R} X_2$;
(C2) $\forall \mathcal{R} \in \Theta, \forall X_1, X_2, X_3, X_4 \in \wp(W), (\text{ if } (X_1\mathcal{R}X_2 \text{ and } X_3\mathcal{R}X_4) \text{ then } (\exists \mathcal{R}' \in \Theta \text{ such that } X_1\mathcal{R}'X_3 \text{ and } X_2\mathcal{R}'X_4));$

(C3) $\forall \mathcal{R}, \mathcal{R}' \in \Theta, \text{ if } \mathcal{R} \neq \mathcal{R}' \text{ then } \mathcal{R} \cap \mathcal{R}' = \emptyset \text{ (disjointness)}$;

(C4) $\forall \mathcal{R} \in \Theta, \forall X_1, X_2, X_3 \in \wp(W), \text{ if } X_1\mathcal{R}X_2 \text{ and } X_1\mathcal{R}X_3 \text{ then } X_2 = X_3 \text{ (functionality)}$.

According to the Constraint C1, for any two facts there is a relation that relates them. According to C2, if a relation relates $X_1$ to $X_2$ and $X_3$ to $X_4$, then there exists a relation that relates $X_1$ to $X_3$ and $X_2$ to $X_4$. According to C3, two different relations are disjoint. According to C4, every relation is a function.

For every $\Gamma \subseteq \{C1, C2, C3, C4\}$, we generalize the notion of validity to subclasses $M_{\Gamma} \subseteq M$ satisfying all constraints of $\Gamma$. The fact that a formula $\varphi$ is valid for the subclass $M_{\Gamma}$ is denoted by $\models_{M_{\Gamma}} \varphi$. The following three validities highlight the correspondence between the three constraints C1, C2 and C3, and the postulates (refl), (cperm) and (trans):

$$ \models_{M_{\{C1\}}} \varphi_1:\varphi_2 :: \varphi_1:\varphi_2, \qquad (2) $$

$$ \models_{M_{\{C2\}}} \varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \rightarrow \varphi_1:\varphi_3 :: \varphi_2:\varphi_4, \qquad (3) $$

$$ \models_{M_{\{C3\}}} (\varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \wedge \varphi_3:\varphi_4 :: \varphi_5:\varphi_6) \rightarrow \varphi_1:\varphi_2 :: \varphi_5:\varphi_6, \qquad (4) $$

$$ \models_{M_{\{C4\}}} (\varphi_1:\varphi_2 :: \varphi_3:\varphi_4 \wedge \varphi_1:\varphi_2 :: \varphi_3:\varphi_5) \rightarrow \Box(\varphi_4 \leftrightarrow \varphi_5). \qquad (5) $$

## 5. Research agenda

Perspectives for future work are manifold. We plan to provide a sound and complete axiomatization for the language for each model class $M_{\Gamma}$ with $\Gamma \subseteq \{C1, C2, C3, C4\}$. The following are some notable validities:

$$ \models_{M_{\{C1\}}} \Diamond(\varphi \rightsquigarrow \psi), \qquad (6) $$

$$ \models_{M_{\{C2\}}} ((\varphi \rightsquigarrow \psi) \wedge (\chi \rightsquigarrow \gamma)) \rightarrow \Diamond((\varphi \rightsquigarrow \chi) \wedge (\psi \rightsquigarrow \gamma)), \qquad (7) $$

$$ \models_{M_{\{C3\}}} ((\varphi \rightsquigarrow \psi) \wedge \chi) \rightarrow \Box((\varphi \rightsquigarrow \psi) \rightarrow \chi), \qquad (8) $$

$$ \models_{M_{\{C4\}}} ((\varphi \rightsquigarrow \psi) \wedge (\varphi \rightsquigarrow \chi)) \rightarrow \Box(\psi \leftrightarrow \chi). \qquad (9) $$

We believe that each of these validities is canonical, in the sense that it corresponds to one of the semantic constraints presented in Section 4: validity (6) is canonical with respect to Constraint C1, validity (7) to Constraint C2, validity (8) to Constraint C3, and validity (9) to Constraint C4.

We also plan to study complexity of checking satisfiability in the classes of models $M_{\Gamma} \subseteq M$, for $\Gamma \subseteq \{C1, C2, C3, C4\}$. Furthermore, we intend to extend the language $\mathcal{L}$ with a modality $\blacksquare$, which quantifies over possible worlds in a relational model, in contrast to the modality $\Box$, which quantifies over relations. In particular, the modality $\blacksquare$ should be interpreted as follows:

$$ (M, \mathcal{R}, w) \models \blacksquare \varphi \iff \forall v \in W, (M, \mathcal{R}, v) \models \varphi. $$

The resulting system will be a specific instance of the modal product $S5^n$, a well-known logic in the field of multi-dimensional modal logics [5]. Again, proof theory and the complexity
analysis of satisfiability checking for this extension will be the focus of our future work. As a longer-term objective, we plan to develop tableau-based decision procedures for our logics, with the aim of automating analogical reasoning.

## References

[1] D. Gentner, Structure-mapping: A theoretical framework for analogy, Cognitive Science 7 (1983) 155-170.

[2] D. Hofstadter, The Fluid Analogies Research Group (Eds.), *Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought*, Basic Books, Inc., New York, NY, 1995.

[3] H. Prade, G. Richard, Analogical proportions: Why they are useful in AI, in: Z. Zhou (Ed.), *Proc. of the 30th Int. Joint Conf. on Artificial Intelligence (IJCAI'21)*, Virtual Event / Montreal, Aug. 19-27, ijcai.org, 2021, pp. 4568-4576.

[4] A. Herzig, E. Lorini, H. Prade, A novel view of analogical proportion between formulas, in: ECAI 2024: Proceedings of the 26th European Conference on Artificial Intelligence, IOS Press, 2024. URL: https://ebooks.iospress.nl/pdf/doi/10.3233/FAIA240624. doi:10.3233/FAIA240624, open Access under CC BY-NC 4.0.

[5] D. M. Gabbay, A. Kurucz, F. Wolter, M. Zakharyaschev, Many-Dimensional Modal Logics: Theory and Applications, volume 148 of *Studies in Logic and the Foundations of Mathematics*, Elsevier, Amsterdam, 2003.
# Towards number sequence completion through the analysis of number sequence patterns using numerical analogy

Yunhui Qi¹*, Yuxuan Yang¹ and Yves Lepage¹

¹Waseda University, 2-7 Hibikino, Kitakyushu, 808-0135, Japan

**Abstract**

We propose an approach to the analysis of sequences of numbers by visualizing their so-called analogical powers and generalized means as introduced in numerical analogy. Our method efficiently captures underlying patterns in various types of sequences, such as arithmetic, geometric, and Fibonacci sequences, by analyzing their distributional characteristics. Unlike traditional methods that rely on hand-crafted features or predefined pattern sets, our approach generalizes across diverse and complex sequence structures. Experimental results show that the proposed method distinguishes between different generative patterns, even for sequences with intricate or composite rules. These findings demonstrate the potential of extraction of numerical analogy features, envisioning its application to completion of sequences of numbers.

**Keywords**

Numerical analogy, sequences of numbers, pattern analysis

## 1. Introduction

Analogy, a fundamental aspect of human cognition, allows the derivation of conclusions based on relational similarities rather than direct attribute matching [1, 2]. This capability underpins the flexible and robust problem solving skills exhibited by humans, allowing them to generalize knowledge across diverse domains [3]. Consequently, analogy is widely recognized as a crucial capability to mimic for the development of artificial intelligence.

Analogical solving involves inferring an entity *D* that has the same relation to *C* as *B* has to *A*. The inferred entity *D* may be unique or may refer to any object that satisfies the specified relational pattern. The relationship is typically represented in the form of an expression such as *A*: *B* :: *C*: *D* read *A* is to *B* as *C* is to *D*. When the analogy holds, the relationship between *A* and *B* is identical to that between *C* and *D* [4] and to form a valid analogy, the relationship between *A* and *C* is identical to that between *B* and *D*.

Despite their widespread adoption in recent years, existing large language models continue to underperform on analogies that humans can easily handle, failing to match even basic human reasoning abilities. This highlights a persistent gap in their analogical reasoning capabilities [5, 6, 7]. For tasks in which humans rarely fail, current large language models still exhibit high error rates [8]. One classic example of such a task is the number sequence completion problem. This problem refers to the task of predicting the next element in a sequence given a segment of the sequence that follows a specific generative pattern, leveraging the model's reasoning and computational capabilities. The accuracy with which a model performs in completing a sequence of numbers is often considered a reflection of the intelligence and cognitive abilities of the model [9]. The number sequence completion problem can be viewed as a form of analogical reasoning. During the reasoning process, the model needs to extract underlying patterns from the given sequence segment and apply those patterns to predict the

IARML@IJCAI'2025: Workshop on the Interactions between Analogical Reasoning and Machine Learning, at IJCAI'2025, August, 2025, Montreal, Canada

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

qi_101@toki.waseda.jp (Y. Qi); yang98@asagi.waseda.jp (Y. Yang); yves.lepage@waseda.jp (Y. Lepage)

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

http://lepage-lab.ips.waseda.ac.jp/ (Y. Lepage)

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

0009-0004-7445-1813 (Y. Qi); 0009-0004-9323-2042 (Y. Yang); 0000-0002-3059-4271 (Y. Lepage)

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

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

<footnote>*Corresponding author.</footnote>
next element. Unlike traditional classification or regression tasks, this problem places greater emphasis on abstract modeling of implicit structures and the extension of patterns, thus embodying the core characteristic of analogical reasoning, obtaining global patterns from local observations [10].

Existing rule-based methods for solving number sequence completion either over-rely on handcrafted feature designs or are constrained by predefined pattern sets, generally lacking the ability to handle complex and varied number sequence completion tasks. To address this issue, this paper proposes an approach based on numerical analogy to represent sequences of numbers. Numerical analogy relies on the notion of generalized mean and analogical power to characterize in a unique way the relationship between four numbers [11]. We conducted experiments on common categories of sequences of numbers. Our results confirm that the distributional changes in the analogical power effectively capture the regularities in common number sequence categories.

This paper proposes a number sequence feature characterization method based on analogical power and generalized mean. By systematically calculating and visually presenting the analogical power and generalized mean for common sequences, the method attempts to extract the inherent characteristics of the sequences. Experiments were conducted on typical sequences, demonstrating the application of the proposed method on different types of sequences of numbers. The experimental results indicate that the analogical power and the generalized mean may effectively differentiate the generative patterns of various sequences. Our research lays the foundation for subsequent sequence prediction and pattern recognition studies based on these features, offering a novel approach to analyzing the regularities of sequences of numbers.

## 2. Related work

Over the past few decades, researchers have conducted systematic studies on the task of completion of sequences of numbers, proposing various methods based on pattern recognition and rule inference to enhance the reasoning accuracy and generalization ability of models.

In addressing number sequence problems, rule-based systems typically rely on analyzing hidden rules within the sequences to capture the regularity. For many common sequences, there may exist multiple relevant patterns and the order in which these patterns combine can vary. The necessity of feature analysis to uncover latent patterns in sequences of numbers has been emphasized and the following four features have been proposed in [12]:

1. Necessary background knowledge;

2. Numerical values;

3. Structural complexity;

4. Existence of a closed-form formula.

A systematic study on different types of sequences of numbers highlights the fact that sequences with simple numerical variations but complex structures are intuitively easy for humans to solve. Yet existing intelligent models often exhibit low accuracy when handling such sequences [13]. Building upon this, the Fluid Analogies Research Group (FARG) introduced their model series, aiming to simulate the human analogical reasoning process. Among these models, Copycat [14], Metacat [15] and SeqSee [16] are important milestones.

The SeqSee algorithm extends the Copycat and Metacat models by employing a dynamic grouping strategy to identify multiple potential patterns within sequences of numbers. Although SeqSee outperforms previous methods in reasoning with medium to short sequences, its reliance on exhaustive subsequence combinations leads to a significant decline in reasoning ability when patterns interact in complex ways or as the sequence length increases.

Building upon two supposed types of human intelligence, fluid intelligence and crystallized intelligence [17], the KitBit model was designed in view of addressing the number sequence completion problem [18]. KitBit predefines a set of over ten basic sequence patterns and performs sequence prediction through pattern combination matching and backward inference.
<table><caption>**Table 1**
Special cases of analogical power for $0 \le a \le b \le c \le d$</caption><thead><tr><th>Condition</th><th>Special case of analogical power p</th></tr></thead><tbody><tr><td>0 = a = b = c = d</td><td>any value in R<sub>+</sub> &cup; {+&infin;}</td></tr><tr><td>0 &ne; a = b = c = d</td><td>any value in R<sub>+</sub> &cup; {-&infin;, +&infin;}</td></tr><tr><td>0 = a = b and c &ne; d</td><td>0</td></tr><tr><td>0 &ne; a = b and c &ne; d</td><td>-&infin;</td></tr><tr><td>a &ne; b and c = d</td><td>+&infin;</td></tr></tbody></table>

### 3. Numerical analogy

By contrast to the previously mentioned works, this article explores how not to rely on predefined patterns but on the automatic identification of the relationships between successive numbers in a sequence. To this end, we propose the use of the notion of a numerical analogy.

The definition of numerical analogy is grounded in the concept of generalized means. The generalized mean of non-negative numbers $x_1, \dots, x_N$ is

$$m_p(x_1, \dots, x_N) = \lim_{r \to p} \left( \frac{1}{N} \sum_{i=1}^{N} x_i^r \right)^{\frac{1}{r}}$$

for all $p \in [-\infty, +\infty]$. Different values of $p$ correspond to different types of means, such as the arithmetic mean ($p = 1$), geometric mean ($p = 0$), and harmonic mean ($p = -1$).

Numerical analogy has been introduced to render an account of the fact that it is always possible to perceive an analogy between four given numbers. A numerical analogy $a : b :: c : d$ holds if and only if the generalized mean in $p$ of the two extremes $a$ and $d$ is equal to the generalized mean in $p$ of the two means $b$ and $c$ [19, 20]<fnref n="1" />. A numerical analogy is thus characterized by a number $p$, its so-called *analogical power*, which is unique in general. According to [11], given four positive real numbers $a, b, c, d \in \mathbb{R}^+ \setminus \{0\}$, the *numerical analogy in power p*, defined by

$$a : b :: p : c : d \stackrel{\text{def}}{\rightleftharpoons} m_p(a, d) = m_p(b, c)$$

For $p \neq 0$, this condition can be equivalently expressed as:

$$a^p + d^p = b^p + c^p.$$

For particular cases where the power is not unique, see Table 1. The following is an excerpt from [11]:

1. “Given four increasing positive real numbers, all different, we can always see an analogy between them and this analogy is unique.

2. Any analogy in $p$ between four positive real numbers can be reduced to an arithmetic analogy.

3. Conditioned on $p$, it is possible to solve any analogical equation with complex terms.”

This framework naturally generalizes classical analogies such as arithmetic ($p = 1$), geometric ($p = 0$), and harmonic ($p = -1$) analogies. Utilizing analogical powers to characterize the relationship between successive numbers in a sequence and spanning the entire sequence allows for a more direct and comprehensive characterization of patterns within sequences compared to traditional rule-based systems, such as KitBit, which rely on predefined computational templates and combinatorial arrangements.

<footnote n="1">¹Caution: the word *means* is used here in two separate senses: (1) the means in the analogy, i.e., *b* and *c*, by opposition to the extremes, i.e., *a* and *d*; and (2) the mean as a synonym of average, in particular, in the generalized *mean*.</footnote>
<table><caption>**Table 2**
Examples of simple sequences</caption><thead><tr><th>OEIS n°</th><th>Sequence</th><th>Formula</th><th>General form</th><th>Data</th></tr></thead><tbody><tr><td>A000012</td><td>Constant</td><td>a<sub>n</sub> = 1</td><td>a<sub>n</sub> = x</td><td>1, 1, 1, 1, 1, 1, 1, 1, 1, ...</td></tr><tr><td>A000027</td><td>Arithmetic</td><td>a<sub>n</sub> = n</td><td>a<sub>n</sub> = a + (n - 1)d</td><td>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...</td></tr><tr><td>A000244</td><td>Geometric</td><td>a<sub>n</sub> = 3<sup>n</sup></td><td>a<sub>n</sub> = a · r<sup>n-1</sup></td><td>3, 9, 27, 81, 243, 729, 2187, ...</td></tr><tr><td>A000290</td><td>Square Numbers</td><td>a<sub>n</sub> = n<sup>2</sup></td><td>a<sub>n</sub> = n<sup>q</sup></td><td>1, 4, 9, 16, 25, 36, 49, 64, 81, ...</td></tr><tr><td>A000142</td><td>Factorial</td><td>a<sub>n</sub> = n!</td><td>a<sub>n</sub> = n!</td><td>1, 2, 6, 24, 120, 720, 5040, ...</td></tr></tbody></table>

<figure><img src="image_9.png" /><figcaption>**Figure 1:** Trajectory figures of the simple sequences listed in Table 2. In red, the trajectory of the analogical power, in blue, the trajectory of the generalized mean. Notice that the vertical axes are different for each sequence.</figcaption></figure>

## 4. Numerical analogy for the inspection of sequences of numbers

We adopt the following general methodology in this study. Given a sequence of numbers, we use a four-element-long sliding window to compute the *analogical powers* and the *generalized means* for each consecutive quadruple. Taking the Fibonacci sequence as an example:

$$0, 1, 1, 2, 3, 5, 8, 13, 21, \dots$$

Consider the first window (0, 1, 1, 2). We aim to find the analogical power *p* such that:

$$m_p(0, 2) = m_p(1, 1)$$

which leads to the equation:

$$\left(\frac{0^p + 2^p}{2}\right)^{1/p} = \left(\frac{1^p + 1^p}{2}\right)^{1/p}$$

Solving this numerically, we find:

$$p \approx 1.0$$

Similarly, for the next window (1, 1, 2, 3), using the same procedure, we can get analogical power $p \approx -\infty$. Repeating this computation over all sliding windows, the resulting values are visualized as trajectories with respect to their corresponding sequence indices. On our example, the sequence will be: 1, $-\infty$, 0, 303 and so on.
<table><caption>**Table 3**
Examples of composite sequences</caption><thead><tr><th>OEIS n°</th><th>Sequence type</th><th>Formula</th><th>Data</th></tr></thead><tbody><tr><td>A000217</td><td>Triangular Numbers</td><td>a<sub>n</sub> = <sup>n(n+1)</sup>&frasl;<sub>2</sub></td><td>1, 3, 6, 10, 15, ...</td></tr><tr><td>A000108</td><td>Catalan Numbers</td><td>C<sub>n</sub> = <sup>(2n)!</sup>&frasl;<sub>(n+1)!n!</sub></td><td>1, 1, 2, 5, 14, ...</td></tr><tr><td>A075427</td><td>Double Operation Sequence</td><td>a(n) = <span style="font-size: 2em; vertical-align: middle;">{</span> a(n - 1) + 2, n is even<br>a(n - 1) × 2, n is odd<br><span style="font-size: 2em; vertical-align: middle;">}</span></td><td>1, 2, 3, 6, 7, 14, ...</td></tr><tr><td>A000045</td><td>Fibonacci</td><td>a<sub>n</sub> = <span style="font-size: 2em; vertical-align: middle;">{</span> 1, n = 1,2<br>a<sub>n-1</sub> + a<sub>n-2</sub>, n > 2<br><span style="font-size: 2em; vertical-align: middle;">}</span></td><td>1, 1, 2, 3, 5, 8, ...</td></tr></tbody></table>

## 4.1. Analogical power of simple sequences

We begin by analyzing a set of simple sequences of numbers. These simple sequences serve as building blocks in the construction of primitive recursive functions through the application of the composition operator. In particular, constant functions and the successor function which corresponds to a simple arithmetic progression are categorized as *basic primitive recursive functions* [21]. Sequences corresponding to such basic functions are found in the *Online Encyclopedia of Integer Sequences* (OEIS) [22, 23]. For each of the sequences listed in Table 2 we apply the sliding window and compute the analogical powers and the generalized means. The exact values for the first quadruples are given in the Supplementary material in Tables 5 and 6.

We do not plot the values of analogical powers and generalized means for constant sequences because, as an exception (see Table 1), the analogical power of an analogy between four equal numbers is not unique and can take any value in $\mathbb{R} \cup \{-\infty, +\infty\}$. Hence, scanning the sequence results in the infinite succession of the same analogical powers: $\mathbb{R} \cup \{-\infty, +\infty\}$.

We plot the analogical powers and generalized means as trajectories for the arithmetic, geometric and square number sequences in Figure 1. The analogical powers behave similarly: they are constant. A value of 1 corresponds to an arithmetic sequence, 0 to a geometric sequence, and 1/2 to the square number sequences. Indeed, more generally, a power of 1/q corresponds to a sequence of exponent q. Item 2 in the excerpt from [11] given in Section 3 allows to establish a result given in [19] which states that: $\forall(p, q) \in (\mathbb{R}^*)^2, \forall(a, b, c, d) \in (\mathbb{R}_+ \setminus \{0\})^4$,

$$a : b ::^{pq} c : d \Leftrightarrow a^q : b^q ::^p c^q : d^q \Leftrightarrow a^p : b^p ::^q c^p : d^p. \quad (1)$$

Note that the powers are non-null. Applied to quadruples in a power sequence, one has:

$$a^q : b^q ::^1 c^q : d^q \Leftrightarrow a : b ::^{1/q} c : d. \quad (2)$$

Hence, for a pure power function sequence with q as the exponent, the analogical power remains constant across all sliding windows and is equal to $1/q$. As shown in Figure 1, the square number sequence satisfies this relationship: as $q = 2$, all analogical powers are equal to 1/2.

The factorial sequence does not exhibit a constant behavior for the analogical powers. However, its looks like converging rapidly to a constant value, 0.

The previous results can be used in the task of number sequence completion. Thanks to Item 3 of Section 3, solving the analogy between the three last known elements of a sequence with a constant analogical power p for all successive quadruples, allows us to deduce the next element by solving the analogical equation $a_n : a_{n+1} ::^p a_{n+2} : x$. The solution x will be the next value $a_{n+3}$.

## 4.2. Analogical power of composite sequences

We define composite sequences as those constructed by combining simple sequences using the composition operator, the primitive recursion operator, or more elaborate computational constructs. Representative examples include triangular numbers, Catalan numbers, mixed operation recursive sequence and the Fibonacci sequence, all found in OEIS.
<figure><img src="image_10.png" /><figcaption>**Figure 2:** Same as Figure 1 for the composite sequences listed in Table 3. Again, notice that the vertical axes are different for each sequence.</figcaption></figure>

The mixed operation recursive sequence alternates between arithmetic and geometric operations, for example *2, +1, *2, +1. Such sequences also appear in OEIS. They are constructed by alternating between arithmetic operations (such as addition and subtraction) and geometric operations (such as multiplication and division). For example, the sequence A075427 is defined as shown in Table 3 with an initial value $a(0) = 1$. The beginning of the sequence is:

1, 2, 3, 6, 7, 14, 15, 30, 31, 62, 63, 126, 127, 254, 255, 510, 511, 1022, 1023, 2046, ...

We list such sequences in Table 3.

Similarly to simple sequences, we calculate the analogical powers and the corresponding generalized means. Numerical results are shown in Tables 7 and 8 in the Supplementary material. The trajectories are shown in Figure 2, aiming to identify more generalizable patterns across different types of sequences.

The triangular number sequence consists of numbers that represent the sum of the first $n$ natural numbers. From a formulaic perspective, the triangular number sequence can be interpreted as the product of two simple arithmetic sequences: 1, 2, 3, 4, ... and 2, 3, 4, 5, ... As observed in Section 4.1, arithmetic sequences have a constant analogical power of 1. In contrast, the triangular number sequence exhibits a regular but non-constant pattern in its analogical powers. The Catalan numbers form a sequence that frequently appears in combinatorial problems, such as counting the number of correct bracket expressions or the number of binary tree structures. Similarly, the Catalan sequence can be viewed as the product of three simple and closely related factorial sequences. Its analogical powers also exhibit a regular pattern of variation rather than a constant value. In both cases, the trajectory of analogical powers approximates a smooth curve and seems to converge to some value when $n$ becomes large.

Unlike the previous sequences, mixed operation recursive sequences exhibit a structural transformation that blends both arithmetic and geometric patterns. As shown in Figure 2, this characteristic is clearly reflected in the corresponding trajectories.

The Fibonacci sequence is a well-known integer sequence in which each term is the sum of the two preceding ones. It appears in various natural phenomena and is widely used in computational mathematics, number theory, and algorithm design. In Figure 2, we observe that the power fluctuates around 0 and tends towards 0 when $n$ tends to be large. We thus state that we have approximately the numerical analogy $F_n : F_{n+1} ::^0 F_{n+2} : F_{n+3}$ when $n$ is large. Using the definition of the Fibonacci recurrence, we get:

$$F_n \times (F_n + 2F_{n+1}) \approx F_{n+1} \times (F_{n+1} + F_{n+2})$$
<figure><img src="image_11.png" /><figcaption>**Figure 3:** Scatter diagram of analogical powers corresponding to the sequence of 10,000 digits of an irrational number. Special cases of non unique analogical powers and infinities (see Table 1) often occur. They are omitted from the visualization.</figcaption></figure>

Dividing both sides by $F_{n+1}^2$, we derive the following:

$$ \left( \frac{F_n}{F_{n+1}} \right)^2 + 2 \cdot \frac{F_n}{F_{n+1}} \approx 1 + \frac{F_n}{F_{n+1}} $$

We recognise the equation $x^2 + x - 1 = 0$ which is well-known to have the golden ratio $\varphi = \frac{1+\sqrt{5}}{2}$ as the only positive root. We thus find that $\frac{F_n}{F_{n+1}}$ tends asymptotically to the golden ratio when $n$ tends to $+\infty$, which is well-known.

The convergence of analogical powers to a certain value $p$ when $n$ is large allows to envisage an approximate computation of the next element in a sequence of numbers as was the case for sequences with a constant analogical power. Solving the analogical equation $a_n : a_{n+1} :: p a_{n+2} : x$ allows the determination of $a_{n+3}$ as the solution $x$. It remains of course to determine how exact the approximation is in each particular case.

### 4.3. Analogical powers of decimal expansions of irrational numbers

OEIS considers the decimal expansion of some mathematically important irrational numbers like $\pi$ and $e$ as sequences of numbers. $\pi$ is sequence n° A000720 and $e$ sequence A001113. We adopt the same method as above on them.

However an important point has to be mentioned. All the above studied sequences were sequences of increasing integer numbers. For that reason, the quadruples in a sequence were always in increasing order, which corresponds to one out of the 8 equivalent permutations of the terms that allows an analogy to arise. In the previous sections, we have kept any mention of orderings quiet. We cannot do so anymore for the case of a decimal expansion where quadruples of integers may take any of the three possible orderings: $a : b :: c : d$, $a : c :: d : b$ or $a : d :: b : c$.

Figure 3 shows the results of the computation of the analogical powers for the two above numbers. The colors of the points reflect the ordering in the quadruples. Here again, the special cases listed in Table 1 are excluded from the plots. We observe that analogical powers frequently concentrate around the values 0 and 1. This follows the distribution of analogical powers observed in random combinations of four digits with replacement. We also observe that they are framed between -3 and 6. This can also be experimentally confirmed by examining all possible analogies in four digits. As no clear conclusion can be drawn, this study would need further refinement to uncover potential structures and enable effective inference on irrational sequences of this kind.

### 4.4. Fitting approach for some sequences

Through our experiments on sequences of numbers, we observed that, as the sliding window progresses rightward, the analogical power of partial sequences tends to exhibit a smooth, curvilinear trend. We conducted curve-fitting attempts on several notably pronounced analogical power patterns, including
<caption>**Table 4**</caption>

Coefficient of determination ($R^2$) ranges from 0 to 1, with higher values indicating better fit. Root mean square error (RMSE) and mean absolute error (MAE measure prediction error—lower values are better. (AIC) and (BIC) are model selection criteria, where smaller values indicate a more optimal model.

<table><thead><tr><th rowspan="2">OEIS n°</th><th rowspan="2">Sequence</th><th rowspan="2">Fitted function</th><th colspan="5">Evaluation metrics</th></tr><tr><th>R<sup>2</sup></th><th>RMSE</th><th>MAE</th><th>AIC</th><th>BIC</th></tr></thead><tbody><tr><td>A000142</td><td>Factorial</td><td>-0.329x<sup>-1.303</sup></td><td>0.99896</td><td>0.00305</td><td>0.00267</td><td>-100.3</td><td>-99.9</td></tr><tr><td>A000217</td><td>Triangular</td><td>0.032e<sup>-0.618x</sup> + 0.5</td><td>0.99142</td><td>0.00039</td><td>0.00033</td><td>-308.1</td><td>-305.2</td></tr><tr><td>A000108</td><td>Catalan</td><td>-0.225x<sup>-1.424</sup></td><td>0.99847</td><td>0.00235</td><td>0.00207</td><td>-141.2</td><td>-140.3</td></tr></tbody></table>

<figure><img src="image_12.png" /><figcaption>**Figure 4:** Trajectory of the analogical power and generalized mean over the prime number sequence</figcaption></figure>

those from the triangular number sequence, and the Catalan number sequence. The preliminary results of these fitting attempts are summarized in Table 4. The fitted functions enable us to address sequence prediction. For instance, by estimating the next analogical power, the subsequent term can be deduced via solving an analogical equation.

The above results indicate that the analogical powers of these sequences approximately follow a simple curve pattern. This indicates that they hold potential for sequence prediction tasks. However, for other sequences, the trajectory may not form a smooth curve. It may oscillate, as in the case of the Fibonacci sequence, or it maybe difficult to directly see any obvious pattern, such as the prime number sequence A000040. The beginning of this sequence is:

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, ...

As shown in the figure 4, the sliding-window method adopted here is relatively simplistic and may not be sufficient for directly uncovering the underlying patterns of the prime number sequence. It serves merely as an initial attempt to explore sequence regularities. More advanced and comprehensive algorithms will be necessary in future work.

## 5. Conclusion

In this paper, we applied numerical analogy [11] to several common types of sequences of numbers from OEIS, aiming to uncover their underlying patterns. We proposed a novel approach to analyze number sequences as a preliminary step toward solving the sequence completion problem. We conducted experiments on representative simple sequences and composite sequences, plotting the trajectories of their analogical powers and generalized means to observe their behavioral patterns. The experimental results demonstrate that the analogical powers of some classical sequences exhibit distinct but regular patterns of variation: some remained constant, some converged toward a specific value, and others formed smooth curves. By quantifying these patterns, we were able to sketch how to predict the next
analogical power and, subsequently, the next element in a sequence, thereby opening the possibility for
a viable method for completion of sequences of numbers.

This work presented a preliminary exploration of discovering patterns in sequences of numbers using
generalized means and analogical powers. However, it should be noted that the methods proposed
in this paper are not sufficient for analyzing more complex sequences of natural numbers. Several
improvements can be considered, such as applying the method in a layered manner: first to the original
sequence, then to the sequence of its analogical powers or generalized means, and recursively again,
layer by layer, until a regular pattern emerges. The definition of what a regular pattern that allows
to halt requires more exploration and experimentation. Now, applying the recursive method enables
downward prediction across layers, which may lead to error propagation and inaccurate predictions at
the first layer. The deviation between the prediction and the ground truth can then be further examined
to assess the accuracy of the method, paving the way for more quantitative experiments beyond the
preliminary exploration presented in this article.
# 6. Supplementary material

<caption>**Table 5**</caption>

Analogical powers of simple sequences

<table><caption>**Table 6**</caption><thead><tr><th>Sequence type</th><th>Analogical powers</th></tr></thead><tbody><tr><td>Constant</td><td>R ∪ {−∞, +∞}, R ∪ {−∞, +∞}, R ∪ {−∞, +∞}, R ∪ {−∞, +∞}, ...</td></tr><tr><td>Arithmetic</td><td>1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, ...</td></tr><tr><td>Geometric</td><td>0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ...</td></tr><tr><td>Square Numbers</td><td>0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, ...</td></tr><tr><td>Factorial</td><td>−0.3271, −0.1397, −0.0803, −0.05322, −0.03837, −0.02927, −0.02323, ...</td></tr></tbody></table>

Generalized means of simple sequences

<table><caption>**Table 7**</caption><thead><tr><th>Sequence type</th><th>Generalized mean</th></tr></thead><tbody><tr><td>Constant</td><td>1, 1, 1, 1, 1, 1, 1, 1, 1, ...</td></tr><tr><td>Arithmetic</td><td>2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, ...</td></tr><tr><td>Geometric</td><td>15.58, 46.76, 140.29, 420.88, 1262.66, 3787.99, 11363.98, 34091.95, ...</td></tr><tr><td>Square Numbers</td><td>6.25, 12.25, 20.25, 30.25, 42.25, 56.25, 72.25, 90.25, 110.2, ...</td></tr><tr><td>Factorial</td><td>3.2981, 11.6044, 52.2888, 287.7292, 1870.6566, 14031.5487, 119276.0411, ...</td></tr></tbody></table>

Analogical powers of composite sequences

<table><caption>**Table 8**</caption><thead><tr><th>Sequence type</th><th>Analogical power</th></tr></thead><tbody><tr><td>Triangular</td><td>0.5183, 0.509, 0.5055, 0.5037, 0.5027, 0.502, 0.5016, 0.5013, ...</td></tr><tr><td>Catalan</td><td>−∞, −0.2233, −0.0891, −0.0487, −0.0308, −0.0213, −0.0156, −0.012, ...</td></tr><tr><td>Mix operation</td><td>0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, ...</td></tr><tr><td>Fibonacci</td><td>1, −∞, 0.3038, −0.1558, 0.0525, −0.021, 0.0079, −0.003, 0.0012, ...</td></tr></tbody></table>

Generalized means of composite sequences

<table><thead><tr><th>Sequence type</th><th>generalized mean</th></tr></thead><tbody><tr><td>Triangular</td><td>4.376, 7.8753, 12.3751, 17.875, 24.375, 31.875, 40.375, 49.875, ...</td></tr><tr><td>Catalan</td><td>1.0000, 3.0892, 8.2684, 24.0714, 74.0831, 237.0881, 781.0296, 2630.8950, ...</td></tr><tr><td>Mix operation</td><td>2.449, 4.500, 6.480, 10.500, 14.491, 22.500, 30.496, 46.500, 62.498, ...</td></tr><tr><td>Fibonacci</td><td>1, 1, 2.4648, 3.8534, 6.3337, 10.1917, 16.5265, 26.7184, 43.2449, 69.9634, ...</td></tr></tbody></table>
## References

[1] D. Gentner, Structure-mapping: A theoretical framework for analogy, Cognitive science 7 (1983) 155-170.

[2] P. Bartha, Analogy and analogical reasoning, in: E. N. Zalta, U. Nodelman (Eds.), The Stanford Encyclopedia of Philosophy, Fall 2024 ed., Metaphysics Research Lab, Stanford University, 2024.

[3] D. R. Hofstadter, Analogy as the core of cognition, The analogical mind: Perspectives from cognitive science (2001) 499-538.

[4] T. Mikolov, K. Chen, G. Corrado, J. Dean, Efficient estimation of word representations in vector space, arXiv preprint arXiv:1301.3781 (2013).

[5] T. Wijesiriwardene, R. Wickramarachchi, B. G. Gajera, S. M. Gowaikar, C. Gupta, A. Chadha, A. N. Reganti, A. Sheth, A. Das, Analogical-a novel benchmark for long text analogy evaluation in large language models, arXiv preprint arXiv:2305.05050 (2023).

[6] G. Gendron, Q. Bao, M. Witbrock, G. Dobbie, Large language models are not strong abstract reasoners (2024).

[7] X. Li, W. Wang, M. Li, J. Guo, Y. Zhang, F. Feng, Evaluating mathematical reasoning of large language models: A focus on error identification and correction, in: L.-W. Ku, A. Martins, V. Srikumar (Eds.), Findings of the Association for Computational Linguistics: ACL 2024, Association for Computational Linguistics, Bangkok, Thailand, 2024, pp. 11316-11360. URL: https://aclanthology.org/2024.findings-acl.673/. doi:10.18653/v1/2024.findings-acl.673.

[8] H. Al-Negheimish, P. Madhyastha, A. Russo, Numerical reasoning in machine reading comprehension tasks: are we there yet?, in: M.-F. Moens, X. Huang, L. Specia, S. W.-t. Yih (Eds.), Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, Online and Punta Cana, Dominican Republic, 2021, pp. 9643-9649. URL: https://aclanthology.org/2021.emnlp-main.759/. doi:10.18653/v1/2021.emnlp-main.759.

[9] A. M. Turing, Computing machinery and intelligence, Mind 59 (1950) 433-460.

[10] M. Akhtar, A. Shankarampeta, V. Gupta, A. Patil, O. Cocarascu, E. Simperl, Exploring the numerical reasoning capabilities of language models: A comprehensive analysis on tabular data, in: Findings of the Association for Computational Linguistics: EMNLP 2023, 2023, pp. 15391-15405.

[11] Y. Lepage, M. Couceiro, Towards a unified framework of numerical analogies: Open questions and perspectives, in: M. Couceiro, P.-A. Murena (Eds.), Proceedings of the Workshop Interactions between analogies and machine learning, colocated with IJCAI 2024 (IARML@IJCAI 2024), Miguel Couceiro, 2024, pp. 47-58. URL: https://hal.science/hal-04996117.

[12] U. Schmid, M. Ragni, Comparing computer models solving number series problems, volume 9205, 2015, pp. 352-361. doi:10.1007/978-3-319-21365-1_36.

[13] D. R. Hofstadter, Fluid concepts and creative analogies: Computer models of the fundamental mechanisms of thought., Basic books, 1995.

[14] M. Mitchell, Copycat: A computer model of high-level perception and conceptual slippage in analogy making, ProQuest Dissertations and Theses (1990) 308. URL: https://www.proquest.com/dissertations-theses/copycat-computer-model-high-level-perception/docview/303854208/se-2.

[15] J. B. Marshall, Metacat: A self-watching cognitive architecture for analogy-making and high-level perception, ProQuest Dissertations and Theses (1999) 291. URL: https://www.proquest.com/dissertations-theses/metacat-self-watching-cognitive-architecture/docview/304505056/se-2.

[16] A. A. Mahabal, Seqsee: A concept-centered architecture for sequence perception, ProQuest Dissertations and Theses (2010) 225. URL: https://www.proquest.com/dissertations-theses/seqsee-concept-centered-architecture-sequence/docview/598289634/se-2.

[17] J. L. Horn, R. B. Cattell, Refinement and test of the theory of fluid and crystallized general intelligences, Journal of educational psychology 57 (1966) 253.

[18] J. M. Gilpérez Aguilar, V. Corsino, L. Herrera, Kitbit: An AI cognitive model for solving intelligence test and numerical series, Institute of Electrical and Electronics Engineers (IEEE) (2022). URL: http://dx.doi.org/10.36227/techrxiv.19184858.v1. doi:10.36227/techrxiv.19184858.v1.

[19] Y. Lepage, M. Couceiro, Analogie et moyenne généralisée, in: J.-G. Mailly, F. Schwarzentruber,
A. Wilczynski (Eds.), Actes des 18es Journées d'Intelligence Artificielle Fondamentale et des 19es Journées Francophones sur la Planification, la Décision et l'Apprentissage pour la conduite de systèmes (JIAF 2024 et JFPDA 2024), La Rochelle, France, 2024, pp. 114-124. URL: https://hal.science/AFIA/hal-04620491v1.

[20] Y. Lepage, M. Couceiro, L'analogie numérique revisitée et étendue, précisée, rétrécie ou agrandie, in: J.-G. Mailly, F. Schwarzentruber, A. Wilczynski (Eds.), Actes des 19es Journées d'Intelligence Artificielle Fondamentale et des 20es Journées Francophones sur la Planification, la Décision et l'Apprentissage pour la conduite de systèmes (JIAF 2025 et JFPDA 2025), volume (accepted, to appear), Dijon, France, 2025.

[21] Z. Manna, Mathematical theory of computation, McGraw-Hill, 1974.

[22] N. J. Sloane, et al., The on-line encyclopedia of integer sequences, in: Towards Mechanized Mathematical Assistants, volume 4573 of Lecture Notes in Computer Science, Springer, 2007, pp. 130-130.

[23] N. J. Sloane, et al., The on-line encyclopedia of integer sequences, The Best Writing on Mathematics 2019 (2019) 90-119. doi:10.1515/9780691197944-009.
# Analogical pooling for image reconstruction

Jakub PILIMON¹,*, Miguel COUCEIRO² and Yves LEPAGE¹

¹Waseda University, IPS, Kitakyushu-shi, 808-0123, Japan

²INESC-ID, IST, Universidade de Lisboa, 1649-004 Lisboa, Portugal

**Abstract**

This article explores how analogy, in its numerical instance, can support the process of abstraction. For that, we introduce an aggregation function, that we call *analogical pooling*, and which is suitable for processing images. We explore how the information extracted during analogical pooling can be used in the reconstruction of images, reduced in size by the effect of pooling. We empirically analyse and compare reconstructed images with their original corresponding images. Although the experiments are preliminary, they clearly demonstrate the advantages of a numerical formalisation of analogy to efficiently abstract information from structured data and how this information can be exploited to reconstruct them.

**Keywords**

Analogy, Analogical inference, Image reconstruction, Pooling

## 1. Introduction

Analogical reasoning is the ability to identify parallels, repeated differences and commonalities, between problems, things, or situations, to analyse them and to infer generalisations or conclusions. Because analogical reasoning is considered as an indicator of intelligence, analogies are often proposed as tests to compute intelligence quotient (IQ) scores. For instance, the Raven's Progressive Matrices were created for that purpose [1]. They are non-verbal tests that require examinees to notice and analyse analogies between images in order to determine a missing piece in a set of geometrical figures that follow a pattern. The advantages or drawbacks of these tests have been rationally scrutinised [2, 3] and they are still reviewed and expanded. Even before the advent of recent generative models, these matrices have been used to assess the performance of AI systems [4, 5]. With the recent increase in performance of large generative models in various tasks, further considerations about what to measure [6, 7] led to the creation of larger public tests in the same vein (ARC, ConceptARC, RAVEN) [8, 9, 10].

The difficulty in solving analogical puzzles lies in the necessity of abstraction. Abstraction is thought to be at the core of generalisation, and is thus naturally considered an important faculty to attain in generative AI. Abstraction can be understood as a process by which information is

IARML@IJCAI'2025: Workshop on the Interactions between Analogical Reasoning and Machine Learning, at IJCAI'2025, August, 2025, Montreal, Canada

*Corresponding author.

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

pilimon.jakub@akane.waseda.jp (J. PILIMON); miguel.couceiro@inesc-id.pt (M. COUCEIRO);

yves.lepage@waseda.jp (Y. LEPAGE)

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

http://lepage-lab.ips.waseda.ac.jp/ (Y. LEPAGE)

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

0000-0003-2316-7623 (M. COUCEIRO); 0000-0002-3059-4271 (Y. LEPAGE)

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

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

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

CEUR Workshop Proceedings (CEUR-WS.org)
expressed in a reduced format that still enables the reconstruction of objects. A way of solving analogy puzzles is to recombine the abstracted information to generate the solution.

In this article, we shall not address the complete task of solving analogy puzzles, but we explore the use of numerical analogy in abstraction and reconstruction of images. We focus on the process that allows us to separate the information contained in an object into two types of information. The first type (a) is the information representing an abstracted similar object. It is usually obtained by pooling or aggregation. The second type (b) is the information that is extracted during pooling or aggregation. Combined with the abstracted object, it should allow the reconstruction of the initial object. The final reconstructed object might not be exactly equal to the initial object, as it will reflect the abstraction made about it. In addition, because the previous information might not be sufficient, we will also consider a third type (c): some part of the original object will be memorized so as to help in the reconstruction process.

## 2. Numerical analogies

The use of analogy on numerical data has long been confined to Boolean settings or reduced to arithmetic analogy. The arithmetic analogy limits the interpretation of analogy to an equality of differences. It assumes that the representation space is linear. However, this is not necessarily the case depending on the data being processed: calculating the difference between vectors does not necessarily respect the distribution of the data. This is the case for images of physical objects.

A recent proposal [11, 12, 13] generalizes numerical analogy beyond Boolean values and arithmetic analogies. A numerical analogy is characterized by its analogical power. Images are matrices of numerical values and the application of the new formalization is possible there.

The formalization of numerical analogy relies on the notion of generalized means. For any $p \in \mathbb{R} \cup \{-\infty, +\infty\}$, the generalized mean $m_p(x_1, \dots, x_N)$ of $N$ non-negative real numbers $x_1, \dots, x_N$ is defined as follows.

$$m_p(x_1, \dots, x_N) = \lim_{r \to p} \left( \frac{1}{n} \sum_{i=1}^{N} x_i^r \right)^{1/r} \quad (1)$$

The generalized mean corresponds to the arithmetic mean for $p = 1$; the harmonic mean for $p = -1$; the quadratic mean for $p = 2$; the geometric mean when $p$ tends to $0^1$; the maximum when $p$ tends to $+\infty$; the minimum when $p$ tends to $-\infty$. Generalized means are quasi-arithmetic means [14].

Let $p$ be a real number or possibly $-\infty$ or $+\infty$, and $a, b, c$ and $d$ four non-negative real numbers with $0 \le a \le b \le c \le d$. Following [11], we say that there is a numerical analogy in power $p$, noted as shown below, if and only if:

$$a : b ::^p c : d \stackrel{\text{def.}}{\iff} m_p(a, d) = m_p(b, c). \quad (2)$$

In an analogy $a : b ::^p c : d$, the terms $a$ and $d$ are called the extremes and the terms $b$ and $c$ are called the means.

$$^1\lim_{p \to 0} m_p(x_1, \dots, x_N) = \sqrt[N]{\prod_{i=1}^{N} x_i}.$$
**Analogical mean** We define the *analogical mean* of four non-negative real numbers $0 \le a \le b \le c \le d$ as the generalized mean $m_p(a, b, c, d)$ of these four numbers for a numerical analogy $a : b ::^p c : d$. It is easy to show that $m_p(a, b, c, d) = m_p(a, d) = m_p(b, c)$ by relying on the properties of quasi-arithmetic means and the definition of a numerical analogy. For example, because there exists an analogy $2 : 4 ::^p 6 : 8$ with $p = 1$ between the values 2, 4, 6, 8, there analogical mean is 5. We have $m_1(2, 4, 6, 8) = m_1(2, 8) = m_1(4, 6) = 5$.

**Orderings** Symmetry of arguments in generalized means (from the axioms of quasi-arithmetic means) allows swapping the two extremes or swapping the two means in Eq. (2). Symmetry of equality also applies in Eq. (2). This results in eight equivalent forms of the same analogy. It is thus important to note that are only three distinct possible orderings of numbers $a : b ::^p c : d$, $a : c ::^p d : b$ and $a : b ::^p d : c$, that may lead to an analogy [12]. In general only one of these orderings leads to a numerical analogy.

**Analogical power** In a numerical analogy, $p$ is called the *analogical power*. [12] shows that such a $p$ exists for any quadruple of non-negative real numbers sorted in increasing order or in one of the eight orders that would allow to sort them in increasing order, by application of swapping the extremes, or the means, or exchanging the two means with the two extremes.

## 3. Pooling

Pooling has been present in convolutional networks applied to image processing since the beginning [15, 16]. It founds the U-Net architecture [17]. It consists in replacing a patch of pixels with one value obtained by computing some function of the values of the pixels composing the patch. As the patch is replaced by one pixel containing this value, the application of pooling reduces the size of the image. For this reason, pooling is indeed a filtering operation or an aggregation operation.

### 3.1. Max-pooling, average-pooling and generalized-mean-pooling

In max-pooling and average-pooling a patch of pixels is replaced with the maximum of the values in the patch or with their average.

Generalized-mean-pooling is a generalization of the two previous pooling methods [18, 19]. It relies on the observation that the maximum is the generalized mean for $p = +\infty$ and the average the case of the arithmetic mean where $p = 1$. Its introduction in convolutional networks for image processing was motivated by the idea that a neural network should determine by itself which generalized mean to apply, with $p$ scanning the entirety of $\mathbb{R} \cup \{-\infty, +\infty\}$. Hence, for each patch, a different value $p$ is determined by back-propagation.

### 3.2. Analogical pooling

In this article, we propose *analogical pooling*. It is a variation of generalized-mean-pooling in two aspects. Firstly, there is no freedom in the determination of the appropriate power, as it
<figure><img src="image_18.png" /><figcaption>**Figure 1:** On the first row, analogical pooling applied on images step by step from *left* to *right*. The input on the *left* has 28 × 28 pixels and the following images 27 × 27 pixels, 26 × 26 pixels and 25 × 25 pixels, respectively. The second row visualizes orderings and analogical powers across the images. *Red, green and blue* represent the three orderings described in Section 2. The intensity of the color represents the analogical power — a more intense color indicates a larger value of the power. Additionally, *yellow* represents the situation, where all four pixels in a patch have the same value.</figcaption></figure>

is determined by the numerical analogy between the values in the patch. Secondly, the use of analogy entails a limitation on the size of patches used. They can only be patches of four pixels as there are only four terms in an analogy.

For an image of size (*c*, *h*, *w*), where *c* is the number of channels, *h* and *w* are height and width, analogical pooling processes the image into two types of information.

(a) The first type is an image with a reduced size of (*h* − 1) × (*w* − 1) which contains the values of the analogical means of each 2 × 2 patch in the original image. The entire image is covered by using a stride of 1. This is illustrated on the first row in Figure 1.

(a) The second type of information is the ordering and the power for each 2 × 2 patch of the original image. Because there are basically three orderings and because an analogical power is a real number, the amount of information extracted per pixel is two bits plus a real number. This is illustrated on the second row in Figure 1.

Analogical pooling can be applied iteratively step by step to a square image down to the point where the final image is reduced to one pixel. The process can be stopped at any step. Figure 1 illustrates the first 4 steps on a gray image with one channel. For each step, we call the image on which analogical pooling is applied the *previous image* and the image containing the analogical means the *next image*.
<figure><img src="image_19.png" /><figcaption>**Figure 2:** Three examples in the possible configurations for the extremes (in pink) and the means (in blue) in a squared patch of 2 × 2 pixels. From left to right, the means and the extremes are arranged horizontally, vertically and diagonally. For each of the three configurations, there exist 8 possibilities where the two extremes and the two means are exchanged, or where the extremes or the means are exchanged independently. This figure shows only one of them.</figcaption></figure>

### 3.3. Amount of information extracted in analogical pooling

For each 2 × 2 pixel patch, the configuration of the extremes and the means in the patch is first determined by sorting the four values of the patch in increasing order. Three possible configurations, that correspond to orderings (see Section 2), exist depending on how the extremes and the means are positioned in the patch. Figure 2 gives examples in the three possible configurations.

During analogical pooling, for every patch, three values (for each channel) are extracted, corresponding to the two types of information mentioned in the introduction:

(a) first type: $m$, the analogical mean (a real number);

(b) second type:

(b.1) $o$, the ordering of the 4 values of the pixels (3 possibilities that amount to 2 bits);

(b.2) $p$, the analogical power (a real number).

For a patch of four pixels, i.e., 4 real numbers, the amount of information extracted is thus 2 real numbers and 2 bits, which is strictly less than 3 real numbers. In total thus, the amount of information extracted as a result of analogical pooling on an entire image of size $c \times h \times w$ is $c \times (h-1) \times (w-1) \times 2 \times (r+1)$ bits where $r$ is the number of bits needed to represent a real number.

## 4. Reconstruction of an image

In this section, we describe the reconstruction from an image of shape $(c, h-1, w-1)$ (the next image), the corresponding analogical information array of the same shape and a set of memorized pixels, back into an image of shape $(c, h, w)$ (the previous image) as shown in Figure 6, after the Conclusion. We first explore the different cases for the reconstruction of pixels within patches and then propose a method to reconstruct the entire image.

### 4.1. Reconstruction of a patch

To determine how many pixels within a 2 × 2 patch can be reconstructed utilizing the knowledge of the analogical power, the ordering and the analogical mean, we logically examine all cases
<figure><img src="image_20.png" /><figcaption>**Figure 3: First patch:** A patch containing a known pixel $v_k$ and three unknown pixels $v_1, v_2, v_3$. **Second patch:** The two unknown pixels marked with a tick can be reconstructed from the two known pixels $v_{k_1}$ and $v_{k_2}$. **Third patch:** Neither of the two unknown pixels marked with a cross can be reconstructed from the two known pixels $v_{k_1}$ and $v_{k_2}$. **Four patch:** The unknown pixel marked with a tick can be reconstructed from the three known pixels.</figcaption></figure>

depending on the number of pixels known in advance in the patch. This number ranges from 0 to 4.

**Zero pixels known out of four.** The first case is when no pixel from the original image is known. Still, the analogical mean and the analogical power are known in addition to the ordering. Nothing can be reconstructed, except in the particular case where the analogical power takes any value in $\mathbb{R} \cup \{-\infty, +\infty\}$. This occurs if and only if all four pixels are equal. In this particular case, the value of each of the four pixels is the analogical mean.

**One pixel known out of four.** The second case is when one pixel only in the original patch is known. The possibilities of reconstruction depend on whether the analogical power is finite.

When $p \neq \pm\infty$, the knowledge of the ordering $o$ tells where the means and the extremes are in the patch. Consequently, it is known whether the known pixel is one of the extremes or one of the means. The first patch in Figure 3 illustrates this case.

If the known pixel is one of the extremes, and thanks to the knowledge of $p$ and $m$, it is possible to compute the value of the other extreme by solving the following equation.

$$m_p(v_k, x) = m \Rightarrow x = (2m^p - v_k^p)^{1/p}. \qquad (3)$$

The two means cannot be computed, but by definition of the means, they are framed between the extremes. An arbitrary decision can be made for their values within these bounds.

If the known pixel is one of the means, this time, the other mean can be computed by solving Eq. (3). The extremes cannot be computed, but it is possible to frame them, with an ambiguity.<fnref n="2" />

In the case $p = \pm\infty$, the generalized mean is the minimum or the maximum function $m_{-\infty}(a, b) = \min(a, b)$ or $m_{+\infty}(a, b) = \max(a, b)$. This gives a bound when solving Eq. (3). If $v_{k_1} = m$, any value greater or lower than $m$ will satisfy Eq. (3), making the reconstruction ambiguous. Due to this limitation, in the experiments reported in this article, which are preliminary, noise is added to the original image to avoid any situation where a power of $-\infty$ or $+\infty$ would arise. Since $p = \pm\infty$ occurs only if at least 2 out of 4 pixels have the same value, adding noise gives all pixels a different value, which eliminates the case.

<footnote n="2">²One is greater than the max of the means, and the other one is less than the min of the means. In our experiments, the min and max values are known: 0 and 255. Hence, the other bound for each of the extremes is 0 for the smaller extreme and 255 for the max possible value for the greater extreme.</footnote>
<figure><img src="image_21.png" /><figcaption>**Figure 4:** Steps in the reconstruction of an image. Gray squares represent known pixels, white squares represent unknown pixels. Dashed lines represent areas of patches with 3 known pixels. The knowledge of the first row and the first column ensures the total reconstruction of the image diagonal after diagonal.</figcaption></figure>

**Two pixels known out of four.** If $p \neq \pm\infty$, two cases occur: either we can compute the values of all the remaining pixels, or we can reconstruct nothing at all. These two cases are shown in the middle of Figures 3. If the two known pixels are both extremes (*resp.*, both means), there exists an infinity of possibilities for the means (($resp.$, extremes)) and we cannot conclude. If the two pixels are one an extreme and the other one a mean, it is possible to compute the two other missing values, thanks to the knowledge of *m* and *p*, as in Eq. (3). If $p = \pm\infty$, the same considerations as in the case where only one pixel was known apply.

**Three pixels known out of four.** If $p \neq \pm\infty$, we can compute the value of the unknown pixel, again using Eq. (3). This is illustrated by the last patch of Fig. 3. If $p = \pm\infty$, the same considerations as in the case where only one pixel was known apply.

**Four pixels known out of four.** Obviously, in this case, everything being known, there is nothing to reconstruct. As we will see below, such a patch should be removed from a list of patches to be reconstructed.

## 4.2. Reconstruction of an entire image

The algorithm for the reconstruction of an entire image proceeds by scanning the entire image and building a list of patches with at least one unknown pixel. Each patch can be scored by a scoring function that takes as an input a patch together with its corresponding power, ordering and mean, and outputs an integer between 0 and 4 that gives the number of pixels that will remain unknown after the reconstruction of unknown pixels as described above in Section 4.1. The list of patches is sorted by increasing order of score (see Figure 4).

At each iteration step, the list is computed again (completely reconstructed patches are not considered in the list), the scores are computed again, the list is sorted, and reconstruction is performed. If the list is empty at some iteration step, the entire image has been reconstructed, and the algorithm terminates. However, it may be the case that the list stays non empty because some patches cannot be reconstructed and thus cannot be removed from the list. For that at the end of each iteration step, the lists before and after the iteration are compared. If they are equal the algorithm terminates. In this case, because exact reconstruction cannot be achieved, each missing pixel is filled with a value that is reasonable in the context of the patch that it belongs to, i.e., in practice, the analogical mean of the patch.
# 5. Empirical study

In this section we present some empirical results illustrating the reconstruction process involving
analogical pooling on a particular dataset.

## 5.1. Data

Our experiments use the MNIST dataset [15] - a standard and well-known set that is widely used in the image processing field.<fnref n="3" /> This is a set of 70,000 images of handwritten digit images with one channel of gray ($c = 1$) of values extending from 0 (white) to 255 (black). They are square images with height and width of 28 ($h = w = 28$). In the preliminary experiments reported in this article, Gaussian noise was added to every image to avoid cases described in Section 4.1.

## 5.2. Experimental setup

We reconstruct original images from the information obtained after a certain step of pooling. The goal of the experiments is to compare the reconstructed image to the original image. We perform reconstruction and comparison for each possible steps of pooling, i.e., for steps 1 to 27 for the MNIST images.

To reconstruct the original image, we use the information of types (a) and (b) extracted at the step we start from, plus a set of memorized pixels as described below in Section 5.3. The process is repeated iteratively until the original image.

## 5.3. Configurations of pixels memorized from the previous image

The minimal number of pixels needed to reconstruct images in all cases is to be determined experimentally. This is outside of the scope of this article. This number can be estimated as $h + w - 1$ because the 4th pixel can always be reconstructed from 3 known pixels (as long as $p \neq \pm\infty$) and the reconstruction can be performed diagonal after diagonal as illustrated in Figure 4. Choosing the $h + w - 1$ pixels on the first row and the first column in the image will ensure the entire reconstruction.

This leaves us with freedom of choice regarding the position of the row and the column. Four configurations were tested in our experiments:

* Top-left corner: the memorized row and column are the first row and the first column at each iteration.

* Random corner: the corner for the row and column are randomly chosen at each iteration. In our experiments, in every even iteration the top-left corner and is used and in every odd iteration the bottom-right corner is used.

* Central cross: the memorized row and column form a cross in the center of the image. The reconstruction starts in the center and proceeds in four quadrants from the center to each corner of the image.

<footnote n="3">³Other datasets have already been tested as well (including 3-channel RGB datasets). However, this paper being focused on introducing the method, we only report the results on MNIST.</footnote>
<figure><img src="image_22.png" /><figcaption>**Figure 5:** The value of different metrics plotted against the number of reconstruction steps. Top left: MSE, top right: PSNR, bottom left: SSIM, bottom right: LPIPS</figcaption></figure>

• Elementary crosses: the memorized pixels are $n = \lfloor(w + h)/5\rfloor$ elementary $3 \times 3$ crosses randomly distributed on the image. As every $3 \times 3$ cross contains 5 pixels, $\lfloor(28 + 28)/5\rfloor \cdot 5 = 55$ pixels memorized in a $28 \times 28$ MNIST image.

## 5.4. Used metrics

The following metrics are used in order to assess the quality of the reconstructed images:

• Mean Squared Error (MSE). It calculates the average of the squared pixel-by-pixel differences between two images, here the original and the reconstructed images. The lower the better.

• Peak Signal to Noise Ratio (PSNR). It quantifies how much signal (image content) is preserved relative to the noise (error). The higher the better. If $L$ is the maximum value for a pixel in an image, then PSNR is defined as: $\text{PSNR} = 10 \cdot \log_{10} \left( \frac{L^2}{\text{MSE}} \right)$.
* Structural Similarity Index Measure (SSIM). It assesses the visual similarity between two images and aims to model human visual perception more closely than MSE or PSNR [20]. The higher the better.

* Learned Perceptual Image Patch Similarity (LPIPS). It measures how perceptually different two images are, based on how similar their representations are in deep feature space. The lower the better. [21].

## 5.5. Results

The graphs in Figure 5 show the reconstruction errors averaged over all digits for all the previously described metrics. All methods achieve perfect reconstruction at the beginning (corresponding to 0 reconstruction steps) and exhibit a steep increase in the error for the first 15 steps, after which the error plateaus. The best performing method on average is the *central cross* and the worst is the *top-left corner*. Out of the four metrics, only the SSIM metric, which supposedly reflects human judgment, favors the *elementary crosses* over *central cross*. The *random corner* method shows the most variance — the error curve is not as smooth as for the other methods.

Reconstructed images using the central cross configuration for memorized pixels are shown in Figure 8 starting from various pooling steps: 1, 9, 18 and 27. The reconstruction from step 27 consists in reconstructing the image from one pixel, plus, of course, knowledge of (b) in all intermediate steps.

The computation of one step of pooling (of a 28 × 28 MNIST image) takes around 90 ms and the reconstruction of one step takes around 210 ms<fnref n="4" />. All 27 pooling steps on average take 650 ms and 27 steps of reconstruction take 1800 ms.

## 6. Conclusion

Motivated by recent advances in the formalization of numerical analogies, we proposed analogical pooling and leveraged it for reconstructing structured data. We illustrated the potential of this analogy-based approach for image reconstruction. We also proposed several variants and analyzed their impact on the reconstruction of entire images.

This innovative approach opens up new avenues for future work and potential applications of analogical reasoning. Firstly, it raises the question of the sufficient amount of memorized pixels needed for exact reconstruction, and whether such pixels are needed at all. Secondly, even though we only conducted experiments with images with one channel (gray), it seems to naturally generalize to images with several channels (colors), while keeping a linear computational cost in the number of channels. Thirdly, this brings some hope to efficiently solving complex tasks, such as the ones mentioned in the introduction, i.e., Raven progressive matrices, RAVEN, ARC, or ConceptARC. Fourthly, it also sheds some light on how the use of numerical analogy could contribute to the process of abstraction and guide high level competence analogical reasoning.

From a practical point of view, future work will subsume further quantitative evaluation, further empirical studies on more complex datasets, integration with neural architectures, application into further downstream tasks involving structured data. Moreover, we will explore suitable

<footnote n="4">⁴Calculation performed on Intel Core i5-9300HF.</footnote>
<figure><img src="image_23.png" /><figcaption>**Figure 6:** The image on the *left* is subjected to analogical pooling. As a result, (a) a pooled image and (b) an array containing orderings and analogical powers are produced. These two types of information are used in the reconstruction on the *right*, in combination with a set of pixels memorized from the original image, here the top-left corner, i.e., the first row and the first column.</figcaption></figure>

uncertainty and plausibility measures, which will enable reasoning with different analogical degrees.

## Acknowledgements

This work was supported by the French ANR<sup>5</sup> project "Analogies: from theory to tools and applications" (AT2TA), ANR-22-CE23-0023.

## Declaration on Generative AI

The authors have not employed any Generative AI tools.

<footnote n="5"><sup>5</sup>Agence Nationale de la Recherche.</footnote>
<figure><img src="image_24.png" /><figcaption>**Figure 7:** On the *left*, memorizing only the pixels along the diagonals marked in gray is sufficient to reconstruct the other remaining pixels. The orderings are highlighted by the arrows in the image on the right (analogous to Figure 2). In contrast to that, on the *right* is an example of a 4 × 4 image that can be reconstructed starting from only 2 pixels, the ones marked in gray.</figcaption></figure>
<figure><img src="image_25.png" /><figcaption>**Figure 8:** Reconstruction of MNIST digit images from different analogical pooling steps with the central cross configuration for memorized pixels.</figcaption></figure>
## References

[1] J. Raven, The Performances of Related Individuals in Tests Mainly Educative and Mainly Reproductive Mental Tests Used in Genetic Studies, University of London (King's College), 1936.

[2] J. Raven, J. Raven (Eds.), Uses and Abuses of Intelligence: Studies Advancing Spearman and Raven's Quest for Non-Arbitrary Metrics., Royal Fireworks Press, Unionville, New York, 2008.

[3] M. Ragni, S. Neubert, Computational approaches to analogical reasoning: current trends, number 548 in Studies in computational intellignece, Springer Verlag Berlin Heidelberg, 2014, pp. 351–370. URL: https://link.springer.com/chapter/10.1007/978-3-642-54516-0_14.

[4] H. Prade, G. Richard, Computational approaches to analogical reasoning: current trends, number 548 in Studies in Computational Intelligence, Springer Verlag Berlin Heidelberg, 2014, pp. 217–244. URL: https://link.springer.com/chapter/10.1007/978-3-642-54516-0_9.

[5] T. Webb, K. J. Holyoak, H. Lu, Emergent analogical reasoning in large language models, Nature Human Behaviour 7 (2023) 1526–1541. URL: https://doi.org/10.1038/s41562-023-01659-w. doi:10.1038/s41562-023-01659-w.

[6] H. Prade, G. Richard, Analogical proportions: why they are useful in AI, in: Z.-H. Zhou (Ed.), Proceedings of the 30th International Joint Conference on Artificial Intelligence (IJCAI 2021). International Joint Conferences on Artificial Intelligence Organization, 2021, pp. 4568–4576. URL: https://doi.org/10.24963/ijcai.2021/621. doi:10.24963/ijcai.2021/621, survey Track.

[7] F. Chollet, On the measure of intelligence, CoRR abs/1911.01547 (2019). URL: http://arxiv.org/abs/1911.01547. arXiv:1911.01547.

[8] A. K. Moskvichev, V. V. Odouard, M. Mitchell, The ConceptARC benchmark: Evaluating understanding and generalization in the ARC domain, Transactions on Machine Learning Research (2023). URL: https://openreview.net/forum?id=8ykyGbtt2q.

[9] F. Chollet, 2023, The abstraction and reasoning corpus (ARC), URL: https://github.com/fchollet/ARC.

[10] C. Zhang, F. Gao, B. Jia, Y. Zhu, S.-C. Zhu, RAVEN: a dataset for Relational and Analogical Visual REasoNing, in: Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2019), 2019, pp. 5312–5322. doi:10.1109/CVPR.2019.00546.

[11] Y. Lepage, M. Couceiro, Analogie et moyenne généralisée, in: J.-G. Mailly, F. Schwarzentruber, A. Wilczynski (Eds.), Actes des 18es Journées d'Intelligence Artificielle Fondamentale et des 19es Journées Francophones sur la Planification, la Décision et l'Apprentissage pour la conduite de systèmes (JIAF 2024 et JFPDA 2024), La Rochelle, France, 2024, pp. 114–124. URL: https://hal.science/AFIA/hal-04620491v1.

[12] Y. Lepage, M. Couceiro, Towards a unified framework of numerical analogies: Open questions and perspectives, in: Proceedings of the IARML@IJCAI 2024 Workshop on the Interactions between Analogical Reasoning and Machine Learning, CEUR-WS.org, 2024, pp. 1–13. URL: https://iarml2024-ijcai.loria.fr/files/2024/07/Article_MY_IARML_IJCAI2024-7.pdf.
[13] Y. Lepage, M. Couceiro, L'analogie numérique revisitée et étendue, précisée, rétrécie ou agrandie (accepted, to appear), in: J.-G. Mailly, F. Schwarzentruber, A. Wilczynski (Eds.), Actes des 19es Journées d'Intelligence Artificielle Fondamentale et des 20es Journées Francophones sur la Planification, la Décision et l'Apprentissage pour la conduite de systèmes (JIAF 2025 et JFPDA 2025), Dijon, France, 2025, pp. 1-12.

[14] M. de Carvalho, Mean, what do you mean?, The American Statistician 70 (2016) 270-274. URL: https://doi.org/10.1080/00031305.2016.1148632. doi:10.1080/00031305.2016.1148632.

[15] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, L. D. Jackel, Backpropagation applied to handwritten zip code recognition, Neural Computation 1 (1989) 541-551. doi:https://doi.org/10.1162/neco.1989.1.4.541.

[16] Y. Lecun, L. Bottou, Y. Bengio, P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE 86 (1998) 2278-2324. doi:10.1109/5.726791.

[17] O. Ronneberger, P. Fischer, T. Brox, U-Net: Convolutional networks for biomedical image segmentation, in: N. Navab, J. Hornegger, W. M. Wells, A. F. Frangi (Eds.), Medical Image Computing and Computer-Assisted Intervention (MICCAI 2015), Springer International Publishing, Cham, 2015, pp. 234-241. doi:10.1007/978-3-319-24574-4_28.

[18] C.-Y. Lee, P. W. Gallagher, Z. Tu, Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree, in: Proceedings of the 19th International Conference on Artificial Intelligence and Statistics (AISTATS), JMR: W&CP, volume 51, Cadiz, Spain, 2016, pp. 464-472. URL: http://proceedings.mlr.press/v51/lee16a.pdf.

[19] J. Yao, Y. Li, B. Yang, C. Wang, Learning global image representation with generalized-mean pooling and smoothed average precision for large-scale cbir, IET Image Processing 17 (2023) 2748-2763.

[20] Z. Wang, A. C. Bovik, H. R. Sheikh, E. P. Simoncelli, Image quality assessment: from error visibility to structural similarity, IEEE Transactions on Image Processing 13 (2004) 600-612. doi:10.1109/TIP.2003.819861.

[21] R. Zhang, P. Isola, A. A. Efros, E. Shechtman, O. Wang, The unreasonable effectiveness of deep features as a perceptual metric, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2018), Salt Lake City, Utah, 2018, pp. 586-595. URL: https://openaccess.thecvf.com/content_cvpr_2018/papers/Zhang_The_Unreasonable_Effectiveness_CVPR_2018_paper.pdf.
# Which Pairs to Choose? Exploring Analogical Competency for Knowledge Graph Pruning

Ndeye-Emilie Mbengue<fnref n="1" />,*, Miguel Couceiro<fnref n="2" />, Yves Lepage<fnref n="3" /> and Pierre Monnin<fnref n="4" />

## Abstract

Analogical reasoning is based on analogical proportions of the form $A : B :: C : D$ that can be read "A is to B as C is to D". This type of reasoning has demonstrated its potential in enhancing machine learning algorithms, both in explainability and extrapolation. However, a crucial element lies in the choice of left-pairs (A, B) used to extrapolate on new situations (C, D). In this paper, we propose to guide such a selection process by introducing different notions of competency that can be applied in the training or inference phases. We evaluate their impact on a binary classification task, namely knowledge graph pruning, and empirically demonstrate that competency-based selection not only improves the performance of the analogical reasoning model but also helps in reducing the number of necessary (A, B) pairs for accurate extrapolations. Our results open new perspectives to explore the impact of competency-based selection on knowledge graph-related tasks and models.

## Keywords

Analogical Reasoning, Competency, Compression, Knowledge Graph, Pruning

## 1. Introduction

Analogical proportions are statements of the form “A is to B as C is to D”, e.g., “Paris is to France as Berlin is to Germany”, and are denoted by quadruples $A : B :: C : D$. They constitute a natural way for humans to reason about unfamiliar situations by drawing from known ones [1]. This form of reasoning thus consists in two steps: (i) detecting an analogy, and (ii) extrapolating the outcome of a new situation based on a past outcome. It is worth noting that analogical reasoning can also be leveraged in machine learning to improve generalization beyond the limits of train data objects [2]. In this view, its effectiveness has already been demonstrated across various domains, such as Natural Language Processing (NLP) [3, 4], or tasks involving

IARML@IJCAI'2025: Workshop on the Interactions between Analogical Reasoning and Machine Learning, at IJCAI'2025, August, 2025, Montreal, Canada

*Corresponding author.

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

ndeye-emilie.mbengue@loria.fr (N. Mbengue); miguel.couceiro@inesc-id.pt (M. Couceiro);

yves.lepage@waseda.jp (Y. Lepage); pierre.monnin@inria.fr (P. Monnin)

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

https://scholar.tecnico.ulisboa.pt/authors/ist430030 (M. Couceiro); http://lepage-lab.ips.waseda.ac.jp/ (Y. Lepage);

https://pmonnin.github.io/ (P. Monnin)

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

0009-0002-1289-6417 (N. Mbengue); 0000-0003-2316-7623 (M. Couceiro); 0000-0002-3059-4271 (Y. Lepage);

0000-0002-2017-8426 (P. Monnin)

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

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

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

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

CEUR Workshop Proceedings (CEUR-WS.org)

<footnote n="1">¹Université de Lorraine, CNRS, LORIA, Nancy, France</footnote>

<footnote n="2">²INESC-ID, Instituto Superior Técnico, Universidade de Lisboa, Lisbon, Portugal</footnote>

<footnote n="3">³Waseda University, IPS, Kitakyushu, Japan</footnote>

<footnote n="4">⁴Université Côte d'Azur, Inria, CNRS, I3S, Sophia Antipolis, France</footnote>
knowledge graphs [5, 6]. As with any machine learning approach, the quality of objects within the train dataset is decisive, but for analogy-based methods, this requirement is even more pronounced. In particular, the selection of pairs (A, B) plays a key role as they drive the process of extrapolating relevant and known knowledge to new situations [7]. Such a selection impacts not only model performance but also resource efficiency, as using competent pairs may lead to needing fewer pairs to infer from [8]. This motivates us to explore the following research question:

**RQ** How to select pairs (A, B) to enhance the performance of analogy-based models in classification and regression tasks?

These pairs would thus be the best suited to capture transferable knowledge to a new, unsolved task. In this paper we mainly address the former. Inspired by the case-based reasoning selection process [8, 9], we introduce and compare several notions of *pair competency* that we experiment on a concrete task, namely knowledge graph pruning [5, 10]. We compare their impact both in terms of task performance and number of needed (A, B) pairs, i.e., (A, B) pair-base compression.

The remainder of this paper is organized as follows. Section 2 describes related work on competency definition and related applications, particularly for case-based and analogical reasoning. Section 3 presents the necessary preliminaries about knowledge graph pruning and how it can be framed as an analogical detection problem. In Section 4, we propose five different definitions of competency that are empirically evaluated in Section 5. Finally, we conclude the paper by outlining future work opened by our results in Section 6.

## 2. Related Work

The notion of *competency* has already been addressed in the literature, particularly within the framework of case-based reasoning [9]. Case-based reasoning relies on a collection of problems (i.e., situations) and their corresponding solutions (i.e., outcomes) in order to extrapolate the solution of new and unsolved problems. Analogical proportions “A is to B as C is to D” can be viewed in case-based reasoning such that A and C represent problems, and B and D represent solutions [9]. Given a new unsolved problem, the case-based reasoning process starts by retrieving already solved and similar problems from the case base. Then, the solutions associated with these retrieved problems are adapted to extrapolate the solution to the new unsolved problem. At the end of the process, an evaluation of the solution is performed and the unsolved task, along with its solution, is added to the case base.

Several studies have highlighted the importance of the initial retrieval step in case-based reasoning, and particularly of the similarity matching process that impacts both the performance of the reasoning system and the size of the case-base [11]. In this view, Marquer et al. [8] presents the CoAT indicator, an energy-based [12] model designed to measure a transfer similarity between the situation space and the outcome space. Their results show a direct correlation between their indicator and the case-based reasoning performance on a binary classification task, as well as its capacity for case-base compression. Their idea of measuring the transfer similarity of a couple formed by an object, e.g., a vector, and its outcome on a task, e.g., a class
prediction, to guide the selection of adequate objects for inference has inspired this study and the studied notion of *competency*. Similarly to them, we will tackle insights in terms of performance and (A, B) pair-base compression, for the specific task of KG pruning. It is worth noting that our study is not the first to introduce the notion of competency for analogical reasoning. For instance, Bounhas *et al.* [13] introduces a definition of competency for an analogy-based classification task on datasets with boolean-valued and nominal attributes. In their proposal, competency is framed as a dual concept, on one side on the train dataset objects, and the other side on a particular test object. Within the train set, a competent pair (A, B) is a pair of objects that minimizes the prediction error of the inference on this training set. With respect to a test object, a competent pair is defined as a pair of objects that reflects the same level of (dis)similarity as the pair of objects being tested. This dual view of competency will be adopted and extended in our study in order to address the task of knowledge graph pruning.

# 3. Analogical Detection for Knowledge Graph Pruning

## 3.1. Knowledge Graph Pruning

In this paper, we study the competency of (A, B) pairs used in analogical reasoning for the task of *knowledge graph pruning* [5, 10]. A *knowledge graph* (KG) can be defined as a “graph of data intended to accumulate and convey knowledge of the real world, whose nodes represent entities of interest and whose edges represent relations between these entities” [14]. A KG can be formalized as $G = \{(h, r, t) | h, t \in V, r \in R\}$ where V is the set of entities (or nodes), R is the set of relation (or edge) types, and each triple $(h, r, t)$ indicates that the head entity *h* is connected to the tail entity *t* with a directed edge labeled by the relation *r*. For instance, the triple (Colosseum, in, Rome) in Figure 1 represents the location of the Colosseum within the city of Rome.

In a KG, the pruning task (illustrated in Figure 1) reduces to a binary classification task to decide whether to *keep* or to *prune* the neighbors of seed entities of interest given as input. This classification is iteratively performed on neighbors of kept neighbors until no more neighbors are to process. The interest of the KG pruning task lies in extracting sub-graphs of interest from a huge KG. These sub-graphs can then be used in another application (e.g., building a new KG focused on the topics of interest of a company, recommender systems) while avoiding application-irrelevant knowledge from the original huge KG, thus increasing the quality of the downstream application and reducing potential scalability issues.

## 3.2. From Analogy Classification to Knowledge Graph Pruning

Jarnac *et al.* [5] proposed to use analogy classification to perform the task of KG pruning. In particular, they use candidate analogies of the form *A : B :: C : D* where *A* and *C* are two seed entities, *B* is a neighbor reached during the expansion from *A*, and *D* is a neighbor reached during the expansion from *C*. Using analogical inference, if this candidate is a valid analogy and the decision (*keep* / *prune*) is known for the pair (*A*, *B*), then it can be extrapolated for the pair (*C*, *D*). To illustrate, if the analogy *Hadoop : Big Data :: SharePoint : Content Management System* is valid and *Big Data* is kept, then *Content Management System*
<figure><img src="image_32.png" /><figcaption>**Figure 1:** Illustration of the knowledge graph pruning task, where neighbors of seed entities of interest ○ are either kept ○ or pruned ○.</figcaption></figure>

In this work, we propose an analogy-based framework to implement the two-layer convolutional knowledge graph (KG) representation model from Lim et al. [15] represented in Figure 2 and applied on the vectorial representation of KG entities, i.e., their KG embeddings. This framework empirically proved to significantly enhance pruning performance with a drastically lower number of parameters for the underlying deep learning model compared to other models from the state of the art [5].

Note that the notions of informativeness and interestingness are highly contextual. In the considered setting, the pruning process thus relies on (i) the set of seed nodes of interest and (ii) pairs $(e_s^1, e_r^1)$ whose keep / prune decisions are known to implicitly define a specific domain of interest. In other words, a neighbor is kept or pruned depending on its adequacy with respect to these seed nodes and known pairs. This observation motivated the present study, whose goal is to demonstrate the critical impact of the selection of $(A, B)$ pairs in the analogical inference process to classify new neighbors as kept or pruned. We propose to compare a random-selection approach with approaches based on different notions of competency of $(A, B)$ pairs that we introduce in Section 4. Experiments presented in Section 5 are designed to highlight the ability of analogical reasoning to generalize across different domains of interest, and to showcase the importance of the $(A, B)$ pair-base in this process.

# 4. Measuring $(A, B)$ Pairs Competency

Following the work of Bounhas et al. [13], competency is approached from two perspectives: on one side from the perspective of a particular test object $(C, D)$, and the other side from the perspective of all train objects. Recall that, differently from [13] that considers boolean and nominal attributes, in our case, we apply analogical inference on vector objects, i.e., the KG embeddings that represent the involved entities $A, B, C$, and $D$.

## 4.1. From the Perspective of a Particular Test Object

From the perspective of a test pair of objects $(C, D)$ at inference, we propose to assess and retrieve competent train pairs $(A, B)$ to generate candidate analogies from their similarity with the pair $(C, D)$. One way of estimating the similarity between pairs $(A, B)$ and $(C, D)$ is to use the distance between their vector representations inside a latent space [16]. Since we only have
at our disposal vector representations of entities A, B, C, and D and not of pairs (A, B) and (C, D), we propose to explore several methodologies to estimate the distance between these pairs, which are based on different combinations of embeddings of individual entities that make up the pairs:

**M1** computes the average of the distances between the corresponding elements of the two pairs, i.e., seed-seed and neighbor-neighbor: $d_1 = \frac{1}{2}(\|C - A\| + \|D - B\|)$

**M2** computes the distance between the first objects of each pair, i.e., the seed entities:
$d_2 = \|C - A\|$

**M3** computes the distance between the second objects of each pair, i.e., the neighbors:
$d_3 = \|D - B\|$

**M4** computes the distance between the barycenters (midpoints) of each pair:
$d_4 = \|\frac{A+B}{2} - \frac{C+D}{2}\|$

These methodologies enable the generation of candidate analogies for the test pair (C, D) by selecting so-called *competent* (A, B) pairs, i.e., pairs that minimize the proposed distances.

## 4.2. From the Perspective of Train Objects

Here, we build upon the description proposed in [17] as “a set of pairs of objects from the train dataset that minimizes the prediction error during analogical inference”. In our case, we extend this perspective by building a first base $\tilde{P}$ of pairs (A, B) whose classification label is known and that can come from any dataset. That is, such pairs can come from the train dataset or another dataset unused in training or testing.

We select competent pairs (A, B) from this first pair-base $\tilde{P}$ to build the competent pair-base $P$. These pairs (A, B) are selected because they minimize the prediction error as follows. For each pair (A, B) $\in \tilde{P}$, we build a set of candidate analogies $C(A, B) = \{A : B :: C : D \mid (C, D) \in \tilde{P} \text{ and } (A, B) \neq (C, D)\}$. Recall that we know the classification label of each pair in $\tilde{P}$, and thus we know for each candidate analogy whether it is valid. We compute the prediction error of (A, B) using the considered analogy model and the Log loss from Equation (1):

$$ \text{LogLoss}(A, B) = - \frac{1}{|C(A, B)|} \sum_{A:B::C:D \in C(A,B)} [y_{A:B::C:D} \log(\hat{y}_{A:B::C:D}) + (1 - y_{A:B::C:D}) \log(1 - \hat{y}_{A:B::C:D})], \quad (1) $$

where $y_{A:B::C:D}$ is the true label of the candidate analogy A : B :: C : D, equal to 1 or 0 in our binary classification task, and $\hat{y}_{A:B::C:D}$ is its probability to pertain to class 1 as computed by the analogy model. We then rank (A, B) pairs by increasing order of their LogLoss(A, B) and select the top-k to form the competent pair-base $P$. These pairs are thus computed once, independently of test pairs, and used at inference for any test pair (C, D). Recall that, on the contrary, M1-M4 selects specific competent pairs for each test pair (C, D). We denote this methodology by M5. Note that M5 comes with a computational cost of $O(n^2)$ due to the computation of the different error scores.
# 5. Experiments

In this section we present an empirical study to illustrate the pertinence of the proposed competency measures on three real-world datasets.

## 5.1. Knowledge Graph and Knowledge Graph Embedding Model

The experiments were conducted on the Wikidata Knowledge Graph<fnref n="1" />, which contains approximately 117 million entities and 12,515 relation types. All entities are represented through a numerical vector representation (i.e., an embedding), generated using the TransE model [18], a translational embedding approach that models KG triples (h, r, t) as translations r between h and t in the Euclidean space, i.e., h + r = t. The embedding training process was carried out using the PyTorch-BigGraph framework, which is designed to efficiently handle large scale graph data like Wikidata. All the materials (i.e., code and datasets) necessary to carry out this study are available on Github<fnref n="2" /> where access to the repository can be requested.

Due to the nature of the embedding model [18], that represents relations between entities as translations in the Euclidean space, the Euclidean distance (2) is selected to compute $d_1, d_2, d_3, d_4$.

$$d_{\text{Euclidean}}(\mathbf{s}_1, \mathbf{s}_2) = \sqrt{\sum_{i=1}^{n} (s_{1i} - s_{2i})^2} \qquad (2)$$

where $\mathbf{s}_1 = (s_{11}, \dots, s_{1n})$ and $\mathbf{s}_2 = (s_{21}, \dots, s_{2n})$ are the embeddings of two entities.

## 5.2. Datasets

Three labeled datasets were used for the knowledge graph entity pruning task. Each dataset comprises pairs of entities (seed, neighbor) extracted from Wikidata<fnref n="3" />, annotated with decisions *prune* or *keep*. The first two datasets (DS1 and DS2), originally introduced by [5], focus on entities from the domains of Computer Science and General Knowledge, respectively. The third dataset (DS3) targets entities related to the domain of Works of Art. Key statistics describing the size and label distribution across the three datasets are presented in Table 1 and justify the need of using a weighted measure of performance in order to take into account the imbalance inside the datasets.

To conduct the different experiments, each dataset was divided into three splits: two splits (train and validation) for the training of the analogical model with the early stopping mechanism based on the validation loss, and one (test) for the evaluation phase of the different selection methodologies. Table 1 reports the size of the data splits used for each phase and each dataset.

## 5.3. Analogical Model

Following Jarnac et al. [5] and as aforementioned, we rely on the model proposed by Lim et al. [15] represented in Figure 2 to perform analogical inference. This model is a convolutional neural

<footnote n="1">¹https://www.wikidata.org</footnote>

<footnote n="2">²https://github.com/lielie-dot2/competency_knowledge_graph_pruning</footnote>

<footnote n="3">³https://www.wikidata.org</footnote>
<caption>**Table 1**</caption>

Datasets characteristics. For each dataset, “Size” represent the total number of decisions, while “# Keep” and “# Prune” respectively represent the number of keep and prune decisions.

<table><thead><tr><th>Dataset</th><th>Size</th><th># Keep</th><th># Prune</th><th>Train size</th><th>Validation size</th><th>Test size</th></tr></thead><tbody><tr><td>DS1</td><td>5233</td><td>1769</td><td>3464</td><td>3764</td><td>941</td><td>524</td></tr><tr><td>DS2</td><td>982</td><td>594</td><td>388</td><td>705</td><td>177</td><td>100</td></tr><tr><td>DS3</td><td>2111</td><td>932</td><td>1179</td><td>1519</td><td>380</td><td>212</td></tr></tbody></table>

<figure><img src="image_33.png" /><figcaption>**Figure 2:** The analogy-based classifier model with two convolution layers and one fully connected layer from [15]. Image from [5].</figcaption></figure>

network (CNN)-based architecture comprising two convolutional layers. Key hyperparameters including the number of filters per layer, learning rate, and dropout rate were tuned using Bayesian optimization within predefined search ranges (Table 2). An early stopping mechanism with a patience of 5 on the validation loss was implemented to prevent overfitting.

The model is trained according to the first configuration described in [5], i.e., “valid analogies are of the form *k* :: *k* and invalid analogies are of the form *k* :: *p*”. Valid analogies are defined as analogies formed with pairs (*A*, *B*) and (*C*, *D*) that both belong to the class *keep* in a labeled dataset, whereas *invalid* analogies involve pairs where (*A*, *B*) belongs to the class *keep* and (*C*, *D*) to the class *prune*. During training, the random selection of examples from the train dataset described in [5] is preserved, since the current study focuses on comparing selection methodologies during analogical inference. However, it is worth noting that competency-based selection strategies could also be integrated during training to potentially enhance the model’s performance. The methodology used to extrapolate classes on unseen pairs follows a majority strategy. For each test pair (*C*, *D*), *N* inference candidate analogies *A* : *B* :: *C* : *D* are built, based on labeled pairs (*A*, *B*) known to belong to the class *keep*. For each of these analogies, if the probability predicted by the model is higher than a given threshold (0.6) then a vote is accounted for a *keep* extrapolation. At the end of the process, if there is a majority of votes for *keep*, then the test pair is classified as *keep*.

## 5.4. Main Results

We tested our competency-based selection strategies on three distinct configurations:
<caption>**Table 2**</caption>

Hyperparameters of the analogical model and their search ranges.

<table><thead><tr><td>Hyperparameter</td><td>Search Range / Values</td></tr></thead><tbody><tr><td>Learning rate</td><td>[10<sup>-5</sup>, 10<sup>-1</sup>] (log scale)</td></tr><tr><td>Batch size</td><td>{16, 32, 64}</td></tr><tr><td>Number of filters of the first convolutional layer</td><td>{8, 16, 32}</td></tr><tr><td>Number of filters of the second convolutional layer</td><td>{8, 16}</td></tr><tr><td>Dropout rate</td><td>[0.0, 0.5]</td></tr><tr><td>Number of epochs</td><td>30</td></tr><tr><td>First convolutional layer kernel size</td><td>(1,2)</td></tr><tr><td>Second convolutional layer kernel size</td><td>(2,2)</td></tr><tr><td>First convolutional layer strides</td><td>(1,2)</td></tr><tr><td>Second convolutional layer strides</td><td>(2,2)</td></tr></tbody></table>

C1 The model is trained on the train set of a particular dataset, tested on the test set of this dataset, and (A, B) pairs are retrieved from the train set of the same dataset at inference.

C2 The model is trained on the train set of a particular dataset, tested on the test set of this dataset, and (A, B) pairs are retrieved from the train set of the three datasets at inference.

C3 The model is trained on the train set of a particular dataset, tested on the test set of another dataset, and (A, B) pairs are retrieved from the train set of the three datasets at inference.

These three configurations aim at comparing the different selection methodologies by training and testing the model with entities that either belong or not to the same domain and evaluate their contributions. As a baseline, we adopt the random-based selection methodology.

In the following, only the best weighted F-measures obtained and the associated number of (A, B) pairs for each dataset are presented. In particular, we tested with a number of inference candidate analogies from 0 to 20 and retained the number of pairs (A, B) leading to the best weighted F-measure. It is worth noting that for the random selection, each experiment was repeated 150 times, and the reported F-measure corresponds to the mean weighted F-measure of those different repetitions along with its standard deviation.

**Results obtained with configuration C1.** Table 3 presents the best weighted F-measures obtained for the experimental configuration C1, i.e., considering (A, B) pairs of the same domain.

Table 3 shows that on all datasets, the random selection achieves the lowest F-measure, highlighting the interest of studying the competency of pairs (A, B) to use during the analogical inference process. However, we note that competency-based methodologies achieve heterogeneous results depending on the dataset used. For instance, for DS1, the highest F-measure (0.89) is achieved using M3. This improvement represents a 10-point gain compared to the baseline, i.e., the random methodology. It also constitutes a 9-point gain compared to the lowest performing methodology M5. For DS2, the methodology M3 also stands out, contributing to a 5-point gain compared to the random methodology. For DS3, competency-based methodologies
and the random methodology provide quite similar weighted F-measures, which might suggest a difficulty for those competency approaches to capture effectively the structural properties of this dataset.

<caption>**Table 3**</caption>

Best weighted F-measure obtained on the three considered datasets with the different selection methodologies and experimental configuration **C1**. The random selection process averaged on 150 run is given as a baseline. Bold numbers represent the best result obtained for each dataset.

<table><thead><tr><th>Datasets</th><th>Random</th><th>M1</th><th>M2</th><th>M3</th><th>M4</th><th>M5</th></tr></thead><tbody><tr><td>DS1</td><td>0.79 ± 0.002</td><td>0.80</td><td>0.86</td><td><strong>0.89</strong></td><td>0.80</td><td>0.80</td></tr><tr><td>DS2</td><td>0.81 ± 0.009</td><td>0.85</td><td>0.83</td><td><strong>0.86</strong></td><td><strong>0.86</strong></td><td>0.85</td></tr><tr><td>DS3</td><td>0.83 ± 0.007</td><td>0.83</td><td><strong>0.84</strong></td><td>0.83</td><td>0.83</td><td><strong>0.84</strong></td></tr></tbody></table>

<figure><img src="image_34.png" /><figcaption>**Figure 3:** Number of pairs (*A*, *B*) used from each dataset using the different selection methodologies to obtain the best weighted F-measure reported in Table 3 on the experimental configuration **C1**.</figcaption></figure>

In terms of (*A*, *B*) pair-base compression, Figure 3 shows that all competency-based selection methodologies reduce the number of pairs needed to achieve the best weighted F-measure. For example, for DS1, methodology M3 achieves a 10-point performance gain compared to the random methodology while reducing the required number of analogical pairs from 19 to just 1. In DS2, methodology M3 achieves a 5-point performance improvement while reducing the number of pairs from 19 to 2. Even in DS3, where the performance gain is minimal in terms of weighted F-measure, the number of pairs needed to reach the best weighted F-measure is drastically reduced. Recall, even if methodology M5 also competitively reduces the number of (*A*, *B*) pairs needed to reach the best F-measure, it comes with a computational cost induced by the need of pre-computing the different error scores (*i.e.*, $O(n^2)$), which may hinder scalability in real-world, large-scale KGs. We leave this study as future work.

**Results obtained with configuration C2.** Table 4 presents the best-performing selection methodologies and their associated F-measure for the experimental configuration C2, i.e., training and testing on one dataset, and selecting at inference competent (*A*, *B*) pairs not necessarily from the same domain but retrieved from all datasets.
**Table 4**

Results obtained on the experimental configuration C2, i.e., selecting competent (A, B) pairs of different domains, for a model trained and tested on one dataset. For each dataset to select competent (A, B) pairs from, the best performing selection methodology and its associated weighted F-measure are reported.

<table><thead><tr><th>Train & test</th><th>(A, B) pairs dataset</th><th>F-measure</th><th>Competency method</th><th>Random method</th></tr></thead><tbody><tr><td rowspan="3">DS1</td><td>DS1</td><td><strong>0.89</strong></td><td>M3</td><td>0.79 ± 0.002</td></tr><tr><td>DS2</td><td>0.81</td><td>M2</td><td>0.79 ± 0.006</td></tr><tr><td>DS3</td><td>0.79</td><td>M2</td><td>0.79 ± 0.003</td></tr><tr><td rowspan="3">DS2</td><td>DS1</td><td><strong>0.86</strong></td><td>M2</td><td>0.84 ± 0.004</td></tr><tr><td>DS2</td><td><strong>0.86</strong></td><td>M3</td><td>0.83 ± 0.009</td></tr><tr><td>DS3</td><td><strong>0.86</strong></td><td>M4</td><td>0.84 ± 0.009</td></tr><tr><td rowspan="3">DS3</td><td>DS1</td><td><strong>0.85</strong></td><td>M2</td><td>0.84 ± 0.002</td></tr><tr><td>DS2</td><td><strong>0.85</strong></td><td>M2</td><td>0.84 ± 0.004</td></tr><tr><td>DS3</td><td>0.84</td><td>M2</td><td>0.83 ± 0.007</td></tr></tbody></table>

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

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

<figure><img src="image_37.png" /><figcaption>**Figure 4:** Number of (A, B) pairs used to obtain the best F-measures for the random methodology ■ and the best competency-based methodology ■ on experimental configuration C2, i.e., training and testing on one dataset and selecting competent (A, B) pairs at inference from all datasets.</figcaption></figure>

For DS1, using the competency-based methodology M2 with (A, B) pairs from DS1 yields the best results, as shown in Table 4. For pair-base compression (Figure 4), the number of analogies needed to achieve the best F-measure is also lower when retrieving (A, B) pairs from DS1. However, contrary to DS1, competent (A, B) pairs from the train dataset are not always the ones leading to the best results. Indeed, for DS2 and DS3, selecting (A, B) pairs from DS1 is as competitive with selecting from the train dataset. This observation highlights a potential notion of *competent dataset*, that may not only be associated to similarity between domains but potentially to other analogical characteristics. Thus, this result could emphasize the ability of analogical reasoning in extrapolating from one domain to another with minimal reliance on domain-specific data or similarity. Note that the random methodology provides stable results that are always lower than the ones obtained with the competency-based approach. Similarly, using this dataset as a source of (A, B) pairs leads to results that are always below those obtained using DS1 or DS2. Again, this may be explained by the nature of DS3 that is more fine-grained in its decisions than other datasets.
**Results obtained with configuration C3.** For the experimental configuration C3, results in Table 5 are obtained by training a model on dataset DS1 and testing on another dataset while selecting competent (A, B) pairs at inference from the different datasets available. Additional experimental results with other training datasets are available in Appendices.

<caption>**Table 5**</caption>

Results obtained on the experimental configuration C3, i.e., selecting competent (A, B) pairs of different domains, for a model trained on one dataset and tested on another dataset. For each dataset from which competent (A, B) pairs are selected, the best performing selection methodology and its associated weighted F-measure are reported.

<table><thead><tr><th>Train</th><th>Test</th><th>(A, B) pairs dataset</th><th>F-measure</th><th>Competency method</th><th>Random method</th></tr></thead><tbody><tr><td rowspan="3">DS1</td><td rowspan="3">DS2</td><td>DS1</td><td><strong>0.67</strong></td><td>M2</td><td>0.53 ± 0.001</td></tr><tr><td>DS2</td><td>0.66</td><td>M2</td><td>0.53 ± 0.006</td></tr><tr><td>DS3</td><td>0.55</td><td>M4</td><td>0.52 ± 0.008</td></tr><tr><td rowspan="3">DS1</td><td rowspan="3">DS3</td><td>DS1</td><td><strong>0.71</strong></td><td>M2</td><td>0.60 ± 0.004</td></tr><tr><td>DS2</td><td>0.61</td><td>M2</td><td>0.60 ± 0.006</td></tr><tr><td>DS3</td><td>0.60</td><td>M2</td><td>0.60 ± 0.004</td></tr></tbody></table>

As seen for Configuration C2, selecting competent (A, B) pairs from the same dataset used for test does not necessarily lead to the best results: in Table 5, the highest weighted F-measure is achieved when competent pairs are selected from DS1. Even on DS3, where competency-based methodologies struggle to outperform random selection, selecting competent pairs from DS1 allows to obtain an 11-point gain. Interestingly, Figure 5 shows that for a model trained on one dataset and tested on another, selecting (A, B) pairs from one of these datasets only leads to a small reduction in the number of pairs needed, even if still under the number required for random selection. However, selecting (A, B) pairs from another dataset (DS3) leads to a drastic reduction, but a smaller F-measure. Note that additional results in Appendix also show a general ability for our competency-based methodologies to provide a compression gain for the pair-base.

<figure><img src="image_38.png" /><figcaption>**Figure 5:** Number of (A, B) pairs needed from each dataset to obtain the best F-measure for a model trained on DS1 and tested on DS2 with (A, B) pairs coming from different domains (experimental configuration C3).</figcaption></figure>
# 6. Conclusion and Perspectives

This study has introduced several competency-based methodologies for the selection of (A, B) pairs to enhance performance in analogy-based machine learning tasks. By comparing each competency-based methodology with a naive, random selection approach on the task of knowledge graph pruning, we have empirically demonstrated the benefits of using some methodologies, both in terms of task performance and pair-base compression (i.e., number of (A, B) pairs needed). Furthermore, the study reveals that the best analogical (A, B) pairs, in terms of task performance, are not necessarily those retrieved from the same domain dataset. To illustrate, using pairs from our dataset DS1 consistently yields the best results across all experimental configurations, also suggesting a better analogical potential for this dataset. This observation also emphasizes the ability of analogical reasoning to generalize across several domains. This cross-domain generalization and our results indicate that our approach could especially be useful to reuse an analogical model trained on a dataset for inference on a new dataset. Even though the proposed competency-based selection methodologies did not always enable reaching the best weighted F-measure compared to a fully retrained model, a high performance gain is still obtained, which could limit the need and cost of retraining an entire model on domain specific data. The compression benefits of our competency-based methodologies also contributes to this cost-effective aspect.

These findings suggest many directions for future work, and especially in extending competency-based approaches to other tasks. One direction could be the application of these selection methodologies to Natural Language Processing (NLP) where information is also embedded in vector spaces. Target Sense Verification (TSV) that has already been framed into an analogy detection task by [19] could be a relevant task. Finally, the robustness of the competency-based methodologies proposed and the distance metrics employed remains to be challenged, especially when applied with different embedding models (i.e., DistMult [20], ConvE [21]), as all experiments in this study were conducted using TransE [18].

# Acknowledgments

This work was supported by the French National Research Agency (ANR)<fnref n="4" /> project "Analogies: from theory to tools and applications" (AT2TA), ANR-22-CE23-0023.

# References

[1] S. D. Afantenos, H. Prade, G. Richard, L. C. Bernardes, Analogical proportions and creativity: A preliminary study, in: ICCC 2024, Association for Computational Creativity, 2024, pp. 289–298.

[2] J. Thibaut, Y. Glady, R. M. French, Understanding the *What* and *When* of analogical reasoning across analogy formats: An eye-tracking and machine learning approach, Cogn. Sci. 46 (2022).

<footnote n="4">⁴Agence Nationale de la Recherche.</footnote>
[3] K. Combs, T. Bihl, S. Ganapathy, D. Staples, Analogical reasoning: An algorithm comparison for natural language processing, in: HICSS 2022, ScholarSpace, 2022, pp. 1–10.

[4] B. Elayeb, M. Bounhas, M. F. Ettih, Morphological disambiguation of texts based on analogical proportions, in: ICAART 2025, SCITEPRESS, 2025, pp. 1207–1214.

[5] L. Jarnac, M. Couceiro, P. Monnin, Relevant entity selection: Knowledge graph bootstrapping via zero-shot analogical pruning, in: CIKM 2023, ACM, 2023, pp. 934–944.

[6] P. Monnin, M. Couceiro, Interactions between knowledge graph-related tasks and analogical reasoning: A discussion, in: ATA@ICCBR2022, volume 3389 of *CEUR Workshop Proceedings*, CEUR-WS.org, 2022, pp. 57–67.

[7] L. Wang, H. Wang, Y. Lepage, AnaScore: understanding semantic parallelism in proportional analogies, in: L. Chiruzzo, A. Ritter, L. Wang (Eds.), NAACL 2025, Albuquerque, New Mexico, 2025, pp. 1175–1188.

[8] E. Marquer, F. Badra, M. Lesot, M. Couceiro, D. Leake, Less is better: An energy-based approach to case base competence, in: ATA@ICCBR2023, volume 3438 of *CEUR Workshop Proceedings*, CEUR-WS.org, 2023, pp. 27–42.

[9] B. Fuchs, J. Lieber, L. Miclet, A. Mille, A. Napoli, H. Prade, G. Richard, Case-based reasoning, analogy, and interpolation, in: A Guided Tour of Artificial Intelligence Research: Volume I: Knowledge Representation, Reasoning and Learning, Springer, 2020, pp. 307–339.

[10] F. Lin, X. Zhu, Z. Zhao, D. Huang, Y. Yu, X. Li, T. Xu, E. Chen, Knowledge graph pruning for recommendation, CoRR abs/2405.11531 (2024). doi:10.48550/ARXIV.2405.11531. arXiv:2405.11531.

[11] J. L. Kolodner, An introduction to case-based reasoning, Artificial Intelligence Review 6 (1992) 3–34. doi:10.1007/BF00155578.

[12] D. Carbone, Hitchhiker's guide on energy-based models: a comprehensive review on the relation with other generative models, sampling and statistical physics, CoRR abs/2406.13661 (2024). arXiv:2406.13661.

[13] M. Bounhas, H. Prade, G. Richard, Analogy-based classifiers for nominal or numerical data, International Journal of Approximate Reasoning 91 (2017) 36–55.

[14] A. Hogan, et al., Knowledge Graphs, Synthesis Lectures on Data, Semantics, and Knowledge, Morgan & Claypool Publishers, 2021.

[15] S. Lim, H. Prade, G. Richard, Solving word analogies: A machine learning perspective, in: ECSQARU 2019, volume 11726 of LNCS, Springer, 2019, pp. 238–250.

[16] N. Hubert, H. Paulheim, A. Brun, D. Monticolo, Do similar entities have similar embeddings?, CoRR abs/2312.10370 (2023). arXiv:2312.10370.

[17] M. Bounhas, H. Prade, Analogy-based classifiers: An improved algorithm exploiting competent data pairs, International Journal of Approximate Reasoning 158 (2023) 108923.

[18] A. Bordes, N. Usunier, A. García-Durán, J. Weston, O. Yakhnenko, Translating embeddings for modeling multi-relational data, in: NIPS 2013, 2013, pp. 2787–2795.

[19] G. Zervakis, E. Vincent, M. Couceiro, M. Schoenauer, E. Marquer, An analogy based approach for solving target sense verification, in: NLPIR 2022, ACM, 2022, pp. 144–151.

[20] B. Yang, W. Yih, X. He, J. Gao, L. Deng, Embedding entities and relations for learning and inference in knowledge bases, in: ICLR 2015, 2015.

[21] M. Shi, J. Zhao, A knowledge graph link prediction model with combined 1d and 2d convolutional embeddings, in: DSAA 2022, IEEE, 2022, pp. 1–2.
# A. Appendices

<caption>**Table 6**</caption>

Results obtained on the experimental configuration C3, i.e., selecting competent (A, B) pairs of different domains, for a model trained on one dataset (DS2 or DS3) and tested on another dataset. For each dataset from which competent (A, B) pairs are selected, the best performing selection methodology and its associated weighted F-measure are reported.

<table><thead><tr><th>Train</th><th>Test</th><th>(A, B) pairs dataset</th><th>F-measure</th><th>Competency method</th><th>Random method</th></tr></thead><tbody><tr><td rowspan="3">DS2</td><td rowspan="3">DS1</td><td>DS1</td><td><strong>0.53</strong></td><td>M2</td><td>0.51 ± 0.003</td></tr><tr><td>DS2</td><td><strong>0.53</strong></td><td>M2</td><td>0.49 ± 0.007</td></tr><tr><td>DS3</td><td><strong>0.53</strong></td><td>M4</td><td>0.50 ± 0.006</td></tr><tr><td rowspan="3">DS2</td><td rowspan="3">DS3</td><td>DS1</td><td><strong>0.53</strong></td><td>M2</td><td>0.49 ± 0.004</td></tr><tr><td>DS2</td><td><strong>0.53</strong></td><td>M2</td><td>0.49 ± 0.009</td></tr><tr><td>DS3</td><td>0.52</td><td>M4</td><td>0.50 ± 0.009</td></tr><tr><td rowspan="3">DS3</td><td rowspan="3">DS1</td><td>DS1</td><td><strong>0.59</strong></td><td>M2</td><td>0.51 ± 0.004</td></tr><tr><td>DS2</td><td>0.51</td><td>M3</td><td>0.50 ± 0.007</td></tr><tr><td>DS3</td><td>0.55</td><td>M4</td><td>0.51 ± 0.003</td></tr><tr><td rowspan="3">DS3</td><td rowspan="3">DS2</td><td>DS1</td><td><strong>0.53</strong></td><td>M2</td><td>0.50 ± 0.003</td></tr><tr><td>DS2</td><td>0.51</td><td>M2</td><td>0.50 ± 0.005</td></tr><tr><td>DS3</td><td>0.51</td><td>M2</td><td>0.51 ± 0.003</td></tr></tbody></table>
<caption>**Table 7**</caption>

Results obtained on the experimental configuration C3, i.e., selecting competent (A, B) pairs of different domains, for a model trained on one dataset (DS2 or DS3) and tested on another dataset. For each dataset from which competent (A, B) pairs are selected, the best performing selection methodology and its associated number of (A, B) pairs are reported.

<table><thead><tr><th>Train</th><th>Test</th><th>(A, B) pairs dataset</th><th>#(A, B) pairs</th><th>Competency method</th><th>Random method</th></tr></thead><tbody><tr><td rowspan="3">DS2</td><td rowspan="3">DS1</td><td>DS1</td><td>2</td><td>M2</td><td>20</td></tr><tr><td>DS2</td><td>2</td><td>M2</td><td>11</td></tr><tr><td>DS3</td><td>2</td><td>M4</td><td>17</td></tr><tr><td rowspan="3">DS2</td><td rowspan="3">DS3</td><td>DS1</td><td>3</td><td>M2</td><td>19</td></tr><tr><td>DS2</td><td>1</td><td>M2</td><td>16</td></tr><tr><td>DS3</td><td>6</td><td>M4</td><td>18</td></tr><tr><td rowspan="3">DS3</td><td rowspan="3">DS1</td><td>DS1</td><td>2</td><td>M2</td><td>19</td></tr><tr><td>DS2</td><td>2</td><td>M3</td><td>15</td></tr><tr><td>DS3</td><td>8</td><td>M4</td><td>10</td></tr><tr><td rowspan="3">DS3</td><td rowspan="3">DS2</td><td>DS1</td><td>6</td><td>M2</td><td>8</td></tr><tr><td>DS2</td><td>4</td><td>M2</td><td>4</td></tr><tr><td>DS3</td><td>5</td><td>M2</td><td>8</td></tr></tbody></table>
# A new approach to clustering based on an analogy-related logical proportion

Myriam Bounhas¹,*,†, Henri Prade²,*,†

¹LARODEC Laboratory, Tunis University, 41 rue de la Liberté, 2000 Le Bardo, Tunisia

²IRIT, CNRS & Université Paul Sabatier, 118 route de Narbonne, 31062 Toulouse cedex 9, France

**Abstract**

Analogical proportions are statements of the form “*a* is to *b* as *c* is to *d*”. When *a*, *b*, *c*, *d* are 4 items of the same kind represented by vectors of Boolean, nominal, or numerical attribute values, their proportional relationships form the basis of an analogical inference mechanism that can be effectively applied to classification tasks. Analogical proportion belongs to a set of four closely related, remarkable homogeneous logical proportions that express different types of links between pairs of items (*a*, *b*) and (*c*, *d*). One of them, named *inverse paralogy*, expresses orthogonality between these pairs. The graded extension of the core of this logical proportion, which measures orthogonality between pairs, is the basis of the proposed approach to clustering. The approach operates by assigning pairs to clusters without presupposing the number of clusters in advance. It proceeds by building mini-clusters that are progressively fused when the centroids (which are pairs) of two clusters are not sufficiently orthogonal. Experiments compare the results of the proposed algorithm with the well-known k-means algorithm on benchmarks. The preliminary results are promising.

**Keywords**

analogical proportion, logical proportion, clustering, orthogonality

## 1. Introduction

Analogical proportion-based inference is a type of comparative reasoning that uses analogical proportions. Analogical proportions are statements of the form “*a* is to *b* as *c* is to *d*”, where *a*, *b*, *c*, *d* are represented by vectors of attribute values (the same set of attributes is used for describing the four items). In such proportions, *a* is compared to *b*, *c* to *d*, and the results of these two comparisons should be identical. In analogical proportions, the comparisons inside pairs focus on differences. Analogical proportions are defined for Boolean, nominal, and numerical values for accommodating the different kinds of attribute values.

Analogical proportion-based inference, when applied to classification, relies on a simple principle: if four (Boolean) vectors *a*, *b*, *c*, *d* make a valid analogical proportion component-wise for each 4-tuple of values pertaining to the same attribute, then it is expected that their class labels (viewed as nominal values) also make a valid proportion. Analogical proportion-based classification has obtained competitive results on benchmarks [1, 2, 3, 4]. It has been also studied at the theoretical level [5, 6].

Analogical proportions are closely related to three other logical proportions, named reverse analogy, paralogy and inverse paralogy, with different focus when comparing items in a pair. For instance, while an analogical proportion states that “*a* differs from *b* as *c* differs from *d*, and *b* differs from *a* as *d* differs from *c*”, the inverse paralogy states that “what *a* and *b* have in common (positively, or negatively), *c* and *d* do not”, and vice-versa.

The subject of this article is an attempt to answer the following question: is it possible to think of an approach to unsupervised learning, i.e. here clustering, that would use a form of comparative reasoning that would be based on a proportion closely related to the analogical proportion?

The paper is structured as follows. Section 2 first offers a short background on the four Boolean homogeneous logical proportions that include the analogical proportion and the three other above-

IARML@IJCAI'2025: Workshop on the Interactions between Analogical Reasoning and Machine Learning, at IJCAI'2025, August, 2025, Montreal, Canada

*Corresponding author.

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

myriam_bounhas@yahoo.fr (M. Bounhas); henri.prade@irit.fr (H. Prade)

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

© 2025 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
mentioned closely related proportions. Then it is shown that each of these proportions can be reduced to a logical expression that is true for only two patterns of values for *a*, *b*, *c*, *d* and which correspond to the core focus of the proportion. Section 3 describes the principle of a pair-based approach to clustering based on a graded extension of the core of the inverse paralogy. Section 4 presents the clustering algorithm in detail. Section 5 reports experiments on benchmarks, with comparison with the k-means algorithm [7, 8].

## 2. Homogeneous logical proportions and their cores

We start this section with a background on Boolean homogeneous logical proportions [9], a particular kind of logical proportions that includes the analogical proportion. In the second part, we introduce new quaternary Boolean connectors corresponding to the core of the homogeneous logical proportions, one of whose gradual extension will constitute the building block of the proposed clustering approach.

### 2.1. The four homogeneous logical proportions

Logical proportions [9] are quaternary connectors expressing relations between pairs in propositional logic. They are built as follows. In Boolean logic, there are four indicators for comparing two variables *a* and *b*:

- Two indicators express similarity, either positively as $a \land b$ (which is true if both *a* and *b* are true), or negatively as $\neg a \land \neg b$ (which is true if *a* and *b* are both false).

- The other two are indicators of dissimilarity: $\neg a \land b$ (which is true if *a* is false and *b* is true) and $a \land \neg b$ (which is true if *a* is true and *b* is false).

Then a logical proportion $T(a, b, c, d)$, which is a quaternary connective linking four Boolean variables $a, b, c, d$, is the conjunction of two equivalences between an indicator for $(a, b)$ and an indicator for $(c, d)$. There are 120 distinct logical proportions [9].

For the homogeneous proportions, we do not mix different types of indicators in the 2 equivalences: either we use similarity indicators or dissimilarity indicators. Thus there are only 4 homogeneous proportions [9, 10]. They are

*   **analogy (A):** $A(a, b, c, d) = ((a \land \neg b) \equiv (c \land \neg d)) \land ((\neg a \land b) \equiv (\neg c \land d));$

*   **reverse analogy (R):** $R(a, b, c, d) = ((a \land \neg b) \equiv (\neg c \land d)) \land ((\neg a \land b) \equiv (c \land \neg d));$

*   **paralogy (P):** $P(a, b, c, d) = ((a \land b) \equiv (c \land d)) \land ((\neg a \land \neg b) \equiv (\neg c \land \neg d));$

*   **inverse paralogy (I):** $I(a, b, c, d) = ((a \land b) \equiv (\neg c \land \neg d)) \land ((\neg a \land \neg b) \equiv (c \land d)).$

As any logical proportions, the four above proportions are true only for 6 patterns of values for $(a \ b \ c \ d)$ and false for the $2^4 - 6 = 10$ other possible patterns. These 6 patterns are given in Table 1 for the proportions **A**, **R**, **P**, **I**.

<caption>**Table 1**</caption>

Truth tables: Analogy, Reverse analogy, Paralogy, Inverse paralogy

<table><thead><tr><th colspan="4">A</th><th colspan="4">R</th><th colspan="4">P</th><th colspan="4">I</th></tr><tr><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th></tr></thead><tbody><tr><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td></tr><tr><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td></tr><tr><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>1</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td></tr><tr><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td><td>0</td><td>1</td></tr></tbody></table>

When $a, b, c, d$ are no longer Boolean variables, but vectors thereof, i.e., $a = (a_1, ..., a_n)$, $b = (b_1, ..., b_n)$, $c = (c_1, ..., c_n)$, and $d = (d_1, ..., d_n)$, logical proportions are extended componentwise:

$$T(a, b, c, d) \text{ is true if and only if } \forall i, T(a_i, b_i, c_i, d_i) \text{ is true.} \quad (1)$$
Viewing *a*, *b*, *c*, *d* as vectors of Boolean variables, we can better understand the meaning of these four proportions. As can be checked in Table 1 the analogical proportion *A*(*a*, *b*, *c*, *d*) is true if “*a* differs from *b* as *c* differs from *d*, and *b* differs from *a* as *d* differs from *c*” (and “when *a* and *b* do not differ, *c* and *d* do not differ”). The reverse analogical proportion is the same, exchanging *c* and *d*. The paralogical proportion states that “what *a* and *b* have in common (positively or negatively), *c* and *d* also have in common” (and vice-versa). When *a* and *b* have nothing in common, *c* and *d* have nothing in common either. In the inverse paralogical proportion, the pairs (*a*, *b*) and (*c*, *d*) are in opposition, rather than in parallel as with paralogy, (when *a* and *b* are true, *c* and *d* are false); this proportion states a form of orthogonality between the pairs (*a*, *b*) and (*c*, *d*) by stating that if *a* and *b* share a property, neither *c* nor *d* have it (and vice-versa).

It is worth noticing that the four proportions are code independent, i.e., 0 and 1 play the same role, and they can be exchanged in the four truth tables, leaving the tables unchanged. More formally,
$T(a, b, c, d) = T(\neg a, \neg b, \neg c, \neg d)$, for $T = A, T = R, T = P$, or $T = I$.

It is also clear that the four proportions are closely related together. Indeed we have

$$A(a, b, c, d) \equiv R(a, b, d, c); A(a, b, c, d) \equiv P(a, d, c, b);$$

$$\text{and } I(a, b, c, d) = A(a, \neg b, \neg c, d).$$

## 2.2. The cores of the homogeneous logical proportions

If we carefully observe the patterns that make the four proportions true in Table 1, we can notice that in each case, the two first lines in the Table correspond to the situations where one of the equivalences in the corresponding expressions is true because the indicators (on each side of the equivalences) are true simultaneously, while the four last lines correspond to the situations where the two equivalences are true because the indicators are false simultaneously. For instance, in the two first lines of *A*(*a*, *b*, *c*, *d*), *a* and *b* differ in the same way as *c* and *d*, while in the four last lines *a* = *b* and *c* = *d*. If we consider *I*, in the two first lines of *I*(*a*, *b*, *c*, *d*), the pairs (*a*, *b*) and (*c*, *d*) are in clear opposition, i.e., *a* = *b* ≠ *c* = *d*, while in the four other lines *a* ≠ *b* and *c* ≠ *d*. Thus, the two first lines focus on the meaning of the proportion, and may be considered as the core of its semantics. Moreover, one may notice that any pattern among the 8 patterns present in Table 1 appears one time in the two first lines and two times in the last four lines. This means that the same pattern can make true two quite opposite proportions, e.g. 1001 makes true *P* and *I*. This is another clue for focusing on the two first lines.

We may wonder about the formal expression of connectors that would be true only for the first two lines in Table 1. It can be checked that the expression of these new connectives is structurally similar to the ones of the four logical proportions. Namely they can be obtained by replacing the equivalence $\equiv$ by the exclusive or, denoted $\oplus$, in the expression of *A*, *R*, *P* and *I*, and exchanging *A* and *R*, *P* and *I*. Indeed the formal expressions of these connectives are given below (the notation with a “double underline” recalls that these connectives are relations between *pairs*, which are true only for two patterns of values).

$$\underline{A}(a, b, c, d) = [\neg a \wedge b \oplus (c \wedge \neg d)] \wedge [(a \wedge \neg b) \oplus (\neg c \wedge d)]$$

$$\underline{R}(a, b, c, d) = [\neg a \wedge b \oplus (\neg c \wedge d)] \wedge [(a \wedge \neg b) \oplus (c \wedge \neg d)]$$

$$\underline{P}(a, b, c, d) = [(a \wedge b) \oplus (\neg c \wedge \neg d)] \wedge [\neg a \wedge \neg b \oplus (c \wedge d)]$$

$$\underline{I}(a, b, c, d) = [(a \wedge b) \oplus (c \wedge d)] \wedge [\neg a \wedge \neg b \oplus (\neg c \wedge \neg d)] = [(a \wedge b) \oplus (c \wedge d)] \wedge [(a \vee b) \oplus (c \vee d)]$$

Their truth tables are given in table 2 where only the two patterns that make them true appear, while the other 14 possible patterns make these connectors false.

<table><caption>**Table 2**

Truth tables of the cores of Analogy, Reverse analogy, Paralogy, Inverse paralogy</caption><thead><tr><th colspan="4">A</th><th colspan="4">R</th><th colspan="4">P</th><th colspan="4">I</th></tr><tr><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th><th>a</th><th>b</th><th>c</th><th>d</th></tr></thead><tbody><tr><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td></tr><tr><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0</td><td>0</td></tr></tbody></table>
Note that $\underline{I}(a, b, c, d)$ can be written in two equivalent ways (thanks to the property $p \oplus q$ true $\Leftrightarrow \neg p \oplus \neg q$ true). We shall use the second expression as a basis in the next section for building an index indicating to what extent two pairs of numerical vectors should belong to two different clusters. The potential interest of the cores of the other logical proportions is left for further studies.

### 3. A pair-based approach to clustering

In this section, we suggest why the inverse paralogy, and more particularly its core may be suitable for clustering purposes, and we provide a graded extension of $\underline{I}(a, b, c, d)$ for accommodating numerical values and computing the orthogonality between the pairs $(a, b)$ and $(c, d)$ of vectors with normalized components.

#### 3.1. Inverse paralogy and clustering

It has been noticed that the inverse paralogical proportion can be used to solve Bongard problems, which consist in finding a property capable of discriminating two sets of elements: the elements of one set all have the property, while none of the elements of the other set do [11]. More recently, Bongard problem solving has proved useful in a comparative reasoning approach to classification problems, where examples are treated in pairs [12].

The idea of a property common to a set of items but which is wrong for all the elements of another set sounds a bit like the separation of two clusters. Moreover, the two patterns $(0, 0, 1, 1)$ and $(1, 1, 0, 0)$ that makes $\underline{I}(a, b, c, d)$ true are consonant with the idea of two pairs of items belonging to two clusters, since the notion of clusters supposes i) a common identity or at least a proximity of the items inside each cluster, and ii) some significant difference or distance with the items of the other cluster(s).

This is why it is of interest of extending $\underline{I}(a, b, c, d) = [(a \wedge b) \oplus (c \wedge d)] \wedge [(a \vee b) \oplus (c \vee d)]$ to numerical values in order to allow for numerical attribute values in the description of items.

#### 3.2. Graded extension of the core of the inverse parology

$\underline{I}(a, b, c, d)$ can be easily turned into a multiple-valued connective taking values in the interval $[0, 1]$ when $(a, b, c, d) \in [0, 1]^4$. We use Łukasiewicz connectives, namely $\neg x = 1 - x$; $x \wedge y = \min(x, y)$; $x \vee y = \max(x, y)$; $x \to y = \min(1, 1 - x + y)$; $x \equiv y = (x \to y) \wedge (y \to x) = 1 - |x - y|$; $x \oplus y = \neg(x \equiv y) = |x - y|$. Note that $x \oplus y = 0 \Leftrightarrow x = y$.

This leads to the following extension for $\underline{I}$, as a multiple-valued logic connective $\underline{I}(x, y, z, t) \in [0, 1]$ for $(x, y, z, t) \in [0, 1]^4$:

$$ \underline{I}(x, y, z, t) = \min(|\min(x, y) - \min(z, t)|, |\max(x, y) - \max(z, t)|) \quad (2) $$

It is straightforward to see that we retrieve the Boolean formula when $(x, y, z, t) \in \{0, 1\}^4$. Moreover, $\underline{I}(x, y, z, t) = 1$ only if $x = y = 0$ and $z = t = 1$, or if $x = y = 1$ and $z = t = 0$. When $x = y$ and $z = t$, $\underline{I}(x, y, z, t) = |x - z|$, i.e., it reflects the distance between the two pairs. Lastly, $\underline{I}(x, y, z, t) = 0$ as soon as the two pairs have the same minimum or the same maximum. Altogether $\underline{I}(x, y, z, t)$ is all the greater that one pair has high values (close to 1) and the other has low values (close to 0).

**Remark 1.** This should not be confused with the multiple-valued logic extension of $\underline{I}(a, b, c, d)$, i.e., $\underline{I}(x, y, z, t) = \min(1 - |\min(x, t) - \min(1 - y, 1 - z)|, 1 - |\max(x, t) - \max(1 - y, 1 - z)|)$, equal to 1 for the 6 patterns that make the inverse paralogy true. It is associated via $\underline{I}(x, y, z, t) = A(x, 1 - y, 1 - z, t) = P(x, t, 1 - z, 1 - y)$ with the multiple-valued logic extension of parology:

$$ P(x, y, z, t) = \min(1 - |\min(x, y) - \min(z, t)|, 1 - |\max(x, y) - \max(z, t)|) \quad [13]. $$

It should be noted that neither the above multi-valued logic extensions $\underline{I}(x, y, z, t)$ and $P(x, y, z, t)$ nor any other definitions of logic proportions have yet been applied to clustering. $\square$

<figure><img src="image_41.png" /></figure>
**Remark 2.** Besides, since $\underline{I}(x, y, z, t)$ is maximal if one pair is uniformly 0 and the other uniformly 1, one may consider that $\underline{I}(x, y, z, t)$ estimates to what extent $(x, y)$ is at odds with $(z, t)$. This has not to be confused with the oddness measure based on heterogeneous logical proportions which is used in an approach to classification [14]. □

Thus, given two pairs of vectors $(a, b)$ and $(c, d)$, with $a = (a_1, \dots, a_n)$, $b = (b_1, \dots, b_n)$, $c = (c_1, \dots, c_n)$, $d = (d_1, \dots, d_n)$, where the feature values have been normalized in the unit interval, we compute their orthogonality componentwise, using $\underline{I}$:

$$ \mathrm{Ortho}(a_i, b_i, c_i, d_i) = \underline{I}(a_i, b_i, c_i, d_i) = \min(|\max(a_i, b_i) - \max(c_i, d_i)|, |\min(a_i, b_i) - \min(c_i, d_i)|) \quad (3) $$

and the orthogonality measure of the two pairs is defined as the average value over all the features, as follows:

$$ \mathrm{Ortho}(a, b, c, d) = \sum_i \mathrm{Ortho}(a_i, b_i, c_i, d_i)/n \quad (4) $$

# 4. Orthogonality-based clustering algorithm

Based on the orthogonality measure introduced in the previous section, we develop a foundational procedure for a novel clustering algorithm. This algorithm leverages pairs of points, rather than individual points, to assign data to suitable clusters. By doing so, it ensures that points with high similarity are consistently assigned to the same cluster.

In the next sub-sections, we first detail the basic procedure for the *Orthogonality-based clustering algorithm* that we denote OC then we provide its pseudo-code.

## 4.1. Basic Procedure of OC:

The key idea of the algorithm is to iteratively generate and refine mini-clusters by:

i) identifying "orthogonal" pairs of points based on the orthogonality measure, ii) assigning these pairs to preliminary mini-clusters, and finally iii) merging mini-clusters that exhibit low orthogonality indices between them.

The merging process is guided by a user-defined orthogonality threshold, which serves as a control parameter to determine the acceptable level of orthogonality for merging mini-clusters.

The basic procedure of this algorithm can be summarized by the following steps:

1. **Build pairs:** Find the pairs of nearest neighbors points.

2. **Compute Orthogonality matrix:** Calculate the Orthogonality measure between each two pairs of points and store them in an Orthogonality matrix.

3. **Form Mini-Clusters:** Group pairs with "low" Orthogonality index into initial mini-clusters.

4. **Refine Clusters:** Iteratively update the centroids (which here are pairs of close points) of these mini-clusters by examining and reassigning new pairs.

5. **Merge Mini-Clusters:** Compare the centroids of the mini-clusters based on their Orthogonality indexes and merge those below a given threshold.

6. **Repeat:** Continue refinement and merging until the termination criterion is met.

Let us take a closer look at the procedure described above:

**Pre-processing:** Given a set of data points $\mathcal{X}$ represented by $n$ features, we first need to normalize $\mathcal{X}$ to ensure that all features are scaled to the same range. This allows the orthogonality measure defined previously to be applied. A second basic pre-processing step consists in generating the set $\mathcal{P}$ of pairs of nearest neighbors points. To do so, unique pairs of points $p = (x, y) \in \mathcal{P}$ are generated, such that in each pair a point $x$ is associated with $y$ if $y$ is the nearest neighbor of $x$ (with regard to the Euclidean distance).

**Orthogonality Matrix Calculation:** In an offline step and for each two pairs $(p_i, p_j) \in \mathcal{P} \times \mathcal{P}$ we compute the "Orthogonality" index between these two pairs using the Orthogonality function defined in 4. These computed values are then stored in an orthogonality matrix $\mathcal{O}$.
**Initialization of Clusters:** We first identify the most "orthogonal" pairs from matrix $\mathcal{O}$ to initialize the first two clusters and their centroids. Then, we assign these pairs to the first two mini-clusters. Those clusters are considered as the most distinct ("orthogonal") clusters.

To complete the initialization process of mini-clusters, we iteratively identify additional potential centroids by checking the Orthogonality index of other pairs against the existing centroids and retain only those pairs $p$ that are sufficiently orthogonal to all existing centroids ($\text{Ortho}(p, C_i^*) > \beta, i = 1, \dots, K, C_i^*$ is the centroid of the $i^{th}$ created mini-cluster and $\beta$ is an initial Orthogonality threshold to build mini-clusters). Each selected pair $p$ forms the centroid of a new a mini-cluster.

**Cluster Assignment:** We iterate over all unclustered pairs $p \in \mathcal{P}$. For each $p$ and for each created mini-cluster $C$, we compute the Orthogonality index of $p$ with respect to the cluster's centroid $C^*$. This heuristic avoids computing the Orthogonality of $p$ with respect to individual pairs in each cluster which is computationally costly. Finally, we assign the pair $p$ to the cluster $C$ having the minimum Orthogonality.

**Refinement:** We update centroids for all clusters by calculating the average positions of the pair's points within each cluster. The update process is performed when a certain level $l$ of clustered pairs is achieved (e.g., $l = 50\%$ or $l = 75\%$ of the total number of pairs are already assigned).

**Merging Clusters:** Once all pairs are assigned to mini-clusters, we consider merging any two mini-clusters having low Orthogonality measure. To evaluate Orthogonality between mini-clusters, we compute the Orthogonality between all mini-cluster centroids, then we merge mini-clusters with Orthogonality index below a defined threshold $\theta$. Finally, we recalculate centroids and update the cluster assignments.

**Termination:** The whole process stops when no more clusters can be merged (i.e., all inter-cluster Orthogonality values between cluster's centroids exceed the threshold $\theta$).

The procedure will return the final number of clusters ($K$), the cluster centroids (as pairs of points), and the set $\mathcal{C}$ of cluster assignments for each data point $x \in \mathcal{X}$.

## 4.2. Algorithm

Algorithm 1 describes the main procedure of the proposed approach. This algorithm calls Function 2 to initialize mini-clusters and Function 3 to merge them when necessarily.

**Algorithm 1 Orthogonality-based Clustering Algorithm: OC**

**Require:** $\mathcal{X}$: Data points, $\beta$: Orthogonality threshold for initialization, $\theta$: Orthogonality threshold for merging clusters.

**Ensure:** $\mathcal{K}$: Number of clusters, $\mathcal{C}$: Final clusters, $\mathcal{C}^*$: Cluster centroids.

1: $\mathcal{X}_{norm} \leftarrow \text{Normalize}(\mathcal{X})$; $\mathcal{X} \leftarrow \mathcal{X}_{norm}$ ▷ 1. Preprocessing

2: $\mathcal{P} \leftarrow \{(a, b) \mid a, b \in \mathcal{X} \times \mathcal{X}, b = \text{Nearest-Neighbor}(a)\}$ ▷ 2. Compute Orthogonality Matrix

3: $\mathcal{O} \leftarrow \{\text{Ortho}_{i,j} \mid p_i, p_j \in \mathcal{P} \times \mathcal{P}, \text{Ortho}_{i,j} = \text{Ortho}(a, b, c, d), p_i = (a, b), p_j = (c, d)\}$

4: $\mathcal{C}, \mathcal{C}^*, \mathcal{K} \leftarrow \text{initialize\_centroids}(\mathcal{O})$ ▷ 3. Initialize Centroids and Mini-Clusters

5: **for** each unclustered $p = (a, b) \in \mathcal{P}$ **do** ▷ 4. Assign pairs to mini-clusters

6: $C \leftarrow \text{arg min}_j(\text{Ortho}(a, b, c, d) \mid C_j^* = (c, d), j = 1, \dots, \mathcal{K})$

7: $C$.append($p$)

8: **end for**

9: **if** $|\text{Clustered}(\mathcal{P})|/|\mathcal{P}| > l$ **then** UpdateCentroids($\mathcal{C}^*$) **end if** ▷ 5. Refinement

10: $\mathcal{C}, \mathcal{C}^*, \mathcal{K} \leftarrow \text{merge\_mini\_clusters}(\mathcal{C}, \mathcal{C}^*, \mathcal{K}, \theta)$ ▷ 6. Merge mini-clusters

return $\mathcal{K}$, final clusters $\mathcal{C}$, and final cluster centroids $\mathcal{C}^*$
# 5. Experiments

To evaluate the proposed approach to clustering, we perform a set of preliminary experiments on some datasets wildly used in clustering problems.

We also compare its efficiency to the well-known *k-means* clustering algorithm [8]. In the following, we first introduce the testing datasets and the *k-means* algorithm then we show the experimental results obtained with *OC* as well as with *k-means*. Codes and data are available at https://github.com/myriambounhas/Orthogonality-basedClustering

## 5.1. Datasets

We experiment with two types of datasets: two synthetic and two real-world datasets.

**1. Blobs Dataset:** The blobs dataset consists of synthetic, Gaussian-distributed clusters with adjustable parameters such as the *number of centers* (*N*), the *standard deviation*, and the *sample size*. It is ideal for evaluating clustering algorithms on linearly separable, convex clusters, making it widely used for methods like *k-Means* clustering for example.

**Algorithm 2 initialize_centroids Function**

Require: $\mathcal{O}$: Orthogonality matrix,
$\beta = 0.1$: an initializing threshold.

Ensure: $\mathcal{C}$: Initial clusters, $\mathcal{C}^*$: Initial centroids, $\mathcal{K}$: Initial number of clusters.

1: $(C_0, C_1) \leftarrow \arg \max_{i,j}(\mathcal{O})$

2: $C_0^* \leftarrow p_i, C_1^* \leftarrow p_j$

3: $\mathcal{C} \leftarrow \{C_0, C_1\}, \mathcal{C}^* \leftarrow \{C_0^*, C_1^*\}$

4: $\mathcal{K} \leftarrow 2$

5: $\{Cand_{MC}\} \leftarrow \arg \max_i(\mathcal{O})$

6: **for** each $p = (a, b) \in \{Cand_{MC}\}$ **do**

7: Good$_p$ $\leftarrow$ true

8: **for** each $C^* = (c, d) \in \mathcal{C}^*$ **do**

9: Ortho$_p$ $\leftarrow$ Ortho$(a, b, c, d)$

10: **if** Ortho$_p$ < $\beta$ **then**

11: Good$_p$ $\leftarrow$ false

12: **break**

13: **end if**

14: **end for**

15: **if** Good$_p$ **then**

16: $C_K^* \leftarrow p$

17: $\mathcal{C} \leftarrow \mathcal{C} \cup \{C_K\}$

18: $\mathcal{C}^* \leftarrow \mathcal{C}^* \cup \{C_K^*\}$

19: $\mathcal{K} \leftarrow \mathcal{K} + 1$

20: **end if**

21: **end for**

return $\mathcal{C}, \mathcal{C}^*, \mathcal{K}$

**Algorithm 3 merge_mini clusters Function**

Require: $\mathcal{C}$: Clusters, $\mathcal{C}^*$: Cluster centroids, $\mathcal{K}$: Number of clusters, $\theta$: a threshold.

Ensure: Updated $\mathcal{C}, \mathcal{C}^*, \mathcal{K}$.

1: $\mathcal{M}^* \leftarrow \{\text{Ortho}_{i,j} \mid C_i^*, C_j^* \in \mathcal{C}^* \times \mathcal{C}^*, \text{Ortho}_{i,j} = \text{Ortho}(a, b, c, d), C_i^* = (a, b), C_j^* = (c, d)\}$

2: **while** $\mathcal{K} > 2$ **do**

3: minOrtho $\leftarrow \min_{i,j}(\mathcal{M}^*)$

4: $(C_i, C_j) \leftarrow \arg \min_{i,j}(\mathcal{M}^*)$

5: **if** minOrtho > $\theta$ **then**

6: **break**

7: **else**

8: $C_i \leftarrow C_i \cup C_j$

9: UpdateCentroids($\mathcal{C}^*$)

10: $\mathcal{K} \leftarrow \mathcal{K} - 1$

11: **end if**

12: **end while**

return $\mathcal{C}, \mathcal{C}^*, \mathcal{K}$

**2. Moons Dataset:** The moons dataset is a synthetic data that contains two interleaved crescent-shaped clusters, presenting a challenge for clustering algorithms that rely on linear separability. It is commonly used to test non-linear clustering techniques highlighting their ability to capture complex patterns.

**3. Mall Dataset:** The mall dataset is a real-world dataset that includes customer features such as *age*, *income*, and *spending scores*. It is frequently used for customer segmentation, showcasing the application of clustering in identifying consumer behavior patterns for targeted marketing.
**4. Iris Dataset:** This dataset includes measurements of sepal and petal dimensions for three Iris flower species. While often used for classification, it serves as a benchmark for clustering, demonstrating algorithms' ability to uncover natural groupings in multi-dimensional data.

**5.2. k-means clustering for comparison**

$k$-means is a widely used clustering algorithm that divides data into $k$ clusters based on feature similarity. It starts by randomly selecting $k$ initial centroids, then iteratively assigns each data point to the nearest centroid and updates the centroids as the mean of the assigned points. This process continues until the centroids stabilize or a specific stopping condition is met. $k$-means performs well with spherical, linearly separable clusters but may struggle with non-convex shapes or clusters of different sizes. Despite its simplicity, it is an efficient and scalable method, commonly used for pattern recognition and exploratory data analysis. However, $k$-means requires the number of clusters $K$ to be specified beforehand, which may not always be known or easy to estimate. $k$-means usually exploits the *Elbow* method [15] to estimate the optimal value of $k$ in a preliminary step. In the following, we denote $k$-means as *KM* for simplicity.

**5.3. Experimental results:**

We first recall that, contrary to *KM*, the proposed *OC* algorithm enables us to directly estimate the number of clusters during the initialization process (once an orthogonality threshold is given) without using any additional procedure.

To evaluate the *OC* algorithm, we adopt the following strategy: we compare our algorithm to two versions of *k*-means: *k*-means using the *Elbow* method for fixing *K* (denoted *KME*), and *k*-means using *K* estimated by our approach (denoted *KMO*). This helps to compare the *Elbow* method to our orthogonality-based method for estimating *K*, in addition to comparing the clustering approaches themselves.

To evaluate *OC*, *KME*, and *KMO*, we use three evaluation metrics: the *Silhouette Score* (*SS*), the *Calinski-Harabasz Index* (*CHI*), and the *Davies-Bouldin Score* (*DBS*) for unsupervised learning datasets (Blobs, Moons, and Mall), and we apply the *Adjusted Rand Index* (*ARI*) score for the supervised learning dataset Iris. Higher values (close to 1) of *SS*, *CHI*, and *ARI* are better while lower values of *DBS* are better. In this experiment, we tested with the following parameters for the 2 synthetic datasets: -Blobs: *size* = 500, *features* = 2, *centers* = *N*(*Nisavariable*), *random-state* = 42. -Moons: *size* = 300, *noise* = 0.05.

Clustering results, obtained with the Blobs dataset, are displayed in Figures 1, 2 respectively for *N* = 3 (on the left) and *N* = 5 (on the right) and in Figures 3, 4 respectively for *N* = 7 (on the left) and *N* = 10 (on the right). *N* is the number of centers in each original dataset.

Figures 5 and 6 display results for the Moon dataset respectively for *OC* (on the left) and *KM* (on the right). Similarly, results for the Mall are given in Figures 7 and 8 and Iris in Figures 9 and 10. In Table 3 we provide the obtained scores with *OC* as well as *KME* and *KMO* for the Blobs dataset while in Table 4 we save the scores for Moon and Mall datasets. For the Iris dataset, the obtained *ARI* values are 0.90 and 0.89 respectively for *OC* and *KM* algorithms. *Best scores are given in bold in Tables 3 and 4.* The threshold $\beta$, used to initialize mini-clusters, is fixed to 0.1 for all the tested datasets while threshold $\theta$ varies with the tested dataset and its value is shown in Tables 3 and 4.

Looking at the results of the Blobs dataset, *OC* shows a high ability to detect the correct number of clusters with various sizes from 3 to 10. In particular, we can see in Table 3 that *OC* outperforms *KME* for the 5, 7 and 10 number of clusters for all the used metrics (we recall that *KME* is simply *k*-means using the *Elbow* method to assess the number of clusters). This demonstrates the efficiency of our strategy to explore the right number of clusters using orthogonality-matrix assessment. As can be seen, for example in Figures 2, 3 and 4 for *KME*, the *Elbow* method is underestimating the number of clusters which consequently forces *KME* to "unnecessarily" merge some distinct clusters (see the *Elbow* results in the last row and *KME* results in the second row of Figures 2, 3 and 4).
Moreover, the performance of *k*-means is significantly improved when we force it to use the value of *K* predicted by the *orthogonality*-based method (*KMO*), when compared to *KME* (using *Elbow*) for *N* = 5, *N* = 7. Even though, *KMO* still shows limited ability if compared to *OC* for the large number of clusters *N* = 10. In particular, in the third row of Figure 4, we can see that *KMO* fails to find the suitable clusters: it unnecessarily splits one cluster into two (the black and yellow) ones and also unnecessarily merges two distinct clusters (the brown one).

<figure><img src="image_42.png" /><figcaption>Figure 1: Results for the Blobs dataset with N=3</figcaption></figure>

<figure><img src="image_43.png" /><figcaption>Figure 2: Results for the Blobs dataset with N=5</figcaption></figure>

Now, for the Moons dataset, the proposed approach and the *Elbow* method predict the same number of clusters (*N* = 2). The *OC* algorithm seems slightly better at distinguishing between the two moons and shows better scores in Table 4, but as *k-means* fails to fully identify them.

Regarding the real Mall dataset, both *OC* and the *Elbow* method succeed in detecting the correct number of clusters (*N* = 5). Moreover, although both *OC* and *KM* have similar SS, CHI and DBS metrics, *OC* demonstrates a clearly better competency in distinguishing between clusters (see the green and brown clusters in Figure 7), while *KM* assigns "very" close points to different clusters (see the boundary between the cyan and brown clusters in Figure 8). This is basically thanks to the pair-based
<figure><img src="image_44.png" /></figure>

Orthogonality-based Clustering

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

K-means Clustering with elbow-K

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

K-means Clustering with ortho-K

<figure><img src="image_47.png" /><figcaption>Figure 3: Results for the Blobs dataset with N=7</figcaption></figure>

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

Orthogonality-based Clustering

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

K-means Clustering with elbow-K

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

K-means Clustering with ortho-K

<figure><img src="image_51.png" /><figcaption>Figure 4: Results for the Blobs dataset with N=10</figcaption></figure>

<figure><img src="image_52.png" /><figcaption>Figure 5: Results of OC for the Moon dataset</figcaption></figure>

<figure><img src="image_53.png" /><figcaption>Figure 6: Results of KM for the Moon dataset</figcaption></figure>

strategy of assigning data points to clusters, which enables *OC* to avoid separating very similar points. Finally, for the Iris dataset, both *OC* and *Elbow* succeed in predicting the 3 clusters. Moreover, *OC* algorithm is still slightly better than *KM* at predicting the class for data points with an *ARI* = 0.9 if compared to *KM* (*ARI* = 0.89).

Overall, the obtained results highlight the interest of the orthogonality-based approach to clustering which is competitive with *k*-means. In particular, *OC* shows more robust behavior with regards to a
<figure><img src="image_54.png" /><figcaption>Figure 7: Results of OC for the Mall dataset</figcaption></figure>

<figure><img src="image_55.png" /><figcaption>Figure 9: Results of OC for the Iris dataset</figcaption></figure>

<figure><img src="image_56.png" /><figcaption>Figure 8: Results of KM for the Mall dataset</figcaption></figure>

<figure><img src="image_57.png" /><figcaption>Figure 10: Results of KM for the Iris dataset</figcaption></figure>

large number of clusters (e.g., N = 10). It also behaves well for real datasets.

<table><caption>**Table 3**</caption><thead><tr><th rowspan="2">θ = 0.15</th><th colspan="3">Blobs (N=3)</th><th colspan="3">Blobs (N=5)</th><th colspan="3">Blobs (N=7)</th><th colspan="3">Blobs (N=10)</th></tr><tr><th>OC</th><th>KME</th><th>KMO</th><th>OC</th><th>KME</th><th>KMO</th><th>OC</th><th>KME</th><th>KMO</th><th>OC</th><th>KME</th><th>KMO</th></tr></thead><tbody><tr><th>SS</th><td><strong>0.84</strong></td><td><strong>0.84</strong></td><td><strong>0.84</strong></td><td><strong>0.73</strong></td><td>0.71</td><td><strong>0.73</strong></td><td><strong>0.71</strong></td><td>0.65</td><td><strong>0.71</strong></td><td><strong>0.68</strong></td><td>0.55</td><td>0.61</td></tr><tr><th>CHI</th><td><strong>8309</strong></td><td><strong>8309</strong></td><td><strong>8309</strong></td><td><strong>3070</strong></td><td>1809</td><td><strong>3070</strong></td><td>2893</td><td>986</td><td><strong>2908</strong></td><td><strong>2014</strong></td><td>729</td><td>1400</td></tr><tr><th>DBS</th><td><strong>0.22</strong></td><td><strong>0.22</strong></td><td><strong>0.22</strong></td><td><strong>0.34</strong></td><td>0.45</td><td><strong>0.34</strong></td><td><strong>0.37</strong></td><td>0.50</td><td><strong>0.37</strong></td><td><strong>0.41</strong></td><td>0.73</td><td>0.59</td></tr></tbody></table>

Evaluation metrics of OC and KM for the Blobs with various centers (3,5,7 and 10)

<table><caption>**Table 4**</caption><thead><tr><th rowspan="2"></th><th colspan="3">Moon (θ = 0.35)</th><th colspan="3">Mall (θ = 0.25)</th></tr><tr><th>OC</th><th>KME</th><th>KMO</th><th>OC</th><th>KME</th><th>KMO</th></tr></thead><tbody><tr><th>SS</th><td><strong>0.49</strong></td><td>0.47</td><td>0.47</td><td><strong>0.56</strong></td><td><strong>0.56</strong></td><td><strong>0.56</strong></td></tr><tr><th>CHI</th><td><strong>441</strong></td><td>384</td><td>384</td><td>261</td><td><strong>264</strong></td><td><strong>264</strong></td></tr><tr><th>DBS</th><td><strong>0.78</strong></td><td>0.82</td><td>0.82</td><td>0.57</td><td><strong>0.56</strong></td><td><strong>0.56</strong></td></tr></tbody></table>

Evaluation metrics of OC and KM for the Moon and Mall datasets

# 6. Conclusion

This paper is a preliminary study, the first of its kind. Based on an orthogonality index, closely related to analogical proportions, a new procedure dealing with pairs rather than points, and requiring no a priori information on the number of clusters, has been proposed. First experiments show that it can compete with k-means method. Moreover the proposed method is able to determine the number of clusters, at the expense of a quadratic increase of complexity. It is clear that further works are needed to explore more the potentials of the proposed procedure and improve it (in particular, a study is needed for knowing how to fix the threshold parameter for the orthogonality index), but also comparisons with algorithms other than k-means, as well as scalability studies.

# Acknowledgements

This research was supported by the ANR project "Analogies: from theory to tools and applications" (AT2TA), ANR-22-CE23-0023.
References

[1] L. Miclet, S. Bayoudh, A. Delhay, Analogical dissimilarity: definition, algorithms and two experiments in machine learning, JAIR, 32 (2008) 793–824.

[2] M. Bounhas, H. Prade, G. Richard, Analogy-based classifiers for nominal or numerical data, Int. J. Approx. Reason. 91 (2017) 36–55.

[3] M. Bounhas, H. Prade, Analogy-based classifiers: An improved algorithm exploiting competent data pairs, Int. J. Approx. Reason. 158 (2023) 108923.

[4] M. Bounhas, H. Prade, Revisiting analogical proportions and analogical inference, Int. J. Approx. Reason. 171 (2024) 109202.

[5] M. Couceiro, E. Lehtonen, Galois theory for analogical classifiers, Ann. Math. Artif. Intell. 92 (2024) 29–47.

[6] M. Couceiro, E. Lehtonen, L. Miclet, H. Prade, G. Richard, When nominal analogical proportions do not fail, in: J. Davis, K. Tabia (Eds.), Scalable Uncertainty Management - Proc.14th Int. Conf., SUM'20, Bozen-Bolzano, September 23-25, volume 12322 of LNCS, Springer, 2020, pp. 68–83.

[7] S. P. Lloyd, Least squares quantization in PCM, IEEE Trans. Inf. Theory 28 (1982) 129–136.

[8] A. K. Jain, Data clustering: 50 years beyond k-means, Pattern Recognition Letters 31 (2010) 651–666. doi:10.1016/j.patrec.2009.09.011.

[9] H. Prade, G. Richard, From analogical proportion to logical proportions, Logica Universalis 7(4) (2013) 441–505.

[10] H. Prade, G. Richard, Homogenous and heterogeneous logical proportions, IfCoLog J. of Logics and their Applications 1 (2014) 1–51.

[11] H. Prade, G. Richard, On different ways to be (dis)similar to elements in a set. boolean analysis and graded extension, in: J. P. Carvalho, M. Lesot, U. Kaymak, S. M. Vieira, B. Bouchon-Meunier, R. R. Yager (Eds.), Proc. 16th Int. Conf. on Information Processing and Management of Uncertainty in Knowledge-Based Systems (IPMU'16), Eindhoven, June 20-24, Part II, volume 611 of Commun. in Computer and Infor. Sci., Springer, 2016, pp. 605–618.

[12] M. Bounhas, H. Prade, Logical proportions-related classification methods beyond analogy, in: F. D. de Saint-Cyr, M. Öztürk-Escoffier, N. Potyka (Eds.), Proc. 15th Int. Conf. on Scalable Uncertainty Management (SUM'22), Paris, Oct. 17-19, volume 13562 of LNCS, Springer, 2022, pp. 219–234.

[13] H. Prade, G. Richard, From default to analogical and paralogical reasoning. logics of pairs and their multiple-valued extensions, in: M. Lesot, S. M. Vieira, M. Z. Reformat, J. P. Carvalho, F. Batista, B. Bouchon-Meunier, R. R. Yager (Eds.), Proc. 20th Int. Conf. on Information Processing and Management of Uncertainty in Knowledge-Based Systems (IPMU'24), Lisbon, July 22-26, Vol. 1, volume 1174 of Lecture Notes in Networks and Systems, Springer, 2024, pp. 189–202.

[14] M. Bounhas, H. Prade, G. Richard, Oddness/evenness-based classifiers for boolean or numerical data, in: Int. J. of Approximate Reasoning, volume 82, Elsevier, 2017, pp. 81–100.

[15] C. M. Bishop, Pattern Recognition and Machine Learning, Springer, New York, 2006.