Geometric Deep Learning Models
local graph
Chapter 5 — Geometric Deep Learning Models
Section titled “Chapter 5 — Geometric Deep Learning Models”Re-transcribed on 2026-10-09 from the authors’ LaTeX source (arXiv 2104.13478v2). Margin notes are shown as quotations after the paragraph they annotate; figures are the scan crops already in the corpus where one exists.
Having thoroughly studied various instantiations of our Geometric Deep Learning blueprint (for different choices of domain, symmetry group, and notions of locality), we are ready to discuss how enforcing these prescriptions can yield some of the most popular deep learning architectures.
Our exposition, once again, will not be in strict order of generality. We initially cover three architectures for which the implementation follows nearly-directly from our preceding discussion: convolutional neural networks (CNNs), group-equivariant CNNs, and graph neural networks (GNNs).
We will then take a closer look into variants of GNNs for cases where a graph structure is not known upfront (i.e. unordered sets), and through our discussion we will describe the popular Deep Sets and Transformer architectures as instances of GNNs.
Following our discussion on geometric graphs and meshes, we first describe equivariant message passing networks, which introduce explicit geometric symmetries into GNN computations. Then, we show ways in which our theory of geodesics and gauge symmetries can be materialised within deep learning, recovering a family of intrinsic mesh CNNs (including Geodesic CNNs, MoNet and gauge-equivariant mesh CNNs).
Lastly, we look back on the grid domain from a temporal angle. This discussion will lead us to recurrent neural networks (RNNs). We will demonstrate a manner in which RNNs are translation equivariant over temporal grids, but also study their stability to time warping transformations. This property is highly desirable for properly handling long-range dependencies, and enforcing class invariance to such transformations yields exactly the class of gated RNNs (including popular RNN models such as the LSTM or GRU).
While we hope the above canvasses most of the key deep learning architectures in use at the time of writing, we are well aware that novel neural network instances are proposed daily. Accordingly, rather than aiming to cover every possible architecture, we hope that the following sections are illustrative enough, to the point that the reader is able to easily categorise any future Geometric Deep Learning developments using the lens of invariances and symmetries.
5.1 Convolutional Neural Networks
Section titled “5.1 Convolutional Neural Networks”Convolutional Neural Networks are perhaps the earliest and most well known example of deep learning architectures following the blueprint of Geometric Deep Learning outlined in Section 3.5. In Section 4.2 we have fully characterised the class of linear and local translation equivariant operators, given by convolutions with a localised filter . Let us first focus on scalar-valued (‘single-channel’ or ‘grayscale’) discretised images, where the domain is the grid with and .
Recall, is a circulant matrix with parameters .
Any convolution with a compactly supported filter of size can be written as a linear combination of generators , given for example by the unit peaks . Any local linear equivariant map is thus expressible as
Note that we usually imagine and as 2D matrices, but in this equation, both and have their two coordinate dimensions flattened into one—making a vector, and a matrix.
which, in coordinates, corresponds to the familiar 2D convolution (see Figure 14 for an overview):

Figure 14: The process of convolving an image with a filter . The filter parameters can be expressed as a linear combination of generators .
Other choices of the basis are also possible and will yield equivalent operations (for potentially different choices of ). A popular example are directional derivatives: taken together with the local average . In fact, directional derivatives can be considered a grid-specific analogue of diffusion processes on graphs, which we recover if we assume each pixel to be a node connected to its immediate neighbouring pixels in the grid.
When the scalar input channel is replaced by multiple channels (e.g., RGB colours, or more generally an arbitrary number of feature maps), the convolutional filter becomes a convolutional tensor expressing arbitrary linear combinations of input features into output feature maps. In coordinates, this can be expressed as
where and are respectively the number of input and output channels. This basic operation encompasses a broad class of neural network architectures, which, as we will show in the next section, have had a profound impact across many areas of computer vision, signal processing, and beyond. Here, rather than dissecting the myriad of possible architectural variants of CNNs, we prefer to focus on some of the essential innovations that enabled their widespread use.
Efficient multiscale computation. As discussed in the GDL template for general symmetries, extracting translation invariant features out of the convolutional operator requires a non-linear step. Convolutional features are processed through a non-linear activation function , acting element-wise on the input—i.e., , as . Perhaps the most popular example at the time of writing is the Rectified Linear Unit (ReLU): . This non-linearity effectively rectifies the signals, pushing their energy towards lower frequencies, and enabling the computation of high-order interactions across scales by iterating the construction.
(Figure not in the corpus:
relu.pdf.) \ ReLU, often considered a ‘modern’ architectural choice, was already used in the Neocognitron (Fukushima and Miyake, 1982). Rectification is equivalent to the principle of demodulation, which is fundamental in electrical engineering as the basis for many transmission protocols, such as FM radio; and also has a prominent role in models for neuronal activity.
Already in the early works of Fukushima and Miyake (1982) and LeCun et al. (1998), CNNs and similar architectures had a multiscale structure, where after each convolutional layer (30) one performs a grid coarsening , where the grid has coarser resolution than . This enables multiscale filters with effectively increasing receptive field, yet retaining a constant number of parameters per scale. Several signal coarsening strategies (referred to as pooling) may be used, the most common are applying a low-pass anti-aliasing filter (e.g. local average) followed by grid downsampling, or non-linear max-pooling.
In summary, a ‘vanilla’ CNN layer can be expressed as the composition of the basic objects already introduced in our Geometric Deep Learning blueprint:
i.e. an equivariant linear layer , a coarsening operation , and a non-linearity . It is also possible to perform translation invariant global pooling operations within CNNs. Intuitively, this involves each pixel—which, after several convolutions, summarises a patch centered around it—proposing the final representation of the image, with the ultimate choice being guided by a form of aggregation of these proposals. A popular choice here is the average function, as its outputs will retain similar magnitudes irrespective of the image size (Springenberg et al., 2014).
CNNs which only consist of the operations mentioned in this paragraph are often dubbed “all-convolutional”. In contrast, many CNNs flatten the image across the spatial axes and pass them to an MLP classifier, once sufficient equivariant and coarsening layers have been applied. This loses translation invariance.
Prominent examples following this CNN blueprint (some of which we will discuss next) are displayed in Figure 15.

