An encoder–decoder architecture separates representation learning from prediction. For graph data, the encoder transforms discrete structure and features into continuous node embeddings; the decoder reconstructs graph properties or produces task-specific predictions. section 11.2 section 12.3
A graph-based implementation typically follows this pipeline:
- Encode neighborhood information with a GNN such as GCN, GAT, or GraphSAGE; message passing updates each node representation using neighboring nodes. section 12.1.4 section 12.3
- Decode the learned representations with a task-specific function: log_softmax produces node-classification values, while a dot product scores possible links. section 12.1.4 section 12.2.4
- Choose the encoder according to the graph and operational trade-offs: simpler methods use fewer resources, while richer neural encoders require more data and computation. section 11.2.3
From karate-club walks to predictions
Node2Vec generates random walks through the karate-club friendship network, balancing broad exploration with deeper movement through tightly connected groups. It converts walk context into member vectors, then estimates how likely two members are to connect using vector similarity. Similar vectors can reveal factions, bridge members, and leadership-related structure. section 11.2.4
Figure 12.4 Overview of the main steps of the encoder–decoder architecture. Homogeneous graph data, consisting of transactions (nodes) and Bitcoin flows (edges), is processed using three GNN encoders: GCN, GAT, and SAGE. Each encoder generates unique node representations by aggregating neighbor features. Then these representations are transformed into probability values, which are used to classify transactions as licit or illicit.
Trace homogeneous transaction data through GCN, GAT, and SAGE encoders into probabilities classifying transactions as licit or illicit. section 12.1.4
Figure 12.9 Pipeline for processing heterogeneous graph data in a link prediction system for movie recommendations. The data consists of users and movies as node types and user–movie ratings as edges. Embeddings are generated, with user embeddings learned by the model and movie embeddings initialized from genre features. The data is processed using three heterogeneous GNN encoders (H-GraphConv, H-GAT, and H-SAGE), which aggregate neighbor features to generate node representations. A dot product then quantifies the compatibility between users and movies, with higher scores indicating a greater likelihood of interaction. The scores are finally converted into probabilities representing the likelihood of a link between users and movies.
Compare heterogeneous recommendation processing: learned user embeddings and genre-initialized movie embeddings pass through a heterogeneous GNN, then a dot product estimates interaction likelihood. section 12.2.4









