Finance glossary

What is a graph neural network (GNN)?

Bristol James
7 Min

Graph neural networks (GNNs) represent a specialised branch of artificial intelligence (AI) and deep learning. These networks are designed to make inferences from data structured as graphs.

Unlike traditional machine learning models that deal with pixels (such as images) or data sequences (such as text), GNNs excel in scenarios where the relationship between data points is just as important as the data points themselves.

A simple comparison of the data points in a GNN compared with images and text
A simple comparison of the data points in a GNN compared with images and text (Source: Neptune Labs)

The key components of a GNN

Before we dive into the technical aspects and applications of GNNs, it’s important to understand the key components first.

Nodes (vertices)

Nodes are the fundamental entities in a graph. In finance, they may represent different entities such as customers, accounts, transactions or financial products.

Edges

Edges represent the relationships between nodes and could represent:

  • A transaction between two accounts.
  • A connection between a borrower and lender, or
  • The relationship between two different financial institutions.

Depending on whether the relationship flows in one direction or both, edges can be directed (A → B) or undirected (A ↔ B).

Graph

A graph is the entire network comprised of nodes and edges. This could represent a network of accounts that transact with each other or the interconnected web of firms in a supply chain.

When data are represented in this way, GNNs can capture the rich and complex relationships that are fundamental to financial analysis.

An example graph neural network in finance that depicts the relationships between entities, bank accounts, phone numbers and other nodes.
An example graph neural network in finance that depicts the relationships between entities, bank accounts, phone numbers and other nodes (Source: viso.ai)

How GNNs work in finance

At the core of GNNs is a process known as message passing – a process that allows information to flow between connected nodes in a graph.

Here’s how it works.

Step 1 – Node initialisation

Each node starts with its own feature vector. Think of a feature vector as a collection of numerical values that represent the characteristics of an entity in a dataset.

For example, a transaction’s feature vector could contain details like transaction amount, date, time and location.

Step 2 – Message passing

In the second step, nodes send their feature vectors to connected nodes, receive information in return, and update their own features in response. This process is known as message passing.

With each iteration, individual nodes learn from their direct and distant neighbours to better understand their respective positions within the network.

Step 3 – Aggregation

Aggregation is a process whereby each node collects and combines information from adjacent nodes. In short, this helps the node learn from the structure of its local neighbourhood and not just from its own features.

A node that represents a bank account, for example, may aggregate data from accounts it transacts with to better understand transaction patterns.

Step 4 – Update

After aggregation, the node’s feature vector is updated using a neural network function. This enables the GNN to capture more complex patterns and relationships that are not immediately obvious from the raw data.

Step 5 – Output

After several rounds of iteration, the neural network produces the final graph representation.

In addition to determining the relationships between nodes, the output can also be used to classify the graph or predict node labels. In the latter case, a label could indicate whether a bank account is considered legitimate or fraudulent.

What are the different types of GNNs?

There are several types of GNNs to suit various tasks and purposes.

Here are three of the most relevant to financial applications.

Graph Convolutional Networks (GCNs)

GCNs were first introduced in 2014 as a means of applying neural networks to data structured in graphs.

Now one of the most popular architectures, GCNs assess each node and its neighbours to learn from both their features and the network of relationships the nodes represent.

Convolutional neural networks are best suited to tasks like node classification, link prediction and pattern identification.

Graph Attention Networks (GATs)

Graph Attention Networks are a GNN variant that leverages attention mechanisms to learn about graph features. To do this, GATs assign different weights to different neighbours.

These networks have been used to predict high-return ratio stocks based on text data, transaction data and market sentiment information.

Graph Auto-Encoders (GAEs)

GAEs are well suited to tasks such as link prediction, which makes them ideal for detecting fraudulent connections between accounts.

These networks compress the graph into a lower-dimensional space and then reconstruct it to identify missing links or hidden relationships.​

How GAEs compress financial networks into a lower dimensional vector space in money laundering detection
How GAEs compress financial networks into a lower dimensional vector space in money laundering detection (Source: Karim, Chala & de Perthuis 2024)

Applications of GNNs in finance

Now that we understand how GNNs work on a broad level, let’s take a look at some of the varied ways they are utilised in finance.

Fraud detection

In traditional, rule-based fraud detection systems, each transaction or account is typically analysed in isolation. This makes it easier for fraudsters to evade detection and spread fraudulent transactions across multiple accounts.

GNNs, on the other hand, can detect subtle patterns and nonlinear relationships in the data that are indicative of fraud. What’s more, they are more accurate, more scalable and more adaptable to evolving cyber threats than rule-based systems.

