Inferensys

Glossary

Graph Construction

Graph construction is the feature engineering process of transforming raw relational data—such as transaction logs and account ownership records—into a structured graph format with defined nodes, edges, and attributes suitable for GNN ingestion.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
FEATURE ENGINEERING

What is Graph Construction?

Graph construction is the feature engineering process of transforming raw relational data into a structured graph format with defined nodes, edges, and attributes suitable for ingestion by graph neural networks.

Graph construction is the systematic transformation of raw relational data—such as transaction logs, account ownership records, and device interactions—into a structured graph representation. This process defines the nodes (entities like accounts or merchants), edges (relationships like transfers or logins), and associated attributes (features like transaction amount or timestamp) that form the input for graph neural networks.

The quality of graph construction directly determines downstream model performance in fraud detection. Critical design decisions include whether to build a homogeneous or heterogeneous graph, how to handle temporal dynamics through dynamic graph snapshots, and which edge weighting schemes best capture transactional significance. Poorly constructed graphs introduce structural noise that obscures the relational patterns GNNs are designed to detect.

FOUNDATIONS

Key Characteristics of Effective Graph Construction

The feature engineering process of transforming raw relational data into a structured graph format with defined nodes, edges, and attributes suitable for GNN ingestion.

01

Entity Resolution & Deduplication

The critical preprocessing step of mapping raw identifiers to canonical node entities. This involves resolving multiple representations of the same real-world actor (e.g., a user with multiple email addresses or device IDs) into a single, unique node. Without rigorous deduplication, the graph becomes sparse and fragmented, diluting the neighborhood aggregation signal. Techniques include fuzzy string matching, probabilistic record linkage, and deterministic rule-based matching on personally identifiable information (PII) hashes.

02

Schema Design: Heterogeneous Nodes & Edges

Defining a rich ontology of node types (e.g., AccountHolder, Merchant, Device, IP_Address) and edge types (e.g., TRANSFERS_TO, LOGS_IN_FROM, OWNS). A heterogeneous schema preserves the semantic meaning of different relationships, enabling Relational Graph Convolutional Networks (R-GCNs) to apply distinct learnable weight matrices per edge type. This prevents the model from conflating a TRANSFERS_TO relationship with a SHARES_DEVICE_WITH relationship.

03

Temporal Edge Weighting

Assigning time-decayed weights to edges based on transaction recency. A transaction from yesterday should exert more influence on a node's current state than one from five years ago. This is implemented by applying an exponential decay function to edge features or by creating time-weighted adjacency matrices. This technique is essential for constructing dynamic graphs where the relevance of historical behavior diminishes, preventing stale data from masking emerging fraud patterns.

04

Feature Engineering for Nodes & Edges

Populating nodes and edges with dense, numerical attribute vectors. Node features include account age, average transaction velocity, and risk scores. Edge features capture transaction amount, currency type, authorization response code, and time delta since the last interaction. These features serve as the initial input signals for the GNN's message-passing layers. Categorical features must be properly encoded (e.g., one-hot or learned embeddings) to avoid imposing false ordinal relationships.

05

Graph Sampling & Batching

The strategy for extracting manageable subgraphs from a massive, billion-edge transaction network for mini-batch training. Techniques like GraphSAINT and Cluster-GCN partition the full graph into smaller, densely connected clusters that preserve local structure. This overcomes the memory bottleneck of loading the entire adjacency matrix onto a GPU. Effective sampling ensures that each training batch is a statistically representative microcosm of the global fraud patterns.

06

Train/Test Split Integrity

The methodology for partitioning a graph dataset without introducing data leakage. Unlike random row-wise splitting in tabular data, graph splitting must account for message-passing dependencies. A naive split allows a test node's features to influence a training node's embedding through shared edges. The correct approach uses temporal splitting (training on past edges, testing on future edges) or inductive node splitting that masks test nodes and their incident edges entirely during training.

GRAPH CONSTRUCTION FAQ

Frequently Asked Questions

Answers to the most common technical questions about transforming raw relational data into structured graph formats optimized for graph neural network ingestion in financial fraud detection.

Graph construction is the feature engineering process of transforming raw relational data—such as transaction logs, account ownership records, device fingerprints, and IP session data—into a structured graph format with defined nodes, edges, and attributes suitable for ingestion by graph neural networks (GNNs). In financial fraud detection, this involves mapping heterogeneous entities like account holders, merchants, devices, and bank branches as nodes, while representing monetary transfers, shared credentials, and co-location events as edges. The constructed graph captures both explicit relationships (direct fund transfers) and implicit relationships (shared phone numbers or device IDs), enabling downstream models to learn structural patterns indicative of fraud rings, money laundering layering, and synthetic identity clusters. The quality of graph construction directly determines the signal available to GNN architectures, making it a critical preprocessing step that bridges raw data engineering with advanced graph learning.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.