Intro to Geometric Deep Learning

Introduction Geometric Deep Learning: A Unifying Framework Graph Neural Networks: From Spectral to Spatial Beyond Permutation: Continuous Group Equivariance Interactive Demo

Introduction

On the page on deep neural networks, we surveyed the major architectural innovations of modern deep learning, including convolutional networks, residual connections, attention, and the Transformer. That page closed its survey with an observation about two of them, convolutional networks and attention, namely that each is built around a symmetry of its input domain. Convolutional networks commute with translations of the input image (exactly so for stride one on an unbounded or periodic grid), and unmasked self-attention commutes with permutations of the input tokens. The shared principle is that the architecture encodes the symmetry, so the network does not have to learn it from data.

That observation is the starting point of Geometric Deep Learning (GDL): a unifying framework which views CNNs, Transformers, graph neural networks, and equivariant architectures for 3D data as instances of a single design principle, namely equivariance under the symmetry group of the input domain.

The word "geometric" here is meant in its deep mathematical sense. A geometry is most naturally understood as the study of what remains invariant under a chosen group of transformations. Different choices of group give different geometries, such as a grid under translation, a set under permutation, a graph under node relabeling, or a sphere under rotation. An architecture is "geometric" when it respects the symmetries of its domain.

The present page introduces this framework, then develops its most directly accessible instance, the graph neural network (GNN), which generalizes message passing from regular grids and complete graphs to arbitrary graphs. We then survey how the framework extends beyond permutation symmetry to the continuous symmetries of three-dimensional space. This is the territory of equivariant neural networks for molecular structure, point clouds, and rigid-body manipulation.

The mathematical machinery for the continuous-symmetry case is substantial. It draws on Lie group theory, on representation theory of compact groups, and on the differential geometry of smooth manifolds. The present page stays at the level of design principle, showing why those foundations are needed and what kind of architecture they support.

Geometric Deep Learning: A Unifying Framework

The GDL framework, articulated by Bronstein, Bruna, Cohen, and Veličković, organizes deep architectures by the symmetry group of their input domain and the way each layer is required to commute with that group's action. Concretely, let \(\mathcal{X}\) be a domain with symmetry group \(G\) acting on it, and let \(G\) act on \(\mathcal{Y}\) as well. A layer \(f : \mathcal{X} \to \mathcal{Y}\) is said to be \(G\)-equivariant if \[ f(g \cdot x) = g \cdot f(x) \quad \text{for every } g \in G,\ x \in \mathcal{X}, \] and \(G\)-invariant if the right-hand side is replaced by \(f(x)\) itself.

Equivariance preserves symmetry information through the network, whereas invariance discards it. For a prediction that should be unchanged by the chosen symmetry, a common design stacks equivariant layers and finishes with an invariant pooling step, so that the output is invariant while intermediate representations remain sensitive to the symmetry.

The major architectures we have already surveyed can all be placed in this framework. The table below organizes them by the domain they act on and the symmetry group encoded in the architecture.

Remark: Architectures Organized by Symmetry
Architecture Domain Symmetry group Equivariance type
MLP \(\mathbb{R}^d\) trivial none
CNN grid (image / volume) translation \(\mathbb{Z}^d\) translation-equivariant (stride one, unbounded or periodic grid)
Transformer set (no positional encoding or causal mask) symmetric group \(S_n\) permutation-equivariant
GNN graph (features \(\mathbf{X}\) + adjacency \(\mathbf{A}\)) symmetric group \(S_n\) joint permutation of features and topology: \((\mathbf{X}, \mathbf{A}) \mapsto (P\mathbf{X}, P\mathbf{A}P^\top)\)
Steerable / \(SE(3)\)-equivariant NN 3D point cloud, molecular structure \(SO(3)\), \(SE(3)\) continuous group equivariance

The table makes the unification explicit. The MLP, alone among the architectures listed, encodes no symmetry. It is the baseline against which the others, all GDL instances, are compared. CNNs, Transformers, GNNs, and \(SE(3)\)-equivariant networks all share the same template. The template identifies the symmetry group of the data domain and constrains each layer to commute with its action. The architectures differ in which group acts and in how it acts.