Figure 15: Prominent examples of CNN architectures. Top-to-bottom: LeNet (LeCun et al., 1998), AlexNet (Krizhevsky et al., 2012), ResNet (He et al., 2016) and U-Net (Ronneberger et al., 2015). Drawn using the PlotNeuralNet package (Iqbal, 2018).
Deep and Residual Networks. A CNN architecture, in its simplest form, is therefore specified by hyperparameters , with and indicating whether grid coarsening is performed or not. While all these hyperparameters are important in practice, a particularly important question is to understand the role of depth in CNN architectures, and what are the fundamental tradeoffs involved in choosing such a key hyperparameter, especially in relation to the filter sizes ().
While a rigorous answer to this question is still elusive, mounting empirical evidence collected throughout the recent years suggests a favourable tradeoff towards deeper (large ) yet thinner (small ) models. In this context, a crucial insight by He et al. (2016) was to reparametrise each convolutional layer to model a perturbation of the previous features, rather than a generic non-linear transformation:
Historically, ResNet models are predated by highway networks (Srivastava et al., 2015), which allow for more general gating mechanisms to control the residual information flow.
The resulting residual networks provide several key advantages over the previous formulation. In essence, the residual parametrisation is consistent with the view that the deep network is a discretisation of an underlying continuous dynamical system, modelled as an ordinary differential equation (ODE). Crucially, learning a dynamical system by modeling its velocity turns out to be much easier than learning its position directly. In our learning setup, this translates into an optimisation landscape with more favorable geometry, leading to the ability to train much deeper architectures than was possible before. As will be discussed in future work, learning using deep neural networks defines a non-convex optimisation problem, which can be efficiently solved using gradient-descent methods under certain simplifying regimes. The key advantage of the ResNet parametrisation has been rigorously analysed in simple scenarios (Hardt and Ma, 2016), and remains an active area of theoretical investigation. Finally, Neural ODEs (Chen et al., 2018) are a recent popular architecture that pushes the analogy with ODEs even further, by learning the parameters of the ODE directly and relying on standard numerical integration.
In this case, the ResNet is performing a Forward Euler discretisation of an ODE:
Normalisation. Another important algorithmic innovation that boosted the empirical performance of CNNs significantly is the notion of normalisation. In early models of neural activity, it was hypothesised that neurons perform some form of local ‘gain control’, where the layer coefficients are replaced by . Here, and encode the first and second-order moment information of , respectively. Further, they can be either computed globally or locally.
In the context of Deep Learning, this principle was widely adopted through the batch normalisation layer (Ioffe and Szegedy, 2015), followed by several variants (Ba et al., 2016; Salimans and Kingma, 2016; Ulyanov et al., 2016; Cooijmans et al., 2016; Wu and He, 2018). Despite some attempts to rigorously explain the benefits of normalisation in terms of better conditioned optimisation landscapes (Santurkar et al., 2018), a general theory that can provide guiding principles is still missing at the time of writing.
We note that normalising activations of neural networks has seen attention even before the advent of batch normalisation. See, e.g., Lyu and Simoncelli (2008).
Data augmentation. While CNNs encode the geometric priors associated with translation invariance and scale separation, they do not explicitly account for other known transformations that preserve semantic information, e.g lightning or color changes, or small rotations and dilations. A pragmatic approach to incorporate these priors with minimal architectural changes is to perform data augmentation, where one manually performs said transformations to the input images and adds them into the training set.
Data augmentation has been empirically successful and is widely used—not only to train state-of-the-art vision architectures, but also to prop up several developments in self-supervised and causal representation learning (Chen et al., 2020; Grill et al., 2020; Mitrovic et al., 2020). However, it is provably sub-optimal in terms of sample complexity (Mei et al., 2021); a more efficient strategy considers instead architectures with richer invariance groups—as we discuss next.
5.2 Group-equivariant CNNs
Section titled “5.2 Group-equivariant CNNs”As discussed in Section 4.3, we can generalise the convolution operation from signals on a Euclidean space to signals on any homogeneous space acted upon by a group . By analogy to the Euclidean convolution where a translated filter is matched with the signal, the idea of group convolution is to move the filter around the domain using the group action, e.g. by rotating and translating. By virtue of the transitivity of the group action, we can move the filter to any position on . In this section, we will discuss several concrete examples of the general idea of group convolution, including implementation aspects and architectural choices.
Recall that a homogeneous space is a set equipped with a transitive group action, meaning that for any there exists such that .
Discrete group convolution.
We begin by considering the case where the domain as well as the group are discrete. As our first example, we consider medical volumetric images represented as signals of on 3D grids with discrete translation and rotation symmetries. The domain is the 3D cubical grid and the images (e.g. MRI or CT 3D scans) are modelled as functions , i.e. . Although in practice such images have support on a finite cuboid , we instead prefer to view them as functions on with appropriate zero padding. As our symmetry, we consider the group of distance- and orientation-preserving transformations on . This group consists of translations () and the discrete rotations generated by degree rotations about the three axes (see Figure 16).

Figure 16: A filter, rotated by all elements of the discrete rotation group , generated by -degree rotations about the vertical axis (red arrows), and -degree rotations about a diagonal axis (blue arrows).
As our second example, we consider DNA sequences made up of four letters: C, G, A, and T. The sequences can be represented on the 1D grid as signals , where each letter is one-hot coded in . Naturally, we have a discrete 1D translation symmetry on the grid, but DNA sequences have an additional interesting symmetry. This symmetry arises from the way DNA is physically embodied as a double helix, and the way it is read by the molecular machinery of the cell. Each strand of the double helix begins with what is called the -end and ends with a -end, with the on one strand complemented by a on the other strand. In other words, the two strands have an opposite orientation. Since the DNA molecule is always read off starting at the -end, but we do not know which one, a sequence such as ACCCTGG is equivalent to the reversed sequence with each letter replaced by its complement, CCAGGGT. This is called reverse-complement symmetry of the letter sequence. We thus have the two-element group corresponding to the identity and reverse-complement transformation (and composition ). The full group combines translations and reverse-complement transformations.

