arXiv:2610.21644cs.LGOct 2026

Manuscript Offprint

arXiv:2610.21644

Efficient Pairwise Difference Learning: A Comparative Study of Encoding Strategies and Training Pair Selection

Bernard Georges, Mohamed Karim Belaid, Manuel Rodrigues

Bernard Georges 1^{1}, Mohamed Karim Belaid 2^{2}, and Manuel Rodrigues 1^{1}

1^{1} University of Minho, ALGORITMI CENTER LASI, Braga, Portugal pg53698@uminho.pt, manuel.rodrigues@algoritmi.uminho.pt

2^{2} IDIADA Fahrzeugtechnik GmbH, Munich, Germany karim.belaid@idiada.com

Abstract. Pairwise Difference Learning for Classification (PDC) enhances supervised learning in low-data regimes by training a binary similarity classifier on pairs of instances rather than individual samples, effectively inflating the training set from n to O(n2)O(n^2) examples. However, the PDC framework leaves critical implementation choices underspecified, particularly regarding input representation and pair selection strategies. This work systematically investigates these design decisions through extensive empirical evaluation. We compare four feature encoders—paired features, triplet with relative difference, absolute difference, and a novel triplet with absolute difference—alongside four pair selection strategies ranging from exhaustive to kernel-thinning-based schemes. Experiments across nearly 200 benchmark classification datasets using Decision Tree, Multilayer Perceptron, Gaussian Naïve Bayes, and Support Vector Classifier as base models reveal that the proposed triplet with absolute difference encoder ( ϕ3dabs\phi_{3dabs}) achieves the highest average F1 scores. More notably, restricting training to upper-triangle pairs reduces computational time by approximately 40% with negligible accuracy loss. Kernel thinning-based selection provided no accuracy benefits while substantially increasing computational overhead. Overall, PDC configurations outperformed base models in 94% of tested cases, though no single configuration dominated universally, suggesting dataset-specific optimization remains an open challenge.

Keywords: Pairwise Difference Learning · Classification · Low-data regimes · Feature encoding · Pair selection

1 Introduction

Many machine learning applications operate in regimes where labeled examples are limited or expensive to acquire. In such settings, simply increasing model complexity is often less effective than enriching the supervision signal extracted from the available data. Pairwise learning schemes offer one such avenue: instead of learning from isolated samples, they create additional supervision by forming

Preprint (version submitted before peer review). Published in: Recent Trends and Challenges in Information Systems and Technologies (WorldCIST 2026), LNNS vol. 2092, Springer, https://doi.org/10.1007/978-3-032-32023-0_31

B. Georges et al.

pairs of instances and encoding their relative relationships. Recent work has shown that pairwise methods can improve accuracy and robustness in regression and classification, especially in low-data regimes [11, 13, 6, 8, 10, 15, 4, 7, 1, 2, 12].

In this work, we focus on Pairwise Difference Learning for classification (PDC) [1]. PDC solves a multiclass classification task by training a binary “similar vs. dissimilar” classifier on pairs of examples and then using its outputs to reconstruct class posteriors. Intuitively, instead of asking the model to predict the label of a single point, PDC asks how likely two points are to share the same class. By pairing the n training points, the method inflates the number of effective training examples to O(n2)\mathcal{O}(n^{2}), exposing the learner to rich comparative information that is particularly useful when data are scarce.

Formally, let D={(xi,yi)}i=1n\mathcal{D} = \{(x_i, y_i)\}_{i=1}^n with xi∈Rdx_i \in \mathbb{R}^d and yi∈{1,…,K}y_i \in \{1, \ldots, K\}. PDC first selects a set of index pairs

P⊆{1,…,n}2,i≠j,\mathcal{P}\subseteq\{1,\ldots,n\}^{2},\quad i\neq j,

and applies a feature map

ϕ:Rd×Rd→Rm,zi,j=ϕ(xi,xj),\phi:\mathbb{R}^{d}\times\mathbb{R}^{d}\to\mathbb{R}^{m},\qquad z_{i,j}=\phi(x_{i},x_{j}),

Which encodes joint information about the two inputs (for example, their concatenation and/or their differences). Each pair receives a binary label.

si,j=1{yi=yj},s_{i,j}=\mathbf{1}\{y_{i}=y_{j}\},

Indicating whether the two instances share the same class. A base classifier g is trained on the paired dataset.

Dpair={(zi,j,si,j):(i,j)∈P},\mathcal{D}_{\mathrm{p a i r}}=\{(z_{i,j},s_{i,j}):(i,j)\in\mathcal{P}\},

Learning to distinguish similar from dissimilar pairs. At prediction time, a query point x is compared to a set of training anchors {xj}\{x_j\}, producing scores

s^j(x)=g(ϕ(x,xj)),\hat{s}_{j}(x)=g\big(\phi(x,x_{j})\big),

which estimate how likely x is to share its class with anchor xjx_{j}. Aggregating these scores over anchors of each class k yields an estimate of the posterior class probabilities, from which the final prediction is obtained by selecting the class with the highest estimated probability.

Research gap. While the PDC framework is conceptually simple, it leaves several important implementation choices open. In practice, different PDC variants [4, 7, 1] differ at least along two dimensions: (i) the input representation ϕ(x,x′)\phi(x, x') used for the similarity model g, and (ii) the definition of the pair set P, that is, which pairs are generated and used for training and prediction. The original PDC variant of [1] adopts a specific encoding and an almost exhaustive triplet-based pairing scheme, which can be computationally expensive and may include many weakly informative pairs. To the best of our knowledge, there is no systematic comparison of alternative input formats and pairing strategies within a unified experimental protocol.

Contributions. We build on the PDC formulation of [1] and systematically study how these implementation choices affect its behaviour in practice. Our contributions are:

  1. We compare three different input formats for the similarity model in PDC, varying how the two instances and their differences are represented in ϕ(x,x′)\phi(x, x'), and study their impact on predictive performance and computational cost.

  2. We compare four pairing strategies for PDC, ranging from exhaustive to more selective schemes, and analyze how the choice of P influences accuracy, training time, and effective dataset size.

  3. We conduct an empirical evaluation on a suite of benchmark classification datasets, providing practical guidance on which PDC design choices are most effective under different data and resource constraints.