Recent applications of graph neural networks include detection of credit card fraud, insurance fraud and money laundering.

Credit scoring

Another powerful application of GNNs lies in credit scoring.

Traditional credit scoring models such as FICO rely on individual data points across areas such as:

  • Types of credit used.
  • Length of credit history.
  • New credit accounts.
  • The current level of debt, and
  • Payment history.

However, FICO does not consider the relationships between borrowers (such as shared accounts or co-signers) which can influence an individual’s creditworthiness.

GNNs can improve this process by incorporating data on the network of relationships between individuals. If a borrower has ties to multiple others who have defaulted on their loans, this factor could be incorporated into their credit score.

Other neural networks assess the credit risk of companies and may be able to predict how the interconnected worldwide economy spreads credit risk from one company to another.

3 – Anti-money laundering (AML)

Money laundering networks are often difficult to detect and involve numerous accounts and complex transactional webs. However, graph neural networks are up to the task.

GNNs excel in this area by mapping the flow of money across a network and identifying unusual patterns that may indicate laundering.

To understand this, let’s return to the concept of nodes and edges but in a money-laundering context:

  • Nodes – each node may be an individual account, corporate account or entity that performs financial transactions. Node attributes include transaction frequency, transaction type (e.g. domestic, international or online) and any other relevant metadata.
  • Edges – which are formed when money moves from one account to another. Edge attributes include transaction time and date, currency type and transaction type (wire transfer, ATM withdrawal and so on).

As part of AML efforts, GNNs review the nodes of each attribute and look for behavioural pattern anomalies.

If an account that tends to deal in small, infrequent transactions suddenly shifts toward larger and more frequent transactions, deep learning models can flag it for review.

4 – Risk management

As we briefly touched on earlier, GNNs can also be used in risk management. Whether it involves credit, market or systemic risk, these networks map out the interconnectedness of firms, assets and markets to identify vulnerabilities.

Compared to traditional machine learning techniques, GNNs achieve statistically significant improvements in systemic risk prediction. While research is still in the initial phases, researchers also believe GNNs could be used to predict financial network risk based on a combination of data and tweets.

Others believe GNNs could be used to evaluate the impact of regulatory measures designed to mitigate risk in financial networks.

5 – Recommendation systems

In finance, recommendation systems that incorporate GNNs can help banks and financial platforms offer personalized services.

For instance, investment platforms analyse customer transaction histories, investment patterns and social relationships to recommend tailored investment products. Credit card companies can also use GNNs to offer personalised rewards programs based on spending behaviour.

The challenges of graph neural networks

GNNs are undoubtedly powerful and present tremendous upside. However, they are not without their limitations.

Interpretability

Like many neural networks, GNNs are enigmatic in the sense that it is sometimes difficult to understand how they arrive at certain predictions.

This may not be problematic in many industries, but issues may arise in finance where regulatory standards demand transparency.

To mitigate this, researchers are developing ways to explain the decision-making process of GNN models. One particular avenue involves tracking which nodes and edges most heavily influence the model’s output.

Scalability

The tendency for GNNs to struggle with large datasets may also be a problem in finance. Transaction networks, for example, can involve millions of nodes and billions of edges (transactions), and the computational cost associated with analysing them can be prohibitive.

But cost isn’t the only issue. Since GNNs need to aggregate information from all connected nodes, the analysis may suffer from slow processing times, long training durations and high memory consumption.

The issue of scalability will persist as global financial systems become increasingly integrated and less cash-based.

Summary:

  • Graph neural networks are a type of neural network specifically designed to work with data represented as graphs. A graph is a data structure made up of nodes (which represent entities) and edges (which represent the connections or relationships between those entities).
  • GNNs can be used in a variety of financial contexts, such as fraud detection, recommendation systems, anti-money laundering, risk management and credit scoring.
  • Despite their utility, the somewhat enigmatic nature of GNNs may create friction with financial regulatory standards. There is also the issue of decreased performance and increased cost as datasets grow.

Related articles

Finance glossary

What is vendor management?

Vendor management is the act of ensuring that your third-party vendors meet regulatory requirements and contractual obligations. This safeguards your business from …

Read more
Finance glossary

What is MFA?

Multi-factor authentication (MFA) is a security method that requires users to prove their identity using two or more distinct factors before accessing …

Read more
Finance glossary

What are imposter scams?

Imposter scams are a type of fraud where scammers pretend to be trusted individuals, companies, or government agencies to deceive victims into …

Read more

The new security standard for business payments

End-to-end B2B payment protection software to mitigate the risk of payment error, fraud and cyber-crime.