Skip to main content
QUICK REVIEW

[Paper Review] Predicting Pairwise Relations with Neural Similarity Encoders

Franziska Horn, Klaus‐Robert Müller|arXiv (Cornell University)|Feb 6, 2017
Neural Networks and ApplicationsComputer Science56 references7 citations
TL;DR

This paper introduces SimEc, a novel neural network architecture that learns low-dimensional, similarity-preserving embeddings by training a mapping from input features to embeddings such that the dot product of embedded vectors approximates pairwise similarities. Unlike spectral methods, SimEc enables out-of-sample predictions without requiring kernel functions, handles missing values, and supports non-metric similarities and multi-relational prediction, achieving state-of-the-art performance on benchmark datasets.

ABSTRACT

Matrix factorization is at the heart of many machine learning algorithms, for example, dimensionality reduction (e.g. kernel PCA) or recommender systems relying on collaborative filtering. Understanding a singular value decomposition (SVD) of a matrix as a neural network optimization problem enables us to decompose large matrices efficiently while dealing naturally with missing values in the given matrix. But most importantly, it allows us to learn the connection between data points' feature vectors and the matrix containing information about their pairwise relations. In this paper we introduce a novel neural network architecture termed Similarity Encoder (SimEc), which is designed to simultaneously factorize a given target matrix while also learning the mapping to project the data points' feature vectors into a similarity preserving embedding space. This makes it possible to, for example, easily compute out-of-sample solutions for new data points. Additionally, we demonstrate that SimEc can preserve non-metric similarities and even predict multiple pairwise relations between data points at once.

Motivation & Objective

  • To develop a neural network architecture that learns similarity-preserving embeddings from pairwise relations without relying on known kernel functions.
  • To enable out-of-sample predictions for new data points by learning a direct mapping from input features to the embedding space.
  • To handle missing values in similarity matrices effectively, unlike traditional spectral methods.
  • To support the prediction of non-metric similarities and multiple pairwise relations simultaneously.
  • To provide a flexible, trainable framework that generalizes beyond standard kernel PCA and spectral decomposition.

Proposed method

  • SimEc uses a feed-forward neural network to learn a mapping f′: xi → yi from original input features xi to low-dimensional embedding vectors yi.
  • The model minimizes the reconstruction error between the target similarity matrix S and the dot product of embedding vectors, i.e., min ||S − Y Yᵀ||².
  • It supports both metric and non-metric similarities by learning the embedding space directly from the target matrix S.
  • The model can handle missing values in S by using weighted error functions during training.
  • For multi-relational prediction, SimEc can jointly learn embeddings for multiple similarity matrices by stacking them into a tensor or summing them into a single matrix.
  • The framework allows for end-to-end training on GPUs using a Keras-based implementation, enabling efficient inference and out-of-sample generalization.

Experimental results

Research questions

  • RQ1Can a neural network learn similarity-preserving embeddings that support out-of-sample predictions without requiring known kernel functions?
  • RQ2How well can a neural model handle missing values in pairwise similarity matrices compared to spectral methods?
  • RQ3Can SimEc effectively learn and predict non-metric similarities, such as those derived from human ratings?
  • RQ4To what extent can SimEc jointly predict multiple pairwise relations (e.g., positive and negative similarities) in a single model?
  • RQ5Does the model’s ability to learn from unknown or non-kernel-based similarity sources improve generalization and performance on downstream tasks?

Key findings

  • SimEc achieves competitive performance on benchmark datasets such as MNIST and CIFAR-10, matching or exceeding the performance of kernel PCA in similarity reconstruction.
  • The model successfully enables out-of-sample predictions even when the target similarities are derived from unknown processes, such as human ratings.
  • SimEc handles missing values in the similarity matrix effectively, outperforming traditional SVD-based methods that require complete matrices.
  • When trained on stacked or summed similarity matrices (e.g., S₁ + S₂), SimEc preserves information from both components, with prediction errors comparable to models trained on individual matrices.
  • Using the last layer weight matrix Wₗ to predict individual similarity matrices (e.g., S₁ and S₂) yields lower errors than using the dot product Y Yᵀ, demonstrating the model’s capacity for multi-relational learning.
  • The framework generalizes well to real-world applications such as drug-protein interaction prediction, recommender systems, and psychophysics, as demonstrated by its extension to context encoders (ConEc).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.