\ A schematic of the DNA’s double helix structure, with the two strands coloured in blue and red. Note how the sequences in the helices are complementary and read in reverse (from 5’ to 3’).
DNA is a biopolymer molecule made of four repeating units called nucleotides (Cytosine, Guanine, Adenine, and Thymine), arranged into two strands coiled around each other in a double helix, where each nucleotide occurs opposite of the complementary one (base pairs A/T and C/G).
In our case, the group convolution (18) we defined in Section 4.3 is given as
the inner product between the (single-channel) input signal and a filter transformed by via , and the output is a function on . Note that since is discrete, we have replaced the integral from equation (18) by a sum.
Transform+Convolve approach. We will show that the group convolution can be implemented in two steps: a filter transformation step, and a translational convolution step. The filter transformation step consists of creating rotated (or reverse-complement transformed) copies of a basic filter, while the translational convolution is the same as in standard CNNs and thus efficiently computable on hardware such as GPUs. To see this, note that in both of our examples we can write a general transformation as a transformation (e.g. a rotation or reverse-complement transformation) followed by a translation , i.e. (with juxtaposition denoting the composition of the group elements and ). By properties of the group representation, we have . Thus,
We recognise the last equation as the standard (planar Euclidean) convolution of the signal and the transformed filter . Thus, to implement group convolution for these groups, we take the canonical filter , create transformed copies for each (e.g. each rotation or reverse-complement DNA symmetry ), and then convolve with each of these filters: . For both of our examples, the symmetries act on filters by simply permuting the filter coefficients, as shown in Figure 16 for discrete rotations. Hence, these operations can be implemented efficiently using an indexing operation with pre-computed indices.
While we defined the feature maps output by the group convolution as functions on , the fact that we can split into and means that we can also think of them as a stack of Euclidean feature maps (sometimes called orientation channels), with one feature map per filter transformation / orientation . For instance, in our first example we would associate to each filter rotation (each node in Figure 16) a feature map, which is obtained by convolving (in the traditional translational sense) the rotated filter. These feature maps can thus still be stored as a array, where the number of channels equals the number of independent filters times the number of transformations (e.g. rotations).
As shown in Section 4.3, the group convolution is equivariant: . What this means in terms of orientation channels is that under the action of , each orientation channel is transformed, and the orientation channels themselves are permuted. For instance, if we associate one orientation channel per transformation in Figure 16 and apply a rotation by degrees about the z-axis (corresponding to the red arrows), the feature maps will be permuted as shown by the red arrows. This description makes it clear that a group convolutional neural network bears much similarity to a traditional CNN. Hence, many of the network design patterns discussed in the Section 5.1, such as residual networks, can be used with group convolutions as well.
Spherical CNNs in the Fourier domain. For the continuous symmetry group of the sphere that we saw in Section 4.3, it is possible to implement the convolution in the spectral domain, using the appropriate Fourier transform (we remind the reader that the convolution on is a function on , hence we need to define the Fourier transform on both these domains in order to implement multi-layer spherical CNNs). Spherical harmonics are an orthogonal basis on the 2D sphere, analogous to the classical Fourier basis of complex exponential. On the special orthogonal group, the Fourier basis is known as the Wigner D-functions. In both cases, the Fourier transforms (coefficients) are computed as the inner product with the basis functions, and an analogy of the Convolution Theorem holds: one can compute the convolution in the Fourier domain as the element-wise product of the Fourier transforms. Furthermore, FFT-like algorithms exist for the efficient computation of Fourier transform on and . We refer for further details to Cohen et al. (2018).
5.3 Graph Neural Networks
Section titled “5.3 Graph Neural Networks”Graph Neural Networks (GNNs) are the realisation of our Geometric Deep Learning blueprint on graphs leveraging the properties of the permutation group. GNNs are among the most general class of deep learning architectures currently in existence, and as we will see in this text, most other deep learning architectures can be understood as a special case of the GNN with additional geometric structure.
As per our discussion in Section 4.1, we consider a graph to be specified with an adjacency matrix and node features . We will study GNN architectures that are permutation equivariant functions constructed by applying shared permutation invariant functions over local neighbourhoods. Under various guises, this local function can be referred to as “diffusion”, “propagation”, or “message passing”, and the overall computation of such as a “GNN layer”.
The design and study of GNN layers is one of the most active areas of deep learning at the time of writing, making it a landscape that is challenging to navigate. Fortunately, we find that the vast majority of the literature may be derived from only three “flavours” of GNN layers (Figure 17), which we will present here. These flavours govern the extent to which transforms the neighbourhood features, allowing for varying degrees of complexity when modelling interactions across the graph.
In all three flavours, permutation invariance is ensured by aggregating features from (potentially transformed, by means of some function ) with some permutation-invariant function , and then updating the features of node , by means of some function . Typically, and are learnable, whereas is realised as a nonparametric operation such as sum, mean, or maximum, though it can also be constructed e.g. using recurrent neural networks (Murphy et al., 2018).
Most commonly, and are learnable affine transformations with activation functions; e.g. ; , where are learnable parameters and is an activation function such as the rectified linear unit. The additional input of to represents an optional skip-connection, which is often very useful.
Figure 17: A visualisation of the dataflow for the three flavours of GNN layers, . We use the neighbourhood of node from Figure 10 to illustrate this. Left-to-right: convolutional, where sender node features are multiplied with a constant, ; attentional, where this multiplier is implicitly computed via an attention mechanism of the receiver over the sender: ; and message-passing, where vector-based messages are computed based on both the sender and receiver: . (Figure not in the corpus:
GNN_GDL_TYPES_C.pdf,GNN_GDL_TYPES_A.pdf,GNN_GDL_TYPES_MP.pdf.)
In the convolutional flavour (Kipf and Welling, 2016a; Defferrard et al., 2016; Wu et al., 2019), the features of the neighbourhood nodes are directly aggregated with fixed weights,
Here, specifies the importance of node to node ‘s representation. It is a constant that often directly depends on the entries in representing the structure of the graph. Note that when the aggregation operator is chosen to be the summation, it can be considered as a linear diffusion or position-dependent linear filtering, a generalisation of convolution. In particular, the spectral filters we have seen in Sections 4.4 and 4.6 fall under this category, as they amount to applying fixed local operators (e.g. the Laplacian matrix) to node-wise signals.
It is worthy to note that this flavour does not express every GNN layer that is convolutional (in the sense of commuting with the graph structure), but covers most such approaches proposed in practice. We will provide detailed discussion and extensions in future work.
In the attentional flavour (Veličković et al., 2018; Monti et al., 2017; Zhang et al., 2018), the interactions are implicit
Here, is a learnable self-attention mechanism that computes the importance coefficients implicitly. They are often softmax-normalised across all neighbours. When is the summation, the aggregation is still a linear combination of the neighbourhood node features, but now the weights are feature-dependent.
Finally, the message-passing flavour (Gilmer et al., 2017; Battaglia et al., 2018) amounts to computing arbitrary vectors (“messages”) across edges,
Here, is a learnable message function, computing ‘s vector sent to , and the aggregation can be considered as a form of message passing on the graph.
One important thing to note is a representational containment between these approaches: convolution attention message-passing. Indeed, attentional GNNs can represent convolutional GNNs by an attention mechanism implemented as a look-up table , and both convolutional and attentional GNNs are special cases of message-passing where the messages are only the sender nodes’ features: for convolutional GNNs and for attentional GNNs.
This does not imply that message passing GNNs are always the most useful variant; as they have to compute vector-valued messages across edges, they are typically harder to train and require unwieldy amounts of memory. Further, on a wide range of naturally-occurring graphs, the graph’s edges encode for downstream class similarity (i.e. an edge implies that and are likely to have the same output). For such graphs (often called homophilous), convolutional aggregation across neighbourhoods is often a far better choice, both in terms of regularisation and scalability. Attentional GNNs offer a “middle-ground”: they allow for modelling complex interactions within neighbourhoods while computing only scalar-valued quantities across the edges, making them more scalable than message-passing.
The “three flavour” categorisation presented here is provided with brevity in mind and inevitably neglects a wealth of nuances, insights, generalisations, and historical contexts to GNN models. Importantly, it excludes higher-dimensional GNN based on the Weisfeiler-Lehman hierarchy and spectral GNNs relying on the explicit computation of the graph Fourier transform.
5.4 Deep Sets, Transformers, and Latent Graph Inference
Section titled “5.4 Deep Sets, Transformers, and Latent Graph Inference”We close the discussion on GNNs by remarking on permutation-equivariant neural network architectures for learning representations of unordered sets. While sets have the least structure among the domains we have discussed in this text, their importance has been recently highlighted by highly-popular architectures such as Transformers (Vaswani et al., 2017) and Deep Sets (Zaheer et al., 2017). In the language of Section 4.1, we assume that we are given a matrix of node features, , but without any specified adjacency or ordering information between the nodes. The specific architectures will arise by deciding to what extent to model interactions between the nodes.
Empty edge set.
Unordered sets are provided without any additional structure or geometry whatsoever—hence, it could be argued that the most natural way to process them is to treat each set element entirely independently. This translates to a permutation equivariant function over such inputs, which was already introduced in Section 4.1: a shared transformation applied to every node in isolation. Assuming the same notation as when describing GNNs (Section 5.3), such models can be represented as
where is a learnable transformation. It may be observed that this is a special case of a convolutional GNN with —or, equivalently, . Such an architecture is commonly referred to as Deep Sets, in recognition of the work of Zaheer et al. (2017) that have theoretically proved several universal-approximation properties of such architectures. It should be noted that the need to process unordered sets commonly arises in computer vision and graphics when dealing with point clouds; therein, such models are known as PointNets (Qi et al., 2017).
Complete edge set.
While assuming an empty edge set is a very efficient construct for building functions over unordered sets, often we would expect that elements of the set exhibit some form of relational structure—i.e., that there exists a latent graph between the nodes. Setting discards any such structure, and may yield suboptimal performance. Conversely, we could assume that, in absence of any other prior knowledge, we cannot upfront exclude any possible links between nodes. In this approach we assume the complete graph, ; equivalently, . As we do not assume access to any coefficients of interaction, running convolutional-type GNNs over such a graph would amount to:
where the second input, is identical for all nodes , and as such makes the model equivalently expressive to ignoring that input altogether; i.e. the case mentioned above.
This is a direct consequence of the permutation invariance of .
This motivates the use of a more expressive GNN flavour, the attentional,
which yields the self-attention operator, the core of the Transformer architecture (Vaswani et al., 2017). Assuming some kind of normalisation over the attentional coefficients (e.g. softmax), we can constrain all the scalars to be in the range ; as such, we can think of self-attention as inferring a soft adjacency matrix, , as a byproduct of gradient-based optimisation for some downstream task.
The above perspective means that we can pose Transformers exactly as attentional GNNs over a complete graph (Joshi, 2020). However, this is in apparent conflict with Transformers being initially proposed for modelling sequences—the representations of should be mindful of node ‘s position in the sequence, which complete-graph aggregation would ignore. Transformers address this issue by introducing positional encodings: the node features are augmented to encode node ‘s position in the sequence, typically as samples from a sine wave whose frequency is dependent on .
It is also appropriate to apply the message-passing flavour. While popular for physics simulations and relational reasoning (e.g. Battaglia et al. (2016); Santoro et al. (2017)), they have not been as widely used as Transformers. This is likely due to the memory issues associated with computing vector messages over a complete graph, or the fact that vector-based messages are less interpretable than the “soft adjacency” provided by self-attention.
On graphs, where no natural ordering of nodes exists, multiple alternatives were proposed to such positional encodings. While we defer discussing these alternatives for later, we note that one promising direction involves a realisation that the positional encodings used in Transformers can be directly related to the discrete Fourier transform (DFT), and hence to the eigenvectors of the graph Laplacian of a “circular grid”. Hence, Transformers’ positional encodings are implicitly representing our assumption that input nodes are connected in a grid. For more general graph structures, one may simply use the Laplacian eigenvectors of the (assumed) graph—an observation exploited by Dwivedi and Bresson (2020) within their empirically powerful Graph Transformer model.
Inferred edge set.
Finally, one can try to learn the latent relational structure, leading to some general that is neither nor . The problem of inferring a latent adjacency matrix for a GNN to use (often called latent graph inference) is of high interest for graph representation learning. This is due to the fact that assuming may be representationally inferior, and may be challenging to implement due to memory requirements and large neighbourhoods to aggregate over. Additionally, it is closest to the “true” problem: inferring an adjacency matrix implies detecting useful structure between the rows of , which may then help formulate hypotheses such as causal relations between variables.
Unfortunately, such a framing necessarily induces a step-up in modelling complexity. Specifically, it requires properly balancing a structure learning objective (which is discrete, and hence challenging for gradient-based optimisation) with any downstream task the graph is used for. This makes latent graph inference a highly challenging and intricate problem.
5.5 Equivariant Message Passing Networks
Section titled “5.5 Equivariant Message Passing Networks”In many applications of Graph Neural Networks, node features (or parts thereof) are not just arbitrary vectors but coordinates of geometric entities. This is the case, for example, when dealing with molecular graphs: the nodes representing atoms may contain information about the atom type as well as its 3D spatial coordinates. It is desirable to process the latter part of the features in a manner that would transform in the same way as the molecule is transformed in space, in other words, be equivariant to the Euclidean group of rigid motions (rotations, translations, and reflections) in addition to the standard permutation equivariance discussed before.
To set the stage for our (slightly simplified) analysis, we will make a distinction between node features and node spatial coordinates ; the latter are endowed with Euclidean symmetry structure. In this setting, an equivariant layer explicitly transforms these two inputs separately, yielding modified node features and coordinates .
We can now state our desirable equivariance property, following the Geometric Deep Learning blueprint. If the spatial component of the input is transformed by (represented as , where is an orthogonal matrix modeling rotations and reflections, and is a translation vector), the spatial component of the output transforms in the same way (as ), whereas remains invariant.
Much like the space of permutation equivariant functions we discussed before in the context of general graphs, there exists a vast amount of -equivariant layers that would satisfy the constraints above—but not all of these layers would be geometrically stable, or easy to implement. In fact, the space of practically useful equivariant layers may well be easily described by a simple categorisation, not unlike our “three flavours” of spatial GNN layers. One elegant solution was suggested by Satorras et al. (2021) in the form of equivariant message passing. Their model operates as follows:
where and are two distinct (learnable) functions. It can be shown that such an aggregation is equivariant under Euclidean transformations of the spatial coordinates. This is due to the fact that the only dependence of on is through the distances , and the action of necessarily leaves distances between nodes unchanged. Further, the computations of such a layer can be seen as a particular instance of the “message-passing” GNN flavour, hence they are efficient to implement.
To summarise, in contrast to ordinary GNNs, Satorras et al. (2021) enable the correct treatment of ‘coordinates’ for each point in the graph. They are now treated as a member of the group, which means the network outputs behave correctly under rotations, reflections and translations of the input. The features, , however, are treated in a channel-wise manner and still assumed to be scalars that do not change under these transformations. This limits the type of spatial information that can be captured within such a framework. For example, it may be desirable for some features to be encoded as vectors—e.g. point velocities—which should change direction under such transformations. Satorras et al. (2021) partially alleviate this issue by introducing the concept of velocities in one variant of their architecture. Velocities are a 3D vector property of each point which rotates appropriately. However, this is only a small subspace of the general representations that could be learned with an equivariant network. In general, node features may encode tensors of arbitrary dimensionality that would still transform according to in a well-defined manner.