The Transformer's place in this table deserves a closer look, because it is an example of GDL design philosophy. Self-attention applies scaled dot-product attention to queries, keys, and values read off from the same matrix of tokens: \[ \mathrm{Attn}(\mathbf{Q}, \mathbf{K}, \mathbf{V}) = \operatorname{softmax}\!\left( \tfrac{\mathbf{Q}\mathbf{K}^\top}{\sqrt{d_k}}\right)\mathbf{V}, \] with \(d_k\) the dimension of the queries and keys. Because \(\mathbf{Q}\), \(\mathbf{K}\), and \(\mathbf{V}\) all come from that one matrix, permuting its rows permutes the rows of the output identically. The layer therefore commutes with the symmetric group \(S_n\) acting on the token axis.

A Transformer without positional encoding and without a causal mask is therefore a permutation-equivariant set processor. Positional encoding deliberately breaks this symmetry to inject sequence order back into the architecture. The causal mask of a decoder, which keeps each position from attending to later ones, breaks it as well.

Graph neural networks generalize this picture in a direction the Transformer does not cover. An unmasked Transformer treats every pair of tokens as connected, so its connectivity is fixed by the architecture rather than given by the data. Most real data carries structure of its own. Bonds in a molecule join only certain pairs of atoms, only cited pairs in a citation network are linked, and connectivity in a road network is constrained by physical layout. A GNN takes the connectivity as part of its input. That input is a pair \((\mathbf{X}, \mathbf{A})\) of node features and an adjacency matrix, and the GNN \(f\) is designed to be equivariant under the joint action of \(S_n\) on both, where each permutation acts through its permutation matrix \(P\): \[ f(P\mathbf{X},\, P\mathbf{A}P^\top) = P\,f(\mathbf{X}, \mathbf{A}) \quad \text{for every } P \in S_n. \]

Both the Transformer (without positional encoding or causal mask) and the GNN are \(S_n\)-equivariant, and the difference lies in what \(P\) acts on. The Transformer permutes a feature matrix, whereas the GNN permutes a feature-adjacency pair, with the adjacency matrix conjugated so that the graph structure is permuted consistently with the node relabeling. For one fixed graph, the permutations preserving \(\mathbf{A}\) are exactly the graph isomorphisms from that graph onto itself, and they form its automorphism group. Those are the only relabelings that permute the features while leaving the graph itself fixed. The architecture, by contrast, is built to handle any graph, which is why a single trained GNN can be applied to graphs unseen at training time.

Graph Neural Networks: From Spectral to Spatial

Two essentially different approaches to constructing graph-based architectures emerged historically. The spectral approach, which starts from signal processing on graphs, defines convolution on a graph through the Graph Fourier Transform, parameterizes filters in the spectral domain, and recovers tractable architectures by polynomial approximation. The spatial approach defines a layer directly as local message passing between adjacent vertices. The two viewpoints are connected, since the spatial architecture known as the Graph Convolutional Network (GCN) is derived from a first-order Chebyshev approximation of a spectral filter. We treat them in turn.

The Spectral Side: Filters in the Frequency Domain

The graph Laplacian \(\mathbf{L} = \mathbf{D} - \mathbf{A}\) is real symmetric and positive semi-definite, so it admits an eigendecomposition \(\mathbf{L} = \mathbf{V}\boldsymbol{\Lambda}\mathbf{V}^\top\) with real non-negative eigenvalues. The eigenvalues play the role of "graph frequencies," with the eigenvectors as the corresponding modes, and the Graph Fourier Transform \(\hat{\mathbf{f}} = \mathbf{V}^\top \mathbf{f}\) decomposes a graph signal into its frequency components. A spectral graph convolution applies a filter \(g(\boldsymbol{\Lambda})\) to the spectrum: \[ \mathbf{f}_{\mathrm{out}} = \mathbf{V}\, g(\boldsymbol{\Lambda})\, \mathbf{V}^\top \mathbf{f}_{\mathrm{in}}. \]

Computing this directly requires the full eigendecomposition of \(\mathbf{L}\), which is prohibitive for large graphs. A common remedy applies the filter to a graph Laplacian, which need not be \(\mathbf{L}\), and approximates \(g\) by a low-degree polynomial, typically built from Chebyshev polynomials of the rescaled symmetric normalized Laplacian recalled in the next paragraph. The resulting architectures are efficient and localized, since a degree-\(K\) polynomial filter respects \(K\)-hop neighborhoods. The first-order case of this construction, simplified further, gives the GCN named above.

