How to make latent factors interpretable by feeding Factorization machines with knowledge graphs

Vito Walter Anelli, Tommaso Di Noia, Eugenio Di Sciascio, Azzurra Ragone, Joseph TrottaarXiv 2019 · arXiv

TL;DR

The paper introduces kaHFM (knowledge-aware Hybrid Factorization Machine), a novel recommendation approach that bridges the gap between accuracy and explainability. By initializing the latent factors of a Factorization Machine with explicit semantic features from a knowledge graph (like DBpedia), the model trains an accurate recommender system where every latent dimension retains a clear, human-readable meaning.

What Problem Does This Paper Address?

Modern model-based recommender systems, such as Matrix Factorization and Deep Learning architectures, are highly accurate but operate as "black boxes." They project users and items into a mathematical space of latent factors. While these latent factors capture complex interaction patterns well, they lack any direct semantic meaning. Consequently, it is incredibly difficult to explain why a specific item was recommended to a user.

While purely content-based approaches are transparent (e.g., "we recommended this movie because you like sci-fi"), they often suffer from lower accuracy and a lack of serendipity. The authors tackle a fundamental question: Can we build a model-based recommendation engine that delivers high accuracy while ensuring its internal latent space remains explicitly interpretable?

Methods

The authors propose the knowledge-aware Hybrid Factorization Machine (kaHFM). Instead of initializing a Factorization Machine with a standard arbitrary number of hidden dimensions ($k$) and random weights, kaHFM binds the latent space directly to real-world knowledge.

  1. Feature Mapping via Knowledge Graphs: The authors extract semantic triples (subject, predicate, object) from DBpedia for all items in the catalog.
  2. Dimension Binding: They set the number of latent factors $k$ to be exactly equal to the total number of unique semantic features ($|F|$) extracted from the knowledge graph.
  3. Semantic Initialization: Instead of random values, the item vectors are initialized using normalized TF-IDF weights calculated from the knowledge graph.
Fig. 1: A visual representation of X for sparse real valued vectors xui.

The model is trained using a Bayesian Personalized Ranking (BPR) criterion, which optimizes the weights based on implicit user feedback. Crucially, because the dimensions are explicitly bound to start with, the post-training matrix ($\hat{\mathbf{V}}$) still maps directly back to the original semantic features, but with refined weights that account for collaborative user interactions.

Fig. 2: Example of real valued feature vectors for different items vj. For lack of space we omitted the predicate dcterms:subject

New Evaluation Metrics

To rigorously evaluate interpretability, the authors introduce two offline metrics:

  • Semantic Accuracy (SA@K): Measures how well the trained model retains the item's original ground-truth features in its top-ranked dimensions.
  • Generative Robustness (1-Rob@K): Evaluates if the model can "rediscover" an important feature if it is intentionally deleted from the dataset before training.

Datasets

The approach was evaluated using two well-known movie recommendation datasets mapped to DBpedia:

  • Yahoo! Movies: Contains explicit movie ratings on a 1–5 scale, demographic data, and mappings to MovieLens.
  • Facebook Movies: An implicit feedback dataset released for the ESWC 2015 Linked Open Data challenge.

The features were split into three experimental settings to test different semantic impacts: Categorical (using dcterms:subject), Ontological (using rdf:type), and Factual (all other properties).

Key Insights and Ideas

  • Collaborative Tuning of Explicit Semantics: The core "aha" moment is that we don't have to choose between latent spaces and explicit features. By initializing latent factors with semantic data, the optimization process (gradient descent) simply fine-tunes the importance of known concepts rather than inventing uninterpretable ones.
  • Feature Regeneration: The model demonstrates a form of semantic intuition. Through the Robustness experiment, the authors showed that if you hide a key feature (e.g., removing the tag "Space adventure films" from Star Trek II), the collaborative training process can actually infer and restore that feature to the top of the item's vector based on user behavior and related items.
Top-10 features computed by kaHFM for the movie "Star Trek II - The Wrath of Khan," demonstrating highly interpretable latent dimensions

Key Results

  • Recommendation Accuracy: kaHFM consistently outperformed standard Factorization Machines (BPR-FM) and pure content-based Vector Space Models (VSM). In the Facebook Movies dataset, kaHFM nearly doubled the accuracy (Precision@10) of the baseline Attribute-Based Item-kNN approach.
  • Semantic Accuracy: On Yahoo! Movies, the model achieved an SA@M of 0.847. This means that out of the top ~12 features identified by the trained model, more than 10 perfectly matched the original semantic description of the item.
  • Robustness: In the face of missing data, kaHFM successfully regenerated the missing top feature 48.7% of the time for Yahoo! Movies and 82.1% of the time for Facebook Movies within the remaining available slots.

Limitations and Future Work

While kaHFM shows impressive results, the authors note a few limitations and areas for future exploration:

  • Focus on Item Vectors: This work primarily focused on making the item representation space interpretable. The authors note that analyzing the learned user vectors to extract similarly precise semantic user profiles is a crucial next step.
  • Sensitivity to Feature Types: Performance varied depending on the feature subset used. For instance, the Factual setting in Yahoo! Movies was susceptible to popularity bias, making it less precise than the Categorical and Ontological settings.
  • Knowledge Graph Completion: Because the model is robust enough to predict missing features, the authors suggest it could be adapted for knowledge graph completion tasks to help maintain databases like DBpedia.

Summary updated

Abstract

Model-based approaches to recommendation can recommend items with a very high level of accuracy. Unfortunately, even when the model embeds content-based information, if we move to a latent space we miss references to the actual semantics of recommended items. Consequently, this makes non-trivial the interpretation of a recommendation process. In this paper, we show how to initialize latent factors in Factorization Machines by using semantic features coming from a knowledge graph in order to train an interpretable model. With our model, semantic features are injected into the learning process to retain the original informativeness of the items available in the dataset. The accuracy and effectiveness of the trained model have been tested using two well-known recommender systems datasets. By relying on the information encoded in the original knowledge graph, we have also evaluated the semantic accuracy and robustness for the knowledge-aware interpretability of the final model.
BibTeX
@misc{anelli2019how,
  author = {Vito Walter Anelli and Tommaso Di Noia and Eugenio Di Sciascio and Azzurra Ragone and Joseph Trotta},
  title = {{How to make latent factors interpretable by feeding Factorization machines with knowledge graphs}},
  year = {2019},
  eprint = {1909.05038},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.05038},
}

Loading related content...

Figure