\ While scalar features (heatmap) do not change under rotations, vector features (arrows) may change direction. The simple equivariant GNN given before does not take this into account.
Hence, while the architecture discussed above already presents an elegant equivariant solution for many practical input representations, in some cases it may be desirable to explore a broader collection of functions that satisfy the equivariance property. Existing methods dealing with such settings can be categorised into two classes: irreducible representations (of which the previously mentioned layer is a simplified instance) and regular representations. We briefly survey them here, leaving detailed discussion to future work.
Irreducible representations. Irreducible representations build on the finding that all elements of the roto-translation group can be brought into an irreducible form: a vector that is rotated by a block diagonal matrix. Crucially, each of those blocks is a Wigner D-matrix (the aforementioned Fourier basis for Spherical CNNs). Approaches under this umbrella map from one set of irreducible representations to another using equivariant kernels. To find the full set of equivariant mappings, one can then directly solve the equivariance constraint over these kernels. The solutions form a linear combination of equivariant basis matrices derived by Clebsch-Gordan matrices and the spherical harmonics.
Early examples of the irreducible representations approach include Tensor Field Networks (Thomas et al., 2018) and 3D Steerable CNNs (Weiler et al., 2018), both convolutional models operating on point clouds. The -Transformer of Fuchs et al. (2020) extends this framework to the graph domain, using an attentional layer rather than convolutional. Further, while our discussion focused on the special case solution of Satorras et al. (2021), we note that the motivation for rotation or translation equivariant predictions over graphs had historically been explored in other fields, including architectures such as Dynamic Graph CNN (Wang et al., 2019b) for point clouds and efficient message passing models for quantum chemistry, such as SchNet (Schütt et al., 2018) and DimeNet (Klicpera et al., 2020).
Regular representations. While the approach of irreducible representations is attractive, it requires directly reasoning about the underlying group representations, which may be tedious, and only applicable to groups that are compact. Regular representation approaches are more general, but come with an additional computational burden – for exact equivariance they require storing copies of latent feature embeddings for all group elements.
This approach was, in fact, pioneered by the group convolutional neural networks we presented in previous sections.
One promising approach in this space aims to observe equivariance to Lie groups—through definitions of exponential and logarithmic maps—with the promise of rapid prototyping across various symmetry groups. While Lie groups are out of scope for this section, we refer the reader to two recent successful instances of this direction: the LieConv of Finzi et al. (2020), and the LieTransformer of Hutchinson et al. (2020).
The approaches covered in this section represent popular ways of processing data on geometric graphs in an way that is explicitly equivariant to the underlying geometry. As discussed in Section 4.6, meshes are a special instance of geometric graphs that can be understood as discretisations of continuous surfaces. We will study mesh-specific equivariant neural networks next.
5.6 Intrinsic Mesh CNNs
Section titled “5.6 Intrinsic Mesh CNNs”Meshes, in particular, triangular ones, are the ‘bread and butter’ of computer graphics and perhaps the most common way of modeling 3D objects. The remarkable success of deep learning in general and CNNs in computer vision in particular has lead to a keen interest in the graphics and geometry processing community around the mid-2010s to construct similar architectures for mesh data.