Our graph Laplacian page develops the Chebyshev approximation, the rescaling \(\tilde{\mathbf{L}} = (2/\lambda_{\max})\mathcal{L}_{\mathrm{sym}} - \mathbf{I}\) of the symmetric normalized Laplacian \(\mathcal{L}_{\mathrm{sym}} = \mathbf{D}^{-1/2}\mathbf{L}\mathbf{D}^{-1/2}\), which is defined when no vertex is isolated and whose largest eigenvalue is \(\lambda_{\max}\), and the renormalization trick used by the GCN. Here we recall only what we need to connect the spectral and spatial perspectives.

The Spatial Side: Message Passing

The spatial perspective begins from a different place. Rather than diagonalizing the Laplacian, we ask directly: what local computation respects graph structure? The answer takes the form of a message passing layer. At each layer \(k\), every vertex \(v\) updates its hidden state \(\mathbf{h}_v^{(k)}\) by aggregating messages from its neighbors and combining them with its own current state:

Definition: Message Passing Layer

A message passing layer updates vertex features by \[ \mathbf{h}_v^{(k+1)} = \mathrm{UPDATE}\!\left(\mathbf{h}_v^{(k)},\ \mathrm{AGGREGATE}\big(\{\!\!\{ \mathbf{h}_u^{(k)} : u \in \mathcal{N}(v) \}\!\!\}\big)\right), \] where \(\mathcal{N}(v)\) is the neighborhood of \(v\), \(\{\!\!\{\cdot\}\!\!\}\) denotes a multiset, \(\mathrm{AGGREGATE}\) is a permutation-invariant function over the neighborhood (sum, mean, max, attention-weighted sum), and \(\mathrm{UPDATE}\) is a learnable transformation (typically a small MLP).

The choice of \(\mathrm{AGGREGATE}\) and \(\mathrm{UPDATE}\) determines the architecture. The GCN uses a degree-normalized weighted sum derived from \(\mathcal{L}_{\mathrm{sym}}\). GraphSAGE uses sampled neighborhoods with a learnable pooling function, which addresses scalability on very large graphs. The Graph Attention Network (GAT) computes neighborhood weights by an attention mechanism and so recovers much of the flexibility of self-attention while restricting interactions to graph edges.

The Graph Isomorphism Network (GIN) replaces the aggregation with a sum followed by an MLP, a choice motivated by its connection to the 1-Weisfeiler-Lehman (1-WL) graph isomorphism test. Throughout, 1-WL starts from the input node features as its initial colors. With injective aggregation and update maps, \(k\) GIN layers tell apart exactly the pairs of vertices that \(k\) rounds of 1-WL tell apart. Given enough layers and an injective graph-level readout, GIN therefore tells apart every pair of graphs that 1-WL tells apart. Conversely, no message passing network tells apart a pair of graphs that 1-WL does not. The sum aggregation of GIN separates multisets of neighbor features that mean- or max-pooling cannot.

The crucial structural property of every message passing layer is automatic permutation equivariance. Relabeling the vertices of the graph produces a correspondingly relabeled output, because \(\mathrm{AGGREGATE}\) operates on a multiset of messages and is by definition invariant under their order. This property places GNNs in the GDL framework, since the architecture is constrained by its very construction to satisfy \(f(P\mathbf{X}, P\mathbf{A}P^\top) = Pf(\mathbf{X}, \mathbf{A})\) for every \(P \in S_n\).

Comparison with CNNs and Transformers

CNNs, Transformers, and GNNs admit a unified description as message passing on graphs, in a sense broader than the definition above. In that broader sense a message may depend on the edge it travels along, as the CNN's weights depend on the edge offset. The three architectures differ in which graph they use and in how messages are weighted:

The continuum from CNN through Transformer to GNN therefore moves from a fixed local graph, to a fixed complete graph with data-dependent edge weights, to a graph supplied by the data. The Transformer's success at scale suggests that the complete graph is often a useful default when no informative connectivity is given. The GNN is the natural choice when connectivity carries information that should be respected.

Equivariance with respect to graph structure suits GNNs to data that is intrinsically relational. Examples include molecular property prediction (where atoms and bonds form a graph), recommendation systems and social network analysis (where the user-item or user-user graph carries the predictive signal), knowledge graph completion, and traffic and network science.

