Concept explained: Graph Neural Networks & Recommender Systems

4th July 2023

Concept explained: Graph Neural Networks & Recommender Systems

We interact with recommender systems near-daily: on our streaming services, shopping online, on social media.

What seems like a common and simple concept – show me things I might like based on other things I like – is actually an immensely complex AI application powered by a variety of data science techniques. One of the advanced methods gaining prominence in this space is the use of Graph Neural Networks (GNNs).

What is it?

A Graph Neural Network is a type of machine learning model inspired by the human brain (hence ‘neural’). GNNs are specifically designed to handle data structured as a graph, which is essentially a collection of nodes (vertices) and the relationship or connections between them (edges or links). In a graph, nodes represent entities like items, people, or events, while edges represent relationships between these entities.

For instance, in a social media network, each person is a graph node, and a connection is an edge between two nodes. In e-commerce/retail, each item can be viewed as a node, and there would be an edge connecting the nodes of items often purchased at the same time. The strength of this interaction/connection can be derived from historical transactions.   

GNNs were first introduced in 2009 and have transformed the way we analyse and interpret relational, graph-structured data.

With GNNs we can perform:

  • node classifications – predicting the labels or attributes of nodes in a graph, e.g. classifying users in a social network as being part of a certain community or group based on their connections and interactions.
  • link prediction – predicting if a link or relationship exists between two nodes or establishing the strength of this connection, e.g. predicting user-item interactions in an e-commerce setting.
  • graph classification – predicting the labels or attributes of entire graphs, e.g. in science, classifying molecules (which can be represented as graphs) into different categories based on their structures.
insight image

Why use it?

insight image

GNNs are enormously useful when applied to recommender systems, transforming the way we shop, consume, and more.

Recommender systems analyse patterns of user behaviour and preferences to suggest products or services that might interest them. They play a pivotal role in enhancing user experience and driving revenue growth in sectors such as e-commerce for product recommendations, online entertainment for film recommendations, social networking for connection recommendations and many others.

The Netflix Prize (2006) was a competition aimed at improving the accuracy of its movie and TV recommendations to individual users, using their historical interaction data. The results of the contest contributed significantly to the popularisation of AI and machine learning approaches in the field of recommender systems.

Despite advancements in using machine learning for recommender systems, most businesses still use a fairly simple methodology known as collaborative filtering. This is like breaking down a big puzzle into smaller, simpler pieces to understand it better. The limitations of this appear when dealing with complicated user behaviours or when we need to work with really big data sets. That's where GNNs come in: a new type of AI model that is superior at handling complicated structures and interactions within data.

GNNs are a fast-growing research area receiving attention from both the academic community and business. Recently, researchers at Pinterest and Stanford University developed PinSage (see the original paper, or an article by one of the engineers), a network designed for recommending a large number of items. The way PinSage is built makes it more suitable for handling the large and constantly changing data typically seen in recommender systems, allowing it to give more accurate and personalised recommendations. Uber Eats also adapted a GraphSage approach (used in PinSage) in their recommender system to highlight the foods that individual users find most appealing (see the link).

What are the pitfalls?

Despite their significant potential, GNNs have a few limitations. They require substantial computational resources to run due to the complexity of graph structures, making it challenging to handle real-world graphs with millions or billions of nodes and edges.

The quality of the graph is also critical. If the relationships between nodes are inaccurately represented or if the graph is overly sparse or dense, it can adversely affect the performance of GNNs, underscoring the need for careful data pre-processing and robust feature engineering.

insight image

In summary, GNNs offer a robust solution for handling complex, relational data, especially in recommender systems.

Despite existing challenges, frameworks like PinSage are continually pushing the envelope, paving the way for more accurate, personalised recommendations. As our interaction with graph-structured data grows, the relevance and importance of GNNs will undoubtedly rise, marking them as a key area of interest for forward-thinking businesses.

For those who are interested in a more technical and detailed exploration of how GNNs are used for recommender systems, we would point you to some additional resources (see the link).

Contact us