LCMAggregation
A GNN aggregator that learns its own commutative operator and folds neighbours over a log-depth tree.
Graphs and geometry · 56 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Graphs and geometry
- Parameters
- 6.9K
- Operations
- 56
- Framework
- PyTorch
- Recurrent
- No
- Published
- LoG 2022 (PMLR 198)
- Cited by
- 3 (as of 18 October 2026)
- Authors
- Euan Ong, Petar Veličković
- Source
- torch_geometric 2.6.1
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m1494
- Graph hash
- 0f026f80d2dd3a510748b47e076d6e48314fc0b8495f8168f3685bf3689aad02
- Skeleton hash
- 502dd77821bcc6960aa4782db53022d83bdf9841296b33b3216fed0e24cec100
- Architecture hash
- c0c1b06265f2d47da3c78edd18c49bd171f22683d05ac076f4bfaf4fb915580d
- Diagram SHA-256
- 7ae57a54d7d3178661c241f204b399be07e29f6dfa101aa10e24ae3a1c496cd1
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
LCMAggregation is the learnable commutative monoid aggregator from Ong and Veličković's paper: instead of fixing a graph neural network's neighbourhood reduction to sum, max or mean, it learns the commutative, associative binary operator itself. The motivation is that GNNs have been shown to be highly sensitive to the choice of aggregation function. Recurrent aggregators are more expressive, but their $O(V)$ depth makes them both difficult to parallelise and harder to train on large graphs.
The fix is to fold over a balanced binary tree instead of a list, which yields an aggregator of $O(\log V)$ depth and exponential improvements in parallelism and dependency length. The operator at each tree node is a GRU cell made strongly commutative by symmetrising it, which the paper calls Binary-GRU. The PyTorch Geometric module captured here does exactly that: at every level of the tree it executes one GRUCell for all (left, right) pairs in parallel, averages the two orderings, and carries any unmatched element up to the next level. Two library caveats apply: the operator requires sorted indices as input, and it is not a permutation-invariant operator.
On the paper's second-minimum benchmark the learnable aggregators were the only ones to learn the task near-perfectly in distribution, while the LCM achieved an exponential speedup over recurrent aggregators on large sets. For sets of 200 elements, Binary-GRU-Assoc took 79.4 seconds per epoch where the GRU took 397.2.
Key idea. Replacing the list-shaped recurrent aggregator with a learned commutative, associative binary operator folded over a balanced binary tree, cutting aggregation depth from O(V) to O(log V) while staying competitive with recurrent aggregators.
- LCM aggregation
- LCMAggregation
- learnable commutative monoid
- Binary-GRU
- learnable aggregator
- GNN aggregation function
- PyTorch Geometric
- Ong
- Veličković
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{ong2022learnablecommutativemonoidsgraph,
title={Learnable Commutative Monoids for Graph Neural Networks},
author={Euan Ong and Petar Veličković},
year={2022},
eprint={2212.08541},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2212.08541},
}