Examples of geodesic patches. In order for the resulting patch to be a topological disk, its radius must be smaller than the injectivity radius.
Geodesic patches. Most of the architectures for deep learning on meshes implement convolutional filters of the form (23) by discretising or approximating the exponential map and expressing the filter in a coordinate system of the tangent plane. Shooting a geodesic from a point to nearby point defines a local system of geodesic polar coordinates where is the geodesic distance between and (length of the geodesic ) and is the angle between and some local reference direction. This allows to define a geodesic patch , where is the local polar frame.
On a surface discretised as a mesh, a geodesic is a poly-line that traverses the triangular faces. Traditionally, geodesics have been computed using the Fast Marching algorithm Kimmel and Sethian (1998), an efficient numerical approximation of a nonlinear PDE called the eikonal equation encountered in physical models of wave propagation in a medium. This scheme was adapted by Kokkinos et al. (2012) for the computation of local geodesic patches and later reused by Masci et al. (2015) for the construction of Geodesic CNNs, the first intrinsic CNN-like architectures on meshes.

Construction of discrete geodesics on a mesh.
Isotropic filters. Importantly, in the definition of the geodesic patch we have ambiguity in the choice of the reference direction and the patch orientation. This is exactly the ambiguity of the choice of the gauge, and our local system of coordinates is defined up to arbitrary rotation (or a shift in the angular coordinate, ), which can be different at every node. Perhaps the most straightforward solution is to use isotropic filters of the form that perform a direction-independent aggregation of the neighbour features,
Spectral filters discussed in Sections 4.4–4.6 fall under this category: they are based on the Laplacian operator, which is isotropic. Such an approach, however, discards important directional information, and might fail to extract edge-like features.
Fixed gauge. An alternative, to which we have already alluded in Section 4.4, is to fix some gauge. Monti et al. (2017) used the principal curvature directions: while this choice is not intrinsic and may ambiguous at flat points (where curvature vanishes) or uniform curvature (such as on a perfect sphere), the authors showed that it is reasonable for dealing with deformable human body shapes, which are approximately piecewise-rigid. Later works, e.g. Melzi et al. (2019), showed reliable intrinsic construction of gauges on meshes, computed as (intrinsic) gradients of intrinsic functions. While such tangent fields might have singularities (i.e., vanish at some points), the overall procedure is very robust to noise and remeshing.
Angular pooling. Another approach, referred to as angular max pooling, was used by Masci et al. (2015). In this case, the filter is anisotropic, but its matching with the function is performed over all the possible rotations, which are then aggregated:
Conceptually, this can be visualised as correlating geodesic patches with a rotating filter and collecting the strongest responses.
On meshes, the continuous integrals can be discretised using a construction referred to as patch operators (Masci et al., 2015). In a geodesic patch around node , the neighbour nodes , represented in the local polar coordinates as , are weighted by a set of weighting functions (shown in Figure 18 and acting as ‘soft pixels’) and aggregated,
(here are the learnable coefficients of the filter). Multi-channel features are treated channel-wise, with a family of appropriate filters. Masci et al. (2015); Boscaini et al. (2016a) used pre-defined weighting functions , while Monti et al. (2017) further allowed them to be learnable.
Typically multi-hop neighbours are used.

