Data aggregation combines features or messages from a node’s neighborhood into a representation the node can use. It is central to message passing: each GNN layer gathers local information, transforms it, and updates node embeddings. Aggregation matters when a prediction depends on relationships between nodes, such as categorizing products in a graph. section 3.2 section 3.4.2
For a one-hop neighborhood, start with the features of nodes connected to the central node. Combine them with an operation such as mean, sum, or max. Neighbor order must not change the result: a graph’s node ordering is not part of the information being modeled. The combined features then pass through the layer’s transformation and update steps. section 3.4.1 section 3.4.2
The choice of aggregation changes what a layer emphasizes:
- Mean represents typical neighborhood features; sum retains their combined magnitude. Either can blur features that matter in a particular task. section 3.2 section 3.2.3
- Max highlights strong individual features, but can overemphasize outliers when typical behavior matters. section 3.2.3
- A GCN sums neighboring information with symmetric normalization to address differences in node degree. Self-loops also bring the central node’s features into its embedding. section 3.4.3
- GraphSAGE aggregates a randomly sampled subset of neighbors rather than requiring the entire neighborhood. Its SAGEConv layer supports choices including mean, pool, and LSTM aggregation. section 3.4.6 section 3.1.2
In PyTorch Geometric, set GraphSAGE aggregation per SAGEConv layer, or pass a list such as ['max', 'sum', 'mean'] to use several strategies in one layer. A first-layer mean followed by second-layer max is another option. These configurations should be tested rather than assumed to improve performance; graph connectivity, feature distributions, runtime, and memory needs all affect the choice. Jumping Knowledge is related but different: it combines outputs from different layers. section 3.2.2 section 3.2.3
Table 3.5 Classification performance for GraphSAGE models with list aggregations added
|
Aggregation type
|
F1 score
|
Log loss
|
|---|---|---|
|
Mean (default)
|
0.7406
|
2.1214
|
|
Sum
|
0.7384
|
2.2496
|
|
Max
|
0.7449
|
2.1039
|
|
Layered: Mean
→Max
|
0.7316
|
2.2041
|
|
Layered: Sum
→Max
|
0.7344
|
2.345
|
|
List (standard)
|
0.7484
|
2.622
|
|
List (exotic)
|
0.745
|
2.156
|
Compare F1 score and log loss for single, per-layer, and list aggregations on the same GraphSAGE classification task. The highest F1 score does not correspond to the lowest log loss. section 3.2.2


