Beyond Permutation: Continuous Group Equivariance

The GDL principle generalizes naturally beyond the discrete symmetries we have discussed so far. Consider a molecule represented not as an abstract graph but as a set of atoms with positions in three-dimensional space. Rotating or translating the entire molecule produces the same molecule, with its energy, stability, and chemical identity unchanged. A learned function predicting any of these properties should therefore be invariant under the group \(SE(3)\) of rigid motions, which combines rotations \(SO(3)\) with three-dimensional translations. A learned function predicting a vector-valued geometric quantity (a force, a velocity) should instead be equivariant under \(SE(3)\). Rotating the input then rotates the output by the same rotation.

Implicit in this distinction is a subtlety we have so far suppressed in our notation. The equivariance condition \(f(g \cdot x) = g \cdot f(x)\) writes the action of \(g\) the same way on both sides, but the actual action depends on the type of the quantity being acted on. A rotation \(R \in SO(3)\) acts trivially on a scalar (energy, total charge), as the standard \(3 \times 3\) rotation matrix on a vector (force, dipole moment), and via more elaborate formulas on higher-order tensors.

The systematic study of how a single group acts in different ways on different feature types is the representation theory of the group, and many equivariant networks for 3D data are organized by which representation each layer-feature transforms under. The same shorthand \(g \cdot x\) can therefore stand for genuinely distinct linear maps, and a careful theory must distinguish them.

Both \(SO(3)\) and \(SE(3)\) are continuous groups, and concretely they are matrix Lie groups. Building neural network layers that commute with their action requires more than the multiset symmetrization that powers GNNs.

A common approach decomposes vertex features into irreducible representations of the rotation group (scalars, vectors, and higher types indexed by the degree of the spherical harmonics) and constrains messages to transform appropriately under rotation. Messages are combined via Clebsch-Gordan products, the tensor product decompositions that respect the irreducible representation structure. The result is a graph-like architecture whose messages are themselves geometric objects rather than scalar features. Such an architecture knows, by its construction, how to handle the rotation of its input.

The mathematical machinery this requires includes irreducible representations of compact Lie groups, spherical harmonics, the Peter-Weyl theorem, and equivariant tensor product decompositions. The systematic construction of equivariant layers from irreducible representations and tensor product decompositions is the subject of our page on equivariant neural networks. Here we record only the application-side outcome.

Encoding continuous symmetry into the architecture has produced concrete advances in structural biology. There, AlphaFold 2's prediction of three-dimensional protein structure from amino-acid sequence, recognized by the 2024 Nobel Prize in Chemistry, relies on an attention mechanism designed to respect the rigid-motion symmetries of residues in 3D space. Equivariant architectures have also been developed for machine-learning interatomic potentials for molecular dynamics, and for robotic manipulation, where the geometry of physical configuration spaces naturally calls for \(SE(3)\)-equivariant policies.

Why the Mathematics Comes Next

Three threads converge in equivariant neural networks for 3D data. Lie groups provide the symmetry groups themselves and their algebraic structure. Representation theory decomposes feature spaces into irreducible building blocks compatible with the symmetry. The differential geometry of smooth manifolds supplies the natural setting for "data on a curved domain" and the analogue of the graph Laplacian (the Laplace-Beltrami operator) on such domains. The manifold series and the representation theory pages develop the groups, the representations, and the manifolds themselves, while the Peter-Weyl theorem connects compact groups and their representations back to harmonic analysis on Hilbert spaces. The GDL viewpoint makes the destination concrete. Each of these mathematical developments pays off in a specific class of equivariant architecture.

Interactive Demo

The demo above runs three architectures on the same input to test the central claim of this page. The GNN and Transformer panels run the same layer template \[ \mathbf{h}^{(k+1)} = \tanh\!\big( w_k\, \hat{\mathbf{A}}\, \mathbf{h}^{(k)} + b_k \mathbf{1} \big), \] with the two panels differing only in the structure matrix \(\hat{\mathbf{A}}\).