Figure 18: Left-to-right: examples of patch operators used in Geodesic CNN (Masci et al., 2015), Anisotropic CNN (Boscaini et al., 2016b) and MoNet (Monti et al., 2017), with the level sets of the weighting functions shown in red.
Gauge-equivariant filters. Both isotropic filters and angular max pooling lead to features that are invariant to gauge transformations; they transform according to the trivial representation (where is a rotation of the local coordinate frame). This point of view suggests another approach, proposed by Cohen et al. (2019); de Haan et al. (2020) and discussed in Section 4.5, where the features computed by the network are associated with an arbitrary representation of the structure group (e.g. or of rotations or rotations+reflections of the coordinate frame, respectively). Tangent vectors transform according to the standard representation . As another example, the feature vector obtained by matching rotated copies of the same filter transforms by cyclic shifts under rotations of the gauge; this is known as the regular representation of the cyclic group .
As discussed in Section 4.5, when dealing with such geometric features (associated to a non-trivial representation), we must first parallel transport them to the same vector space before applying the filter. On a mesh, this can be implemented via the following message passing mechanism described by de Haan et al. (2020). Let be a -dimensional input feature at mesh node . This feature is expressed relative to an (arbitrary) choice of gauge at , and is assumed to transform according to a representation of under rotations of the gauge. Similarly, the output features of the mesh convolution are dimensional and should transform according to (which can be chosen at will by the network designer).
By analogy to Graph Neural Networks, we can implement the gauge-equivariant convolution (25) on meshes by sending messages from the neighbours of (and from itself) to :
where are learned filter matrices. The structure group element denotes the effect of parallel transport from to , expressed relative to the gauges at and , and can be precomputed for each mesh. Its action is encoded by a transporter matrix . The matrix depends on the angle of the neighbour to the reference direction (e.g. first axis of the frame) at , so this kernel is anisotropic: different neighbours are treated differently.
Note that is the feature dimension and is not necessarily equal to 2, the dimension of the mesh.
As explained in Section 4.5, for to be a well-defined geometric quantity, it should transform as under gauge transformations. This will be the case when for all , and . Since these constraints are linear, the space of matrices and matrix-valued functions satisfying these constraints is a linear subspace, and so we can parameterise them as a linear combination of basis kernels with learnable coefficients: and .
Here we abuse the notation, identifying 2D rotations with angles .
5.7 Recurrent Neural Networks
Section titled “5.7 Recurrent Neural Networks”Our discussion has thus far always assumed the inputs to be solely spatial across a given domain. However, in many common use cases, the inputs can also be considered sequential (e.g. video, text or speech). In this case, we assume that the input consists of arbitrarily many steps, wherein at each step we are provided with an input signal, which we represent as .
Whether the domain is considered static or dynamic concerns time scales: e.g., a road network does change over time (as new roads are built and old ones are demolished), but significantly slower compared to the flow of traffic. Similarly, in social networks, changes in engagement (e.g. Twitter users re-tweeting a tweet) happen at a much higher frequency than changes in the follow graph.
While in general the domain can evolve in time together with the signals on it, it is typically assumed that the domain is kept fixed across all the , i.e. . Here, we will exclusively focus on this case, but note that exceptions are common. Social networks are an example where one often has to account for the domain changing through time, as new links are regularly created as well as erased. The domain in this setting is often referred to as a dynamic graph (Xu et al., 2020a; Rossi et al., 2020).
Often, the individual inputs will exhibit useful symmetries and hence may be nontrivially treated by any of our previously discussed architectures. Some common examples include: videos ( is a fixed grid, and signals are a sequence of frames); fMRI scans ( is a fixed mesh representing the geometry of the brain cortex, where different regions are activated at different times as a response to presented stimuli); and traffic flow networks ( is a fixed graph representing the road network, on which e.g. the average traffic speed is recorded at various nodes).
Let us assume an encoder function providing latent representations at the level of granularity appropriate for the problem and respectful of the symmetries of the input domain. As an example, consider processing video frames: that is, at each timestep, we are given a grid-structured input represented as an matrix , where is the number of pixels (fixed in time) and is the number of input channels (e.g. for RGB frames). Further, we are interested in analysis at the level of entire frames, in which case it is appropriate to implement as a translation invariant CNN, outputting a -dimensional representation of the frame at time-step .
We do not lose generality in our example; equivalent analysis can be done e.g. for node-level outputs on a spatiotemporal graph; the only difference is in the choice of encoder (which will then be a permutation equivariant GNN).
We are now left with the task of appropriately summarising a sequence of vectors across all the steps. A canonical way to dynamically aggregate this information in a way that respects the temporal progression of inputs and also easily allows for online arrival of novel data-points, is using a Recurrent Neural Network (RNN). What we will show here is that RNNs are an interesting geometric architecture to study in their own right, since they implement a rather unusual type of symmetry over the inputs .
Note that the vectors can be seen as points on a temporal grid: hence, processing them with a CNN is also viable in some cases. Transformers are also increasingly popular models for processing generic sequential inputs.
SimpleRNNs.
Figure 19: Illustration of processing video input with RNNs. Each input video frame is processed using a shared function —e.g. a translation invariant CNN—into a flat representation . Then the RNN update function is iterated across these vectors, iteratively updating a summary vector which summarises all the inputs up to and including . The computation is seeded with an initial summary vector , which may be either pre-determined or learnable. (Figure not in the corpus:
normal_rnn.pdf.)
At each step, the recurrent neural network computes an -dimensional summary vector of all the input steps up to and including . This (partial) summary is computed conditional on the current step’s features and the previous step’s summary, through a shared update function, , as follows (see Figure 19 for a summary):
and, as both and are flat vector representations, may be most easily expressed as a single fully-connected neural network layer (often known as SimpleRNN; see Elman (1990); Jordan (1997)):
In spite of their name, SimpleRNNs are remarkably expressive. For example, it was shown by Siegelmann and Sontag (1995) that such models are Turing-complete, meaning that they can likely represent any computation we may ever be able to execute on computers.
where , and are learnable parameters, and is an activation function. While this introduces loops in the network’s computational graph, in practice the network is unrolled for an appropriate number of steps, allowing for backpropagation through time (Robinson and Fallside, 1987; Werbos, 1988; Mozer, 1989) to be applied.
The summary vectors may then be appropriately leveraged for the downstream task—if a prediction is required at every step of the sequence, then a shared predictor may be applied to each individually. For classifying entire sequences, typically the final summary, , is passed to a classifier. Here, is the length of the sequence.
Specially, the initial summary vector is usually either set to the zero-vector, i.e. , or it is made learnable. Analysing the manner in which the initial summary vector is set also allows us to deduce an interesting form of translation equivariance exhibited by RNNs.
Translation equivariance in RNNs. Since we interpret the individual steps as discrete time-steps, the input vectors can be seen as living on a one-dimensional grid of time-steps. While it might be attractive to attempt extending our translation equivariance analysis from CNNs here, it cannot be done in a trivial manner.
Note that this construction is extendable to grids in higher dimensions, allowing us to, e.g., process signals living on images in a scanline fashion. Such a construction powered a popular series of models, such as the PixelRNN from van den Oord et al. (2016b).
To see why, let us assume that we have produced a new sequence by performing a left-shift of our sequence by one step. It might be tempting to attempt showing , as one expects with translation equivariance; however, this will not generally hold. Consider ; directly applying and expanding the update function, we recover the following:
Hence, unless we can guarantee that , we will not recover translation equivariance. Similar analysis can then be done for steps .
Fortunately, with a slight refactoring of how we represent , and for a suitable choice of , it is possible to satisfy the equality above, and hence demonstrate a setting in which RNNs are equivariant to shifts. Our problem was largely one of boundary conditions: the equality above includes , which our left-shift operation destroyed. To abstract this problem away, we will observe how an RNN processes an appropriately left-padded sequence, , defined as follows:
Such a sequence now allows for left-shifting by up to steps without destroying any of the original input elements. Further, note we do not need to handle right-shifting separately; indeed, equivariance to right shifts naturally follows from the RNN equations.
Note that equivalent analyses will arise if we use a different padding vector than .
We can now again analyse the operation of the RNN over a left-shifted verson of , which we denote by , as we did in Equations 43–44:
where the substitution holds as long as , i.e. as long as any padding is applied. Now, we can guarantee equivariance to left-shifting by one step () as long as .
In a very similar vein, we can derive equivariance to left-shifting by steps as long as .
Said differently, must be chosen to be a fixed point of a function . If the update function is conveniently chosen, then not only can we guarantee existence of such fixed points, but we can even directly obtain them by iterating the application of until convergence; e.g., as follows:
where the index refers to the iteration of in our computation, as opposed to the the index denoting the time step of the RNN. If we choose such that is a contraction mapping, such an iteration will indeed converge to a unique fixed point. Accordingly, we can then iterate Equation (45) until , and we can set . Note that this computation is equivalent to left-padding the sequence with “sufficiently many” zero-vectors.
Contractions are functions such that, under some norm on , applying contracts the distances between points: for all , and some , it holds that . Iterating such a function then necessarily converges to a unique fixed point, as a direct consequence of Banach’s Fixed Point Theorem (Banach, 1922).
Depth in RNNs. It is also easy to stack multiple RNNs—simply use the vectors as an input sequence for a second RNN. This kind of construction is occasionally called a “deep RNN”, which is potentially misleading. Effectively, due to the repeated application of the recurrent operation, even a single RNN “layer” has depth equal to the number of input steps.
This often introduces uniquely challenging learning dynamics when optimising RNNs, as each training example induces many gradient updates to the shared parameters of the update network. Here we will focus on perhaps the most prominent such issue—that of vanishing and exploding gradients (Bengio et al., 1994)—which is especially problematic in RNNs, given their depth and parameter sharing. Further, it has single-handedly spurred some of the most influential research on RNNs. For a more detailed overview, we refer the reader to Pascanu et al. (2013), who have studied the training dynamics of RNNs in great detail, and exposed these challenges from a variety of perspectives: analytical, geometrical, and the lens of dynamical systems.
To illustrate vanishing gradients, consider a SimpleRNN with a sigmoidal activation function , whose derivative magnitude is always between and . Multiplying many such values results in gradients that quickly tend to zero, implying that early steps in the input sequence may not be able to have influence in updating the network parameters at all.
(Figure not in the corpus:
sigmoid.pdf.) \ Examples of such an activation include the logistic function, , and the hyperbolic tangent, . They are called sigmoidal due to the distinct S-shape of their plots.
For example, consider the next‐word prediction task (common in e.g. predictive keyboards), and the input text “Petar is Serbian. He was born on … [long paragraph] … Petar currently lives in _____”. Here, predicting the next word as “Serbia” may only be reasonably concluded by considering the very start of the paragraph—but gradients have likely vanished by the time they reach this input step, making learning from such examples very challenging.
Deep feedforward neural networks have also suffered from the vanishing gradient problem, until the invention of the ReLU activation (which has gradients equal to exactly zero or one—thus fixing the vanishing gradient problem). However, in RNNs, using ReLUs may easily lead to exploding gradients, as the output space of the update function is now unbounded, and gradient descent will update the cell once for every input step, quickly building up the scale of the updates. Historically, the vanishing gradient phenomenon was recognised early on as a significant obstacle in the use of recurrent networks. Coping with this problem motivated the development of more sophisticated RNN layers, which we describe next.
5.8 Long Short-Term Memory networks
Section titled “5.8 Long Short-Term Memory networks”Figure 20: The dataflow of the long short-term memory (LSTM), with its components and memory cell () clearly highlighted. Based on the current input , previous summary and previous cell state , the LSTM predicts the updated cell state and summary . (Figure not in the corpus:
lstm.pdf.)
A key invention that significantly reduced the effects of vanishing gradients in RNNs is that of gating mechanisms, which allow the network to selectively overwrite information in a data-driven way. Prominent examples of these gated RNNs include the Long Short-Term Memory (LSTM; Hochreiter and Schmidhuber (1997)) and the Gated Recurrent Unit (GRU; Cho et al. (2014)). Here we will primarily discuss the LSTM—specifically, the variant presented by Graves (2013)—in order to illustrate the operations of such models. Concepts from LSTMs easily carry over to other gated RNNs.
Throughout this section, it will likely be useful to refer to Figure 20, which illustrates all of the LSTM operations that we will discuss in text.
The LSTM augments the recurrent computation by introducing a memory cell, which stores cell state vectors, , that are preserved between computational steps. The LSTM computes summary vectors, , directly based on , and is, in turn, computed using , and . Critically, the cell is not completely overwritten based on and , which would expose the network to the same issues as the SimpleRNN. Instead, a certain quantity of the previous cell state may be retained—and the proportion by which this occurs is explicitly learned from data.
Just like in SimpleRNN, we compute features by using a single fully-connected neural network layer over the current input step and previous summary:
Note that we have set the activation function to here; as LSTMs are designed to ameliorate the vanishing gradient problem, it is now appropriate to use a sigmoidal activation.
But, as mentioned, we do not allow all of this vector to enter the cell—hence why we call it the vector of candidate features, and denote it as . Instead, the LSTM directly learns gating vectors, which are real-valued vectors in the range , and decide how much of the signal should be allowed to enter, exit, and overwrite the memory cell.
Three such gates are computed, all based on and : the input gate , which computes the proportion of the candidate vector allowed to enter the cell; the forget gate , which computes the proportion of the previous cell state to be retained, and the output gate , which computes the proportion of the new cell state to be used for the final summary vector. Typically all of these gates are also derived using a single fully connected layer, albeit with the logistic sigmoid activation , in order to guarantee that the outputs are in the range:
Note that the three gates are themselves vectors, i.e. . This allows them to control how much each of the dimensions is allowed through the gate.
Finally, these gates are appropriately applied to decode the new cell state, , which is then modulated by the output gate to produce the summary vector , as follows:
where is element-wise vector multiplication. Applied together, Equations (46)–(51) completely specify the update rule for the LSTM, which now takes into account the cell vector as well:
Note that, as the values of are derived from and —and therefore directly learnable from data—the LSTM effectively learns how to appropriately forget past experiences. Indeed, the values of directly appear in the backpropagation update for all the LSTM parameters (), allowing the network to explicitly control, in a data-driven way, the degree of vanishing for the gradients across the time steps.
This is still compatible with the RNN update blueprint from Equation (41); simply consider the summary vector to be the concatenation of and ; sometimes denoted by .
Besides tackling the vanishing gradient issue head-on, it turns out that gated RNNs also unlock a very useful form of invariance to time-warping transformations, which remains out of reach of SimpleRNNs.
Time warping invariance of gated RNNs. We will start by illustrating, in a continuous-time setting, what does it mean to warp time, and what is required of a recurrent model in order to achieve invariance to such transformations. Our exposition will largely follow the work of Tallec and Ollivier (2018), that initially described this phenomenon—and indeed, they were among the first to actually study RNNs from the lens of invariances.
We focus on the continuous setting as it will be easier to reason about manipulations of time there.
Let us assume a continuous time-domain signal , on which we would like to apply an RNN. To align the RNN’s discrete-time computation of summary vectors with an analogue in the continuous domain, , we will observe its linear Taylor expansion:
We will use to denote a continuous signal at time , and to denote a discrete signal at time-step .
and, setting , we recover a relationship between and , which is exactly what the RNN update function (Equation 41) computes. Namely, the RNN update function satisfies the following differential equation:
We would like the RNN to be resilient to the way in which the signal is sampled (e.g. by changing the time unit of measurement), in order to account for any imperfections or irregularities therein. Formally, we denote a time warping operation , as any monotonically increasing differentiable mapping between times. The notation is chosen because time warping represents an automorphism of time.

