
Welcome back to the second article in our series about knowledge graph-based recommender systems. In our preceding post, we presented a fresh perspective on the recommendation process by harnessing the power of graphs to structure the relevant data. By organizing the data in a graph format, the recommendation task is seen as a link-prediction task.
In this post, we will first introduce knowledge graphs and how they can be used in recommender systems to provide more accurate and personalized recommendations to users. Then, we will delve deeper into the topic and explore some of the key components of a knowledge graph-based recommender system. We will discuss how data is collected and organized within the knowledge graph, how it is used to generate recommendations, and some of the challenges involved in developing such a system.
Knowledge Graphs (KGs)
The term "Knowledge Graph" was popularized by Google in 2012 to describe its graph structured knowledge base containing hundreds of millions of entities and relationships. It has played a major role in the company’s search engine since 2012, providing detailed answers to search queries questions by displaying a sidebar containing specific information about entities mentioned in users queries. More generally, a knowledge graph is a graph-structured knowledge base that stores factual information in the form of relationship between entities (or literal values), enabling the modeling of real world entities and their relations, and consequently powering search engines, natural language understanding systems and more recently recommender systems.
The following figure offers a visual representation of a Knowledge graph that incorporates diverse information on movies, actors, and movie users considered as entities. The relations between these entities are established via links that indicate their various relationships, such as ‘isFanOf’, ‘HasGenreOf’, or ‘isDirectorOf’. This form of knowledge representation enables the system to infer connections between entities and generate recommendations that are more relevant and personalized to users’ preferences. By leveraging the power of these connections, knowledge graph-based recommender systems can deliver an unparalleled level of accuracy and precision in recommending relevant items to users.

Knowledge Graph based recommender systems
In recent years, knowledge graphs have been used in recommender systems in order to overcome the problem of user-item interactions sparsity and the cold start problem which CF methods suffer from by leveraging properties about items and users and representing them in one single data structure.
The figure below depicts a movie Knowledge Graph and shows how a knowledge-graph based recommendation can be provided to the user u₂.

Beyond the simple lists of properties already managed by previous versions of recommender systems, KGs represent and leverage semantically rich relations between entities. By construction, KGs can easily be linked between each other. For example, it would be straightforward to extend the graph from the figure above to include movies’ main characteristics. One remarkable thing about KG recommender systems is their ability to make use of the KG structure to provide better recommendations [1].
In general, existing KG-based recommendations can be classified into two main categories:
- Embedding-based methods, which are a subclass of knowledge graph-based recommender systems, consist in pre-processing a KG using Knowledge Graph Embedding algorithms [2] and then incorporating the learned entity embeddings into a recommendation framework. By using knowledge graph embedding algorithms, it is now possible to turn virtually any type of information into a vector which the system can learn. For example [3], Zhang et al. propose a two stages approach that consists in first computing the embeddings coming from a knowledge base composed of structural knowledge, image and text representing the items, then use the generated embeddings as input of a CF algorithm. In another research work [4], Zhang et al. make use of various types of side information about the items (e.g. review, brand, category, bought-together, etc.) to construct a knowledge graph which is subsequently used to construct items and users embeddings. As a second step, the recommender system rank candidate items j in an ascending order of a distance between uᵢ and vⱼ . To summarize, many of the embedding-based methods are composed of two stages: first, entities’ (items, users, etc.) embeddings are learned; second, embeddings are incorporated into a recommendation learning algorithm.

- Path-based methods which explore "the various patterns of connections among items in a KG to provide additional guidance for recommendations". However, they heavily rely on manually designed meta-paths which are hard to optimize in practice. In [5], Yu et al. use the matrix factorization method to compute latent representation of entities for different sub-graphs extracted from a heterogeneous KG, and then use an aggregation method to group all the generated latent representation to compute a recommendation probability. Inspired by the work proposed in [5], Zhao et al. considers the KG as a heterogeneous information network (HIN). They extract path based latent features to represent the connectivity between users and items along different types of relation paths. The drawback of these methods is that they commonly need expert knowledge to define the type and number of meta-paths. With the development of deep learning algorithms, different models have been proposed to automatically encode KG meta-paths through embeddings to overcome the above mentioned limitations.

Another category of KG Recommender Systems is worth mentioning. This category of recommender systems considers the whole structure of the KG instead of solely KG triples. RippleNet, an "end-to-end framework that naturally incorporates the knowledge graph into recommender systems" was proposed in [7]. "Similar to actual ripples propagating on the water, RippleNet stimulates the propagation of user preferences over the set of knowledge entities by automatically and iteratively extending a user’s potential interests along links in the knowledge graph".

Conclusion
In conclusion, knowledge graphs provide a powerful way to structure data for recommendation systems by representing entities and their relationships in a graph format. Different methods of knowledge graph-based recommender systems have been proposed, including path-based, embedding-based, and graph convolutional networks-based methods. These methods offer varying degrees of accuracy and scalability, depending on the size and complexity of the knowledge graph. While there are obvious challenges involved in developing these systems, knowledge graph-based recommender systems hold great promise for providing more accurate and personalized recommendations to users.
In the next article of this series, we will delve deeper into the topic of KG embedding algorithms. We will discuss how these algorithms are used to generate embeddings that capture the semantic meaning of entities and their relationships within a knowledge graph. This will provide a better understanding of how KG embeddings are generated and why they are beneficial for recommender systems. Stay tuned for the next post!
References:
[1] Zhu Sun, Jie Yang, Jie Zhang, Alessandro Bozzon, Long-Kai Huang, and Chi Xu. Recurrent knowledge graph embedding for effective recommendation. In Proceedings of the 12th ACM Conference on Recommender Systems, RecSys ’18, page 297–305, New York, NY, USA, 2018. Association for Computing Machinery.
[2] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 26, Lake Tahoe, Nevada, United States, 2013. Curran Associates, Inc.
[3] Fuzheng Zhang, Nicholas Jing Yuan, Defu Lian, Xing Xie, and Wei-Ying Ma. Collaborative Knowledge Base Embedding for Recommender Systems. In 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 353–362, New York, NY, USA, 2016. AC
[4] Yongfeng Zhang, Qingyao Ai, Xu Chen, and Pengfei Wang. Learning over knowledgebase embeddings for recommendation. CoRR, abs/1803.06540, 2018.
[5] Xiao Yu, Xiang Ren, Yizhou Sun, Quanquan Gu, Bradley Sturt, Urvashi Khandelwal, Brandon Norick, and Jiawei Han. Personalized entity recommendation: A heterogeneous information network approach. In Proceedings of the 7th ACM International Conference on Web Search and Data Mining, WSDM ’14, page 283–292, New York, NY, USA, 2014. Association for Computing Machinery.
[6] Huan Zhao, Quanming Yao, Jianda Li, Yangqiu Song, and Dik Lun Lee. Meta-graph based recommendation fusion over heterogeneous information networks. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’17, page 635–644, New York, NY, USA, 2017. Association for Computing Machinery.
[7] Hongwei Wang, Fuzheng Zhang, Jialin Wang, Miao Zhao, Wenjie Li, Xing Xie, and Minyi Guo. 2018. RippleNet: Propagating User Preferences on the Knowledge Graph for Recommender Systems. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management (CIKM ’18). Association for Computing Machinery, New York, NY, USA, 417–426.