The GNN uses the fixed, sparse, degree-normalized adjacency matrix \(\hat{\mathbf{A}} = \tilde{\mathbf{D}}^{-1/2}(\mathbf{A} + \mathbf{I})\tilde{\mathbf{D}}^{-1/2}\) of the displayed graph, where \(\tilde{\mathbf{D}}\) is the degree matrix of \(\mathbf{A} + \mathbf{I}\). The Transformer computes a dense attention matrix \(\hat{\mathbf{A}}(\mathbf{h})_{ij} = \operatorname{softmax}_j(h_i h_j / \tau)\) from the current features, with a fixed temperature \(\tau \gt 0\) and every pair of vertices connected, so that the softmax over \(j\) runs over all vertices, including \(j = i\). The MLP replaces \(w_k \hat{\mathbf{A}}\) with a dense matrix \(\mathbf{W}_k\) of free parameters that mixes node coordinates by their index, and gives each vertex its own bias in place of \(b_k \mathbf{1}\). It uses no structure matrix at all, which is why its panel draws no edges.

The GNN panel and the Transformer panel share the same scalar weights \((w_k, b_k)\), so whatever differs between the two panels is attributable to the structure matrix alone. Node colors show the scalar feature at each vertex (blue negative, red positive). All weights are untrained, and for each depth they are drawn from fixed seeds.

The Layer slider scrubs a single forward pass through all three panels simultaneously. Layer 0 is the input, and each successive layer shows the features after one application of the template. Beneath each graph, a heatmap displays the matrix that mixes the vertices in the displayed transition. The GNN's heatmap does not change as we scrub, because its \(\hat{\mathbf{A}}\) is fixed by the graph. The Transformer's is recomputed from the features at every layer. The MLP's shows its own \(\mathbf{W}_k\), whose entries bear no relation to the graph's edges because the architecture has no notion of them. The Depth slider changes the number of layers and redraws the whole weight stack from the fixed seeds of the new depth.

The Shuffle Node Labels button is where the GDL claim becomes testable. Shuffling draws a random permutation \(P\) and applies it jointly to the node features and the adjacency matrix in all three panels at once. The equivariance condition \(f(P\mathbf{h}, P\mathbf{A}P^\top) = Pf(\mathbf{h}, \mathbf{A})\) is then evaluated on the original, unshuffled data with the same fixed weights, and each panel reports its own error.

For the GNN and the Transformer, the error sits at floating-point zero. For the MLP, the same shuffle produces an order-one discrepancy, flagged in red. The dense weight matrix and the per-vertex biases both depend on how the nodes are indexed. The contrast is not a matter of better or worse training. It is built into the architectures by construction, before any training has occurred.

The attention used here is genuine scaled dot-product attention, specialized to scalar features. The specialization loses nothing structural. At feature dimension one, the scale \(\sqrt{d_k}\) equals \(1\), and the query and key maps are multiplications by scalars \(\alpha\) and \(\beta\), so the score is \(\alpha\beta\,h_i h_j\). The demo takes \(\alpha\beta = 1/\tau\) with \(\tau = 0.15\). The value map is also a multiplication by a scalar, and it is absorbed into the shared weight \(w_k\).

Each row of the attention matrix also solves an optimization problem. Fix a vertex \(i\). Among all probability distributions \((r_j)_j\) on the vertices, the row of weights \((\hat{\mathbf{A}}(\mathbf{h})_{ij})_j\) is the only one that maximizes \[ \sum_j r_j\, h_i h_j - \tau \sum_j r_j \log r_j, \] the expected product \(h_i h_j\) plus \(\tau\) times the entropy of \((r_j)_j\), where \(\log\) is the natural logarithm, with the convention \(0 \log 0 = 0\).

Apply the Gibbs variational principle with temperature to the vector of products \((h_i h_j)_j\), with the uniform distribution on the vertices as the reference. Its objective differs from the displayed one only by \(\tau\) times the logarithm of the number of vertices, because the KL divergence of \((r_j)_j\) from the uniform distribution is that logarithm minus the entropy. The two objectives therefore have the same unique maximizer, and the principle identifies this maximizer as row \(i\) of \(\hat{\mathbf{A}}(\mathbf{h})\). The products \(h_i h_j\), not the attention scores \(\alpha\beta\, h_i h_j = h_i h_j / \tau\), enter both objectives. The factor \(1/\tau\) inside the softmax corresponds to the weight \(\tau\) on the entropy.

The full attention mechanism, with query, key, and value projections and multiple heads, is computed exactly, number by number, at toy dimension in the decoder-block demo, which also computes the positional encoding. The present demo isolates one structural fact, namely that attention weights computed from the features themselves transform covariantly under \(S_n\).