\ Such warping operations can be simple, such as time rescaling; e.g. (displayed above), which, in a discrete setting, would amount to new inputs being received every steps. However, it also admits a wide spectrum of variably-changing sampling rates, e.g. sampling may freely accelerate or decelerate throughout the time domain.
Further, we state that a class of models is invariant to time warping if, for any model of the class and any such , there exists another (possibly the same) model from the class that processes the warped data in the same way as the original model did in the non-warped case.
This is a potentially very useful property. If we have an RNN class capable of modelling short-term dependencies well, and we can also show that this class is invariant to time warping, then we know it is possible to train such a model in a way that will usefully capture long-term dependencies as well (as they would correspond to a time dilation warping of a signal with short-term dependencies). As we will shortly see, it is no coincidence that gated RNN models such as the LSTM were proposed to model long-range dependencies. Achieving time warping invariance is tightly coupled with presence of gating mechanisms, such as the input/forget/output gates of LSTMs.
When time gets warped by , the signal observed by the RNN at time is and, to remain invariant to such warpings, it should predict an equivalently-warped summary function . Using Taylor expansion arguments once more, we derive a form of Equation 53 for the warped time, that the RNN update should satisfy:
However, the above derivative is computed with respect to the warped time , and hence does not take into account the original signal. To make our model take into account the warping transformation explicitly, we need to differentiate the warped summary function with respect to . Applying the chain rule, this yields the following differential equation:
and, for our (continuous-time) RNN to remain invariant to any time warping , it needs to be able to explicitly represent the derivative , which is not assumed known upfront! We need to introduce a learnable function which approximates this derivative. For example, could be a neural network taking into account and and predicting scalar outputs.
Now, remark that, from the point of view of a discrete RNN model under time warping, its input will correspond to , and its summary will correspond to . To obtain the required relationship of to in order to remain invariant to time warping, we will use a one-step Taylor expansion of :
and, once again, setting and substituting Equation 55, then discretising:
Finally, we swap with the aforementioned learnable function, . This gives us the required form for our time warping-invariant RNN:
We may quickly deduce that SimpleRNNs (Equation 42) are not time warping invariant, given that they do not feature the second term in Equation 56. Instead, they fully overwrite with , which corresponds to assuming no time warping at all; , i.e. .
Further, our link between continuous-time RNNs and the discrete RNN based on rested on the accuracy of the Taylor approximation, which holds only if the time-warping derivative is not too large, i.e., . The intuitive explanation of this is: if our time warping operation ever contracts time in a way that makes time increments () large enough that intermediate data changes are not sampled, the model can never hope to process time-warped inputs in the same way as original ones—it simply would not have access to the same information. Conversely, time dilations of any form (which, in discrete terms, correspond to interspersing the input time-series with zeroes) are perfectly allowed within our framework.
Combined with our requirement of monotonically increasing (), we can bound the output space of as , which motivates the use of the logistic sigmoid activation for , e.g.:
exactly matching the LSTM gating equations (e.g. Equation 47). The main difference is that LSTMs compute gating vectors, whereas Equation 56 implies should output a scalar. Vectorised gates (Hochreiter, 1991) allow to fit a different warping derivative in every dimension of , allowing for reasoning over multiple time horizons simultaneously.
It is worth taking a pause here to summarise what we have done. By requiring that our RNN class is invariant to (non-destructive) time warping, we have derived the necessary form that it must have (Equation 56), and showed that it exactly corresponds to the class of gated RNNs. The gates’ primary role under this perspective is to accurately fit the derivative of the warping transformation.
The notion of class invariance is somewhat distinct from the invariances we studied previously. Namely, once we train a gated RNN on a time-warped input with , we typically cannot zero-shot transfer it to a signal warped by a different . Rather, class invariance only guarantees that gated RNNs are powerful enough to fit both of these signals in the same manner, but potentially with vastly different model parameters. That being said, the realisation that effective gating mechanisms are tightly related to fitting the warping derivative can yield useful prescriptions for gated RNN optimisation, as we now briefly demonstrate.
One case where zero-shot transfer is possible is when the second time warping is assumed to be a time rescaling of the first one (). Transferring a gated RNN pre-trained on to a signal warped by merely requires rescaling the gates: . can retain its parameters ().
For example, we can often assume that the range of the dependencies we are interested in tracking within our signal will be in the range time-steps.
By analysing the analytic solutions to Equation 55, it can be shown that the characteristic forgetting time of by our gated RNN is proportional to . Hence, we would like our gating values to lie between in order to effectively remember information within the assumed range.
Further, if we assume that and are roughly zero-centered—which is a common by-product of applying transformations such as layer normalisation (Ba et al., 2016)—we can assume that . Controlling the bias vector of the gating mechanism is hence a very powerful way of controlling the effective gate value.
This insight was already spotted by Gers and Schmidhuber (2000); Jozefowicz et al. (2015), who empirically recommended initialising the forget-gate bias of LSTMs to a constant positive vector, such as .
Combining the two observations, we conclude that an appropriate range of gating values can be obtained by initialising , where is the uniform real distribution. Such a recommendation was dubbed chrono initialisation by Tallec and Ollivier (2018), and has been empirically shown to improve the long-range dependency modelling of gated RNNs.
Sequence-to-sequence learning with RNNs. One prominent historical example of using RNN-backed computation are sequence-to-sequence translation tasks, such as machine translation of natural languages. The pioneering seq2seq work by Sutskever et al. (2014) achieved this by passing the summary vector, as an initial input for a decoder RNN, with outputs of RNN blocks being given as inputs for the next step.
Figure 21: One typical example of a seq2seq architecture with an RNN encoder and RNN decoder . The decoder is seeded with the final summary vector coming out of the encoder, and then proceeds in an autoregressive fashion: at each step, the predicted output from the previous step is fed back as input to . The bottleneck problem is also illustrated with the red lines: the summary vector is pressured to store all relevant information for translating the input sequence, which becomes increasingly challenging as the input length grows. (Figure not in the corpus:
bottle_rnn.pdf.)
This placed substantial representational pressure on the summary vector, . Within the context of deep learning, is sometimes referred to as a bottleneck. Its fixed capacity must be sufficient for representing the content of the entire input sequence, in a manner that is conducive to generating a corresponding sequence, while also supporting input sequences of substantially different lengths (Figure 21).

The bottleneck effect has recently received substantial attention in the graph representation learning community (Alon and Yahav, 2020), as well as neural algorithmic reasoning (Cappart et al., 2021).
In reality, different steps of the output may wish to focus (attend) on different parts of the input, and all such choices are difficult to represent via a bottleneck vector. Following from this observation, the popular recurrent attention model was proposed by Bahdanau et al. (2014). At every step of processing, a query vector is generated by an RNN; this query vector then interacts with the representation of every time-step , primarily by computing a weighted sum over them. This model pioneered neural content-based attention and predates the success of the Transformer model.
Lastly, while attending offers a soft way to dynamically focus on parts of the input content, substantial work also learnt more explicit ways to direct attention to the input. A powerful algorithmically grounded way of doing so is the pointer network of Vinyals et al. (2015), which proposes a simple modification of recurrent attention to allow for pointing over elements of variable-sized inputs. These findings have then been generalised to the set2set architecture (Vinyals et al., 2016), which generalises seq2seq models to unordered sets, supported by pointer network-backed LSTMs.