Title: Demystifying Oversmoothing in Attention-Based Graph Neural Networks
Venue: NeurIPS 2023
Accepted: yes
Keywords: graph neural networks

attention mechanisms

oversmoothing

dynamical systems

theory
Abstract: Oversmoothing in Graph Neural Networks (GNNs) refers to the phenomenon where increasing network depth leads to homogeneous node representations. While previous work has established that Graph Convolutional Networks (GCNs) exponentially lose expressive power, it remains controversial whether the graph attention mechanism can mitigate oversmoothing. In this work, we provide a definitive answer to this question through a rigorous mathematical analysis, by viewing attention-based GNNs as nonlinear time-varying dynamical systems and incorporating tools and techniques from the theory of products of inhomogeneous matrices and the joint spectral radius. We establish that, contrary to popular belief, the graph attention mechanism cannot prevent oversmoothing and loses expressive power exponentially. The proposed framework extends the existing results on oversmoothing for symmetric GCNs to a significantly broader class of GNN models, including random walk GCNs, Graph Attention Networks (GATs) and (graph) transformers. In particular, our analysis accounts for asymmetric, state-dependent and time-varying aggregation operators and a wide range of common nonlinear activation functions, such as ReLU, LeakyReLU, GELU and SiLU.

Demystifying Oversmoothing in Attention-Based Graph Neural Networks

Abstract

Oversmoothing in Graph Neural Networks (GNNs) refers to the phenomenon where increasing network depth leads to homogeneous node representations. While previous work has established that Graph Convolutional Networks (GCNs) exponentially lose expressive power, it remains controversial whether the graph attention mechanism can mitigate oversmoothing. In this work, we provide a definitive answer to this question through a rigorous mathematical analysis, by viewing attention-based GNNs as nonlinear time-varying dynamical systems and incorporating tools and techniques from the theory of products of inhomogeneous matrices and the joint spectral radius. We establish that, contrary to popular belief, the graph attention mechanism cannot prevent oversmoothing and loses expressive power exponentially. The proposed framework extends the existing results on oversmoothing for symmetric GCNs to a significantly broader class of GNN models, including random walk GCNs, Graph Attention Networks (GATs) and (graph) transformers. In particular, our analysis accounts for asymmetric, state-dependent and time-varying aggregation operators and a wide range of common nonlinear activation functions, such as ReLU, LeakyReLU, GELU and SiLU.

1 Introduction

Graph neural networks (GNNs) have emerged as a powerful framework for learning with graphstructured data [4, 8, 9, 13, 19, 32, 38] and have shown great promise in diverse domains such as molecular biology [45], physics [1] and recommender systems [40]. Most GNN models follow the message-passing paradigm [12], where the representation of each node is computed by recursively aggregating and transforming the representations of its neighboring nodes.

One notable drawback of repeated message-passing is oversmoothing , which refers to the phenomenon that stacking message-passing GNN layers makes node representations of the same connected component converge to the same vector [5, 18, 19, 24, 26, 31, 41]. As a result, whereas depth has been considered crucial for the success of deep learning in many fields such as computer vision [16], most GNNs used in practice remain relatively shallow and often only have few layers [19, 38, 42]. On the theory side, while previous works have shown that the symmetric Graph Convolution Networks (GCNs) with ReLU and LeakyReLU nonlinearities exponentially lose expressive power, analyzing the oversmoothing phenomenon in other types of GNNs is still an open question [5, 26]. In particular, the question of whether the graph attention mechanism can prevent oversmoothing has not been settled yet. Motivated by the capacity of graph attention to distinguish the importance of different edges in the graph, some works claim that oversmoothing is alleviated in Graph Attention Networks (GATs), heuristically crediting to GATs' ability to learn adaptive node-wise aggregation operators via the attention mechanism [25]. On the other hand, it has been empirically observed that similar to

the case of GCNs, oversmoothing seems inevitable for attention-based GNNs such as GATs [31] or (graph) transformers [34]. The latter can be viewed as attention-based GNNs on complete graphs.

In this paper, we provide a definitive answer to this question - attention-based GNNs also lose expressive power exponentially, albeit potentially at a slower exponential rate compared to GCNs. Given that attention-based GNNs can be viewed as nonlinear time-varying dynamical systems, our analysis is built on the theory of products of inhomogeneous matrices [14, 33] and the concept of joint spectral radius [30], as these methods have been long proved effective in the analysis of time-inhomogeneous markov chains and ergodicity of dynamical systems [2, 14, 33]. While classical results only apply to generic one-dimensional linear time-varying systems, we address four major challenges arising in analyzing attention-based GNNs: (1) the aggregation operators computed by attention are state-dependent, in contrast to conventional fixed graph convolutions; (2) the systems are multi-dimensional, which involves the coupling across feature dimensions; (3) the dynamics are nonlinear due to the nonlinear activation function in each layer; (4) the learnable weights and aggregation operators across different layers result in time-varying dynamical systems.

Below, we highlight our key contributions:

As our main contribution, we establish that oversmoothing happens exponentially as model depth increases for attention-based GNNs, resolving the long-standing debate about whether attention-based GNNs can prevent oversmoothing.

We analyze attention-based GNNs through the lens of nonlinear, time-varying dynamical systems. The strength of our analysis stems from its ability to exploit the inherently common connectivity structure among the typically asymmetric state-dependent aggregation operators at different attentional layers. This enables us to derive rigorous theoretical results on the ergodicity of infinite products of matrices associated with the evolution of node representations across layers. Incorporating results from the theory of products of inhomogeneous matrices and their joint spectral radius, we then establish that oversmoothing happens at an exponential rate for attentionbased GNNs from our ergodicity results.

Our analysis generalizes the existing results on oversmoothing for symmetric GCNs to a significantly broader class of GNN models with asymmetric, state-dependent and time-varying aggregation operators and nonlinear activation functions under general conditions. In particular, our analysis can accommodate a wide range of common nonlinearities such as ReLU, LeakyReLU, and even non-monotone ones like GELU and SiLU. We validate our theoretical results on six real-world datasets with two attention-based GNN architectures and five common nonlinearities.

2 Related Work

Oversmoothing problem in GNNs Oversmoothing is a well-known problem in deep GNNs, and many techniques have been proposed in order to mitigate it practically [6, 15, 20, 21, 29, 43, 47]. On the theory side, analysis of oversmoothing has only been carried out for the graph convolution case [5, 18, 26, 41]. In particular, by viewing graph convolutions as a form of Laplacian filter, prior works have shown that for GCNs, the node representations within each connected component of a graph will converge to the same value exponentially [5, 26]. However, oversmoothing is also empirically observed in attention-based GNNs such as GATs [31] or transformers [34]. Although some people hypothesize based on heuristics that attention can alleviate oversmoothing [25], a rigorous analysis of oversmoothing in attention-based GNNs remains open [5].

Theoretical analysis of attention-based GNNs Existing theoretical results on attention-based GNNs are limited to one-layer graph attention. Recent works in this line include Brody et al. [3] showing that the ranking of attention scores computed by a GAT layer is unconditioned on the query node, and Fountoulakis et al. [11] studying node classification performance of one-layer GATs on a random graph model. More relevantly, Wang et al. [39] made a claim that oversmoothing is asymptotically inevitable in GATs. Aside from excluding nonlinearities in the analysis, there are several flaws in the proof of their main result (Theorem 2). In particular, their analysis assumes the same stationary distribution for all the stochastic matrices output by attention at different layers. This is typically not the case given the state-dependent and time-varying nature of these matrices. In fact, the main challenge in analyzing multi-layer attention lies in the state-dependent and time-varying

nature of these input-output mappings. Our paper offers novel contributions to the research on attention-based GNNs by developing a rich set of tools and techniques for analyzing multi-layer graph attention. This addresses a notable gap in the existing theory, which has primarily focused on one-layer graph attention, and paves the way for future research to study other aspects of multi-layer graph attention.

3 Problem Setup

3.1 Notations

Let R be the set of real numbers and N be the set of natural numbers. We use the shorthands [ n ] := { 1 , . . . , n } and N ≥ 0 := N ∪ { 0 } . We denote the zero-vector of length N by 0 ∈ R N and the all-one vector of length N by 1 ∈ R N . We represent an undirected graph with N nodes by G = ( A,X ) , where A ∈ { 0 , 1 } N × N is the adjacency matrix and X ∈ R N × d are the node feature vectors of dimension d . Let E ( G ) be the set of edges of G . For nodes i, j ∈ [ N ] , A ij = 1 if and only if i and j are connected with an edge in G , i.e., ( i, j ) ∈ E ( G ) . For each i ∈ [ N ] , X i ∈ R d represents the feature vector for node i . We denote the degree matrix of G by D deg = diag( A 1 ) and the set of all neighbors of node i by N i .

Let ∥· ∥ 2 , ∥· ∥ ∞ , ∥· ∥ F be the 2 -norm, ∞ -norm and Frobenius norm, respectively. We use ∥· ∥ max to denote the matrix max norm, i.e., for a matrix M ∈ R m × n , ∥ M ∥ max := max ij | M ij | . We use ≤ ew to denote element-wise inequality. Lastly, for a matrix M , we denote its i th row by M i · and j th column by M · j .

3.2 Graph attention mechanism

We adopt the following definition of graph attention mechanism. Given node representation vectors X i and X j , we first apply a shared learnable linear transformation W ∈ R d × d ′ to each node, and then use an attention function Ψ : R d ′ × R d ′ → R to compute a raw attention coefficient

that indicates the importance of node j 's features to node i . Then the graph structure is injected into the mechanism by performing masked attention, where for each node i , we only compute its attention to its neighbors. To make coefficients easily comparable across different nodes, we normalize e ij among all neighboring nodes j of node i using the softmax function to get the normalized attention coefficients:

The matrix P , where the entry in the i th row and the j th column is P ij , is a row stochastic matrix. We refer to P as an aggregation operator in message-passing.

3.3 Attention-based GNNs

Having defined the graph attention mechanism, we can now write the update rule of a single graph attentional layer as

where X and X ′ are are the input and output node representations, respectively, σ ( · ) is a pointwise nonlinearity function, and the aggregation operator P is a function of XW .

As a result, the output of the t th graph attentional layers can be written as

where X (0) = X is the input node features, W ( t ) ∈ R d ′ × d ′ for t ∈ N and W (0) ∈ R d × d ′ . For the rest of this work, without loss of generality, we assume that d = d ′ .

The above definition is based on single-head graph attention. Multi-head graph attention uses K ∈ N weight matrices W 1 , . . . , W K in each layer and averages their individual single-head outputs [11, 38]. Without loss of generality, we consider single graph attention in our analysis in Section 4, but we note that our results automatically apply to the multi-head graph attention setting since K is finite.

3.4 Measure of oversmoothing

We use the following notion of oversmoothing, inspired by the definition proposed in Rusch et al. [31] 1 :

Definition 1. For an undirected and connected graph G , µ : R N × d → R ≥ 0 is called a node similarity measure if it satisfies the following axioms:

∃ c ∈ R d such that X i = c for all node i if and only if µ ( X ) = 0 , for X ∈ R N × d ;

Then oversmoothing with respect to µ is defined as the layer-wise convergence of the node-similarity measure µ to zero, i.e.,

We say oversmoothing happens at an exponential rate if there exists constants C 1 , C 2 > 0 , such that for any t ∈ N ,

We establish our results on oversmoothing for attention-based GNNs using the following node similarity measure:

Proposition 1. ∥ X -1 γ X ∥ F is a node similarity measure.

The proof of the above proposition is provided in Appendix B. Other common node similarity measures include the Dirichlet energy [5, 31]. 2 Our measure is mathematically equivalent to the measure inf Y = 1 c ⊤ ,c ∈ R d {∥ X -Y ∥ F } defined in Oono and Suzuki [26], but our form is more direct to compute. One way to see the equivalence is to consider the orthogonal projection into the space perpendicular to span { 1 } , denoted by B ∈ R ( N -1) × N . Then our definition of µ satisfies ∥ X -1 γ x ∥ F = ∥ BX ∥ F , where the latter quantity is exactly the measure defined in [26].

3.5 Assumptions

We make the following assumptions (in fact, quite minimal) in deriving our results:

A1 The graph G is connected and non-bipartite.

A2 The attention function Ψ( · , · ) is continuous.

A3 The sequence {∥ ∏ k t =0 | W ( t ) |∥ max } ∞ k =0 is bounded.

A4 The point-wise nonlinear activation function σ ( · ) satisfies 0 ≤ σ ( x ) x ≤ 1 for x = 0 and σ (0) = 0 .

̸

Wenote that all of these assumptions are either standard or quite general. Specifically, A1 is a standard assumption for theoretical analysis on graphs. For graphs with more than one connected components, the same results apply to each connected component. A1 can also be replaced with requiring the graph G to be connected and have self-loops at each node. Non-bipartiteness and self-loops both ensure that long products of stochastic matrices corresponding to aggregation operators in different graph attentional layers will eventually become strictly positive.

The assumptions on the GNN architecture A2 and A4 can be easily verified for commonly used GNN designs. For example, the attention function LeakyReLU( a ⊤ [ W ⊤ X i || W ⊤ X j ]) , a ∈ R 2 d ′ used in the GAT [38], where [ ·||· ] denotes concatenation, is a specific case that satisfies A2 . Other architectures that satisfy A2 include GATv2 [3] and (graph) transformers [37]. As for A4 , one way to

satisfy it is to have σ be 1 -Lipschitz and σ ( x ) ≤ 0 for x < 0 and σ ( x ) ≥ 0 for x > 0 . Then it is easy to verify that most of the commonly used nonlinear activation functions such as ReLU, LeakyReLU, GELU, SiLU, ELU, tanh all satisfy A4 .

Lastly, A3 is to ensure boundedness of the node representations' trajectories X ( t ) for all t ∈ N ≥ 0 . Such regularity assumptions are quite common in the asymptotic analysis of dynamical systems, as is also the case for the prior works analyzing oversmoothing in symmetric GCNs [5, 26].

4 Main Results

In this section, we lay out a road-map for deriving our main results, highlighting the key ideas of the proofs. The complete proofs are provided in the Appendices.

We start by discussing the dynamical system formulation of attention-based GNNs in Section 4.1. By showing the boundedness of the node representations' trajectories, we prove the existence of a common connectivity structure among aggregation operators across different graph attentional layers in Section 4.2. This implies that graph attention cannot fundamentally change the graph connectivity, a crucial property that will eventually lead to oversmoothing. In Section 4.3, we develop a framework for investigating the asymptotic behavior of attention-based GNNs by introducing the notion of ergodicity and its connections to oversmoothing. Then utilizing our result on common connectivity structure among aggregation operators, we establish ergodicity results for the systems associated with attention-based GNNs. In Section 4.4, we introduce the concept of the joint spectral radius for a set of matrices [30] and employ it to deduce exponential convergence of node representations to a common vector from our ergodicity results. Finally, we present our main result on oversmoothing in attention-based GNNs in Section 4.5 and comment on oversmoothing in GCNs in comparison with attention-based GNNs in Section 4.6.

4.1 Attention-based GNNs as nonlinear time-varying dynamical systems

The theory of dynamical systems concerns the evolution of some state of interest over time. By viewing the model depth t as the time variable, the input-output mapping at each graph attentional layer X ( t +1) = σ ( P ( t ) X ( t ) W ( t ) ) describes a nonlinear time-varying dynamical system. The attentionbased aggregation operator P ( t ) is state-dependent as it is a function of X ( t ) W ( t ) . Given the notion of oversmoothing defined in Section 3.4, we are interested in characterizing behavior of X ( t ) as t →∞ .

If the activation function σ ( · ) is the identity map, then repeated application of (1) gives

The above linear form would enable us to leverage the rich literature on the asymptotic behavior of the products of inhomogeneous row-stochastic matrices (see, e.g., [14, 33]) in analyzing the long-term behavior of attention-based GNNs. Such a neat expansion, however, is not possible when dealing with a nonlinear activation function σ ( · ) . To find a remedy, let us start by observing that element-wise application of σ to a vector y ∈ R d can be written as

where diag ( σ ( y ) y ) is a diagonal matrix with σ ( y i ) /y i on the i th diagonal entry. Defining σ (0) / 0 := σ ′ (0) or 1 if the derivative does not exist along with the assumption σ (0) = 0 in A4 , it is easy to check that the above identity still holds for vectors with zero entries.

We can use (5) to write the i th column of X ( t +1) as

where D ( t ) i is a diagonal matrix. It follows from the assumption on the nonlinearities A4 that

We define D to be the set of all possible diagonal matrices D ( t ) i satisfying the above inequality:

Using (6) recursively, we arrive at the following formulation for X ( t +1) · i :

4.2 Common connectivity structure among aggregation operators across different layers

We can use the formulation in (7) to show the boundedness of the node representations' trajectories X ( t ) for all t ∈ N ≥ 0 , which in turn implies the boundedness of the input to graph attention in each layer, X ( t ) W ( t ) .

Lemma 1. Under assumptions A3 -A4 , there exists C > 0 such that ∥ X ( t ) ∥ max ≤ C for all t ∈ N ≥ 0 .

For a continuous Ψ( · , · ) 3 , the following lemma is a direct consequence of Lemma 1, suggesting that the graph attention mechanism cannot fundamentally change the connectivity pattern of the graph.

Lemma 2. Under assumptions A2 -A4 , there exists ϵ > 0 such that for all t ∈ N ≥ 0 and for any ( i, j ) ∈ E ( G ) , we have P ( t ) ij ≥ ϵ .

One might argue that Lemma 2 is an artifact of the continuity of the softmax function. The softmax function is, however, often favored in attention mechanisms because of its trainability in back propagation compared to discontinuous alternatives such as hard thresholding. Besides trainability issues, it is unclear on a conceptual level whether it is reasonable to absolutely drop an edge from the graph as is the case for hard thresholding. Lemma 2 is an important step towards the main convergence result of this work, which states that all the nodes will converge to the same representation vector at an exponential rate. We define the family of row-stochastic matrices satisfying Lemma 2 below.

Definition 2. Let ϵ > 0 . We define P G ,ϵ to be the set of row-stochastic matrices satisfying the following conditions:

ϵ ≤ P ij ≤ 1 , if ( i, j ) ∈ E ( G ) ,

P ij = 0 , if ( i, j ) / ∈ E ( G ) ,

4.3 Ergodicity of infinite products of matrices

Ergodicity , in its most general form, deals with the long-term behavior of dynamical systems. The oversmoothing phenomenon in GNNs defined in the sense of (2) concerns the convergence of all rows of X ( t ) to a common vector. To this end, we define ergodicity in our analysis as the convergence of infinite matrix products to a rank-one matrix with identical rows.

Definition 3 (Ergodicity) . Let B ∈ R ( N -1) × N be the orthogonal projection onto the space orthogonal to span { 1 } . A sequence of matrices { M ( n ) } ∞ n =0 is ergodic if

We will take advantage of the following properties of the projection matrix B already established in Blondel et al. [2]:

B 1 = 0 ;

∥ Bx ∥ 2 = ∥ x ∥ 2 for x ∈ R N if x ⊤ 1 = 0 ;

Given any row-stochastic matrix P ∈ R N × N , there exists a unique matrix ˜ P ∈ R ( N -1) × ( N -1) such that BP = ˜ PB.

We can use the existing results on the ergodicity of infinite products of inhomogeneous stochastic matrices [14, 33] to show that any sequence of matrices in P G ,ϵ is ergodic.

Lemma 3. Fix ϵ > 0 . Consider a sequence of matrices { P ( t ) } ∞ t =0 in P G ,ϵ . That is, P ( t ) ∈ P G ,ϵ for all t ∈ N ≥ 0 . Then { P ( t ) } ∞ t =0 is ergodic.

The main proof strategy for Lemma 3 is to make use of the Hilbert projective metric and the Birkhoff contraction coefficient. These are standard mathematical tools to prove that an infinite product of inhomogeneous stochastic matrices is ergodic. We refer interested readers to the textbooks [14, 33] for a comprehensive study of these subjects.

Despite the nonlinearity of σ ( · ) , the formulation (7) enables us to express the evolution of the feature vector trajectories as a weighted sum of products of matrices of the form DP where D ∈ D and P ∈ P G ,ϵ . We define the set of such matrices as

A key step in proving oversmoothing for attention-based GNNs under our assumptions is to show the ergodicity of the infinite products of matrices in M G ,ϵ . In what follows, we lay out the main ideas of the proof, and refer readers to Appendix F for the details.

Consider a sequence { D ( t ) P ( t ) } ∞ t =0 in M G ,ϵ , that is, D ( t ) P ( t ) ∈ M G ,ϵ for all t ∈ N ≥ 0 . For t 0 ≤ t 1 , define

where I N denotes the N × N identity matrix. The common connectivity structure among P ( t ) 's established in Section 4.2 allows us to show that long products of matrices DP from M G ,ϵ will eventually become a contraction in ∞ -norm. More precisely, we can show that there exists T ∈ N and 0 < c < 1 such that for all t ∈ N ≥ 0 ,

Next, define β k := ∏ k t =0 (1 -cδ t ) and let β := lim k →∞ β k . Note that β is well-defined because the partial product is non-increasing and bounded from below. We can use the above contraction property to show the following key lemma.

Lemma 4. Let β k := ∏ k t =0 (1 -cδ t ) and β := lim k →∞ β k .

If β = 0 , then lim k →∞ Q 0 ,k = 0;

The ergodicity of sequences of matrices in M G ,ϵ immediately follows from Lemma 4, which in turn implies oversmoothing as defined in (2).

Lemma 5. Any sequence { D ( t ) P ( t ) } ∞ t =0 in M G ,ϵ is ergodic.

Remark The proof techniques developed in [5, 26] are restricted to symmetric matrices hence cannot be extended to more general family of GNNs, as they primarily rely on matrix norms for convergence analysis. Analyses solely using matrix norms are often too coarse to get meaningful results when it comes to asymmetric matrices. For instance, while the matrix 2 -norm and matrix eigenvalues are directly related for symmetric matrices, the same does not generally hold for asymmetric matrices. Our analysis, on the other hand, exploits the inherently common connectivity structure among these matrices in deriving the ergodicity results in Lemma 3-5.

4.4 Joint spectral radius

Using the ergodicity results in the previous section, we can establish that oversmoothing happens in attention-based GNNs. To show that oversmoothing happens at an exponential rate, we introduce the notion of joint spectral radius , which is a generalization of the classical notion of spectral radius of a single matrix to a set of matrices [7, 30]. We refer interested readers to the textbook [17] for a comprehensive study of the subject.

Definition 4 (Joint Spectral Radius) . For a collection of matrices A , the joint spectral radius JSR( A ) is defined to be

and it is independent of the norm used.

In plain words, the joint spectral radius measures the maximal asymptotic growth rate that can be obtained by forming long products of matrices taken from the set A .To analyze the convergence rate of products of matrices in M G ,ϵ to a rank-one matrix with identical rows, we treat the two cases of linear and nonlinear activation functions, separately.

For the linear case, where σ ( · ) is the identity map, we investigate the dynamics induced by P ( t ) 's on the subspace orthogonal to span { 1 } and use the third property of the orthogonal projection B established in Section 4.3 to write BP 1 P 2 . . . P k = ˜ P 1 ˜ P 2 ... ˜ P k B , where each ˜ P i is the unique matrix in R ( N -1) × ( N -1) that satisfies BP i = ˜ P i B . Let us define

We can use Lemma 3 to show that the joint spectral radius of ˜ P G ,ϵ is strictly less than 1 .

Lemma 6. Let 0 < ϵ < 1 . Under assumptions A1 -A4 , JSR( ˜ P G ,ϵ ) < 1 .

For the nonlinear case, let 0 < δ < 1 and define

Then again, using the ergodicity result from the previous section, we establish that the joint spectral radius of M G ,ϵ,δ is also less than 1.

Lemma 7. Let 0 < ϵ, δ < 1 . Under assumptions A1 -A4 , JSR( M G ,ϵ,δ ) < 1 .

The above lemma is specifically useful in establishing exponential rate for oversmoothing when dealing with nonlinearities for which Assumption 4 holds in the strict sense, i.e. 0 ≤ σ ( x ) x < 1 (e.g., GELU and SiLU nonlinearities). Exponential convergence, however, can still be established under a weaker requirement, making it applicable to ReLU and Leaky ReLU, as we will see in Theorem 1.

It follows from the definition of the joint spectral radius that if JSR( A ) < 1 , for any JSR( A ) < q < 1 , there exists a C for which

4.5 Main Theorem

Applying (8) to the recursive expansion of X ( t +1) · i in (7) using the 2 -norm, we can prove the exponential convergence of µ ( X ( t ) ) to zero for the similarity measure µ ( · ) defined in (4), which in turn implies the convergence of node representations to a common representation at an exponential rate. This completes the proof of the main result of this paper, which states that oversmoothing defined in (2) is unavoidable for attention-based GNNs, and that an exponential convergence rate can be attained under general conditions.

Theorem 1. Under assumptions A1 -A4 ,

indicating oversmoothing happens asymptotically in attention-based GNNs with general nonlinearities. In addition, if

(linear) σ ( · ) is the identity map, or

(nonlinear) there exists K ∈ N and 0 < δ < 1 for which the following holds: For all m ∈ N ≥ 0 , there is n m ∈ { 0 } ∪ [ K -1] such that for any c ∈ [ d ] , σ ( X ( mK + n m ) r c c ) /X ( mK + n m ) r c c ≤ δ for some r c ∈ [ N ] , ( ⋆ )

then there exists q < 1 and C 1 ( q ) > 0 such that

As a result, node representations X ( t ) exponentially converge to the same value as the model depth t →∞ .

Theorem 1 establishes that oversmoothing is asymptotically inevitable for attention-based GNNs with general nonlinearities. Despite similarity-based importance assigned to different nodes via the aggregation operator P ( t ) , such attention-based mechanisms are yet unable to fundamentally change the connectivity structure of P ( t ) , resulting in node representations converging to a common vector. Our results hence indirectly support the emergence of alternative ideas for changing the graph connectivity structure such as edge-dropping [15, 29] or graph-rewiring [21], in an effort to mitigate oversmoothing.

Remark 1. For nonlinearities such as SiLU or GELU, the condition ( ⋆ ) is automatically satisfied under A3 -A4 . For ReLU and LeakyReLU, this is equivalent to requiring that there exists K ∈ N such that for all m ∈ N ≥ 0 , there exists n m ∈ { 0 } ∪ [ K -1] where for any c ∈ [ d ] , X ( mK + n m ) r c c < 0 for some r c ∈ [ d ] .

Remark 2. We note that our results are not specific to the choice of node similarity measure µ ( X ) = ∥ X -1 γ X ∥ F considered in our analysis. In fact, exponential convergence of any other Lipschitz node similarity measure µ ′ to 0 is a direct corollary of Theorem 1. To see this, observe that for a node similarity measure µ ′ with a Lipschitz constant L , it holds that

In particular, the Dirichlet energy is Lipschitz given that the input X has a compact domain, established in Lemma 1. Hence our theory directly implies the exponential convergence of Dirichlet energy.

4.6 Comparison with the GCN

Computing or approximating the joint spectral radius for a given set of matrices is known to be hard in general [36], yet it is straightforward to lower bound JSR( ˜ P G ,ϵ ) as stated in the next proposition.

Proposition 2. Let λ be the second largest eigenvalue of D -1 / 2 deg AD -1 / 2 deg . Then under assumptions A1 -A4 , it holds that λ ≤ JSR( ˜ P G ,ϵ ) .

In the linear case, the upper bound q on the convergence rate that we get for graph attention in Theorem 1 is lower bounded by JSR( ˜ P G ,ϵ ) . A direct consequence of the above result is that q is at least as large as λ . On the other hand, previous work has already established that in the graph convolution case, the convergence rate of µ ( X ( t ) ) is O ( λ t ) [5, 26]. It is thus natural to expect attention-based GNNs to potentially have better expressive power at finite depth than GCNs, even though they both inevitably suffer from oversmoothing. This is also evident from the numerical experiments that we present in the next section.

5 Numerical Experiments

In this section, we validate our theoretical findings via numerical experiments using the three commonly used homophilic benchmark datasets: Cora, CiteSeer, and PubMed [44] and the three commonly used heterophilic benchmark datasets: Cornell, Texas, and Wisconsin [28]. We note that our theoretical results are developed for generic graphs and thus hold for datasets exhibiting either homophily or heterophily and even those that are not necessarily either of the two. More details about the experiments are provided in Appendix K.

For each dataset, we trained a 128 -layer single-head GAT and a 128 -layer GCN with the random walk graph convolution D -1 deg A , each having 32 hidden dimensions and trained using the standard features and splits. The GCN with the random walk graph convolution is a special type of attentionbased GNNs where the attention function is constant. For each GNN model, we considered various nonlinear activation functions: ReLU, LeakyReLU (with three different negative slope values: 0 . 01 , 0 . 4 and 0 . 8 ) and GELU. Here, we chose GELU as an illustration of the generality of our assumption on nonlinearities, covering even non-monotone activation functions such as GELU. We ran each experiment 10 times. Figure 1 shows the evolution of µ ( X ( t ) ) in log-log scale on the largest connected component of each graph as we forward pass the input X into a trained model. The solid curve is the average over 10 runs and the band indicates one standard deviation around the average.

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

(X)

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

CiteSeer GAT

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

PubMed GAT

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

(X)

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

CiteSeer GCN

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

PubMed GCN

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

(X)

Cornell GAT

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

Texas GAT

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

Wisconsin GAT

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

(X)

Cornell GCN

10 0

10 1

10 2

number of layers

10

4

10

3

10

2

10

1

10 0

10 1

10 2

Texas GCN

10 0

10 1

10 2

10

4

10

3

10

2

10

1

10 0

10 1

10 2

Wisconsin GCN

ReLU

LeakyReLU (0.01)

LeakyReLU (0.4)

LeakyReLU (0.8)

GELU

We observe that, as predicted by our theory, oversmoothing happens at an exponential rate for both GATs and GCNs, regardless of the choice of nonlinear activation functions in the GNN architectures. Notably, GCNs exhibit a significantly faster rate of oversmoothing compared to GATs. This aligns the observation made in Section 4.6, expecting a potentially better expressive power for GATs than GCNs at finite depth. Furthermore, the exponential convergence rate of oversmoothing varies among GNNs with different nonlinear activation functions. From a theory perspective, as different activation functions constitute different subsets of M G ,ϵ and different sets of matrices have different joint spectral radii, it is not surprising that the choice of nonlinear activation function would affect the convergence rate. In particular, among the nonlinearties we considered, ReLU in fact magnifies oversmoothing the second most. As a result, although ReLU is often the default choice for the standard implementation of many GNN architectures [10, 19], one might wish to consider switching to other nonliearities to better mitigate oversmoothing.

6 Conclusion

Oversmoothing is one of the central challenges in developing more powerful GNNs. In this work, we reveal new insights on oversmoothing in attention-based GNNs by rigorously providing a negative answer to the open question of whether graph attention can implicitly prevent oversmoothing. By analyzing the graph attention mechanism within the context of nonlinear time-varying dynamical systems, we establish that attention-based GNNs lose expressive power exponentially as model depth increases.

We upper bound the convergence rate for oversmoothing under very general assumptions on the nonlinear activation functions. One may try to tighten the bounds by refining the analysis separately for each of the commonly used activation functions. Future research should also aim to improve the design of graph attention mechanisms based on our theoretical insights and utilize our analysis techniques to study other aspects of multi-layer graph attention.

Acknowledgments

Xinyi Wu would like to thank Jennifer Tang and William Wang for helpful discussions. The authors are grateful to Zhijian Zhuo and Yifei Wang for identifying an error in an earlier draft of the paper, thank the anonymous reviewers for providing valuable feedback, and acknowledge the MIT SuperCloud and Lincoln Laboratory Supercomputing Center for providing computing resources that have contributed to the research results reported within this paper.

This research has been supported in part by ARO MURI W911NF-19-0217, ONR N00014-20-1-2394, and the MIT-IBM Watson AI Lab.

References

Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, and koray kavukcuoglu. Interaction networks for learning about objects, relations and physics. In NeurIPS , 2016.

Vincent D. Blondel, Julien M. Hendrickx, Alexander Olshevsky, and John N. Tsitsiklis. Convergence in multiagent coordination, consensus, and flocking. Proceedings of the 44th IEEE Conference on Decision and Control , pages 2996-3000, 2005.

Shaked Brody, Uri Alon, and Eran Yahav. How attentive are graph attention networks? In ICLR , 2022.

Joan Bruna, Wojciech Zaremba, Arthur D. Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In ICLR , 2014.

Chen Cai and Yusu Wang. A note on over-smoothing for graph neural networks. In ICML Graph Representation Learning and Beyond (GRL+) Workshop , 2020.

Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In ICML , 2020.

Ingrid Daubechies and Jeffrey C. Lagarias. Sets of matrices all infinite products of which converge. Linear Algebra and its Applications , 161:227-263, 1992.

Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS , 2016.

David Kristjanson Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael GómezBombarelli, Timothy D. Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In NeurIPS , 2015.

Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds , 2019.

Kimon Fountoulakis, Amit Levi, Shenghao Yang, Aseem Baranwal, and Aukosh Jagannath. Graph attention retrospective. ArXiv , abs/2202.13060, 2022.

Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In ICML , 2017.

M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In IJCNN , 2005.

Darald J. Hartfiel. Nonhomogeneous Matrix Products . 2002.

Arman Hasanzadeh, Ehsan Hajiramezanali, Shahin Boluki, Mingyuan Zhou, Nick G. Duffield, Krishna R. Narayanan, and Xiaoning Qian. Bayesian graph neural networks with adaptive connection sampling. In ICML , 2020.

Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR , 2016.

Raphaël M. Jungers. The Joint Spectral Radius: Theory and Applications . 2009.

Nicolas Keriven. Not too little, not too much: a theoretical analysis of graph (over)smoothing. In NeurIPS , 2022.

Thomas Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR , 2017.

Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR , 2019.

Johannes Klicpera, Stefan Weißenberger, and Stephan Günnemann. Diffusion improves graph learning. In Neural Information Processing Systems , 2019.

Peter D. Lax. Functional Analysis . 2002.

David A. Levin, Yuval Peres, and Elizabeth L. Wilmer. Markov Chains and Mixing Times . 2008.

Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In AAAI , 2018.

Yimeng Min, Frederik Wenkel, and Guy Wolf. Scattering gcn: Overcoming oversmoothness in graph convolutional networks. In NeurIPS , 2020.

Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In ICLR , 2020.

Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS , 2019.

Hongbin Pei, Bingzhen Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In ICLR , 2020.

Yu Rong, Wen bing Huang, Tingyang Xu, and Junzhou Huang. Dropedge: Towards deep graph convolutional networks on node classification. In ICLR , 2020.

Gian-Carlo Rota and W. Gilbert Strang. A note on the joint spectral radius. 1960.

T.Konstantin Rusch, Michael M. Bronstein, and Siddhartha Mishra. A survey on oversmoothing in graph neural networks. ArXiv , abs/2303.10993, 2023.

Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks , 20:61-80, 2009.

Eugene Seneta. Non-negative Matrices and Markov Chains . 2008.

Han Shi, Jiahui Gao, Hang Xu, Xiaodan Liang, Zhenguo Li, Lingpeng Kong, Stephen M. S. Lee, and James Tin-Yau Kwok. Revisiting over-smoothing in bert from the perspective of graph. In ICLR , 2022.

Jacques Theys. Joint spectral radius: theory and approximations. Ph. D. dissertation , 2005.

John N. Tsitsiklis and Vincent D. Blondel. The Lyapunov exponent and joint spectral radius of pairs of matrices are hard-when not impossible-to compute and to approximate. Mathematics of Control, Signals and Systems , 10:31-40, 1997.

Ashish Vaswani, Noam M. Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS , 2017.

Petar Veliˇ ckovi´ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In ICLR , 2018.

Guangtao Wang, Rex Ying, Jing Huang, and Jure Leskovec. Improving graph attention networks with large margin-based constraints. ArXiv , abs/1910.11945, 2019.

Shiwen Wu, Wentao Zhang, Fei Sun, and Bin Cui. Graph neural networks in recommender systems: A survey. ACM Computing Surveys , 55:1 - 37, 2020.

Xinyi Wu, Zhengdao Chen, William Wang, and Ali Jadbabaie. A non-asymptotic analysis of oversmoothing in graph neural networks. In ICLR , 2023.

Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems , 32:4-24, 2019.

Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In ICML , 2018.

Zhilin Yang, William W. Cohen, and Ruslan Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. In ICML , 2016.

Jiaxuan You, Bowen Liu, Rex Ying, Vijay S. Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In NeurIPS , 2018.

Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor K. Prasanna. Graphsaint: Graph sampling based inductive learning method. In ICLR , 2020.

Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. In ICLR , 2020.

A Basic Facts about Matrix Norms

In this section, we list some basic facts about matrix norms that will be helpful in comprehending the subsequent proofs.

A.1 Matrix norms induced by vector norms

Suppose a vector norm ∥·∥ α on R n and a vector norm ∥·∥ β on R m are given. Any matrix M ∈ R m × n induces a linear operator from R n to R m with respect to the standard basis, and one defines the corresponding induced norm or operator norm by

̸

If the p -norm for vectors ( 1 ≤ p ≤ ∞ ) is used for both spaces R n and R m , then the corresponding operator norm is

̸

The matrix 1 -norm and ∞ -norm can be computed by

that is, the maximum absolute column sum of the matrix M ;

that is, the maximum absolute row sum of the matrix M .

Remark In the special case of p = 2 , the induced matrix norm ∥ · ∥ 2 is called the spectral norm , and is equal to the largest singular value of the matrix.

For square matrices, we note that the name 'spectral norm" does not imply the quantity is directly related to the spectrum of a matrix, unless the matrix is symmetric.

Example We give the following example of a stochastic matrix P , whose spectral radius is 1 , but its spectral norm is greater than 1 .

A.2 Matrix ( p, q ) -norms

The Frobenius norm of a matrix M ∈ R m × n is defined as

and it belongs to a family of entry-wise matrix norms: for 1 ≤ p, q ≤ ∞ , the matrix ( p, q ) -norm is defined as

The special case p = q = 2 is the Frobenius norm ∥ · ∥ F , and p = q = ∞ yields the max norm ∥ · ∥ max .

A.3 Equivalence of norms

For any two matrix norms ∥ · ∥ α and ∥ · ∥ β , we have that for all matrices M ∈ R m × n ,

for some positive numbers r and s . In particular, the following inequality holds for the 2 -norm ∥ · ∥ 2 and the ∞ -norm ∥ · ∥ ∞ :

B Proof of Proposition 1

It is straightforward to check that ∥ X -1 γ X ∥ F satisfies the two axioms of a node similarity measure:

C Proof of Lemma 1

According to the formulation (7):

we thus obtain that

where C 0 equals the maximal entry in | X (0) | .

The assumption A3 implies that there exists C ′ > 0 such that for all t ∈ N ≥ 0 and i ∈ [ d ] ,

Hence there exists C ′′ > 0 such that for all t ∈ N ≥ 0 and i ∈ [ d ] , we have

proving the existence of C > 0 such that ∥ X ( t ) ∥ max ≤ C for all t ∈ N ≥ 0 .

D Proof of Lemma 2

Lemma 2 is a direct corollary of Lemma 1 and the assumption that Ψ( · , · ) assigns bounded attention scores to bounded inputs.

E Proof of Lemma 3

E.1 Auxiliary results

We make use of the following sufficient condition for the ergodicity of the infinite products of row-stochastic matrices.

Lemma 8 (Corollary 5.1 [14]) . Consider a sequence of row-stochastic matrices { S ( t ) } ∞ t =0 . Let a t and b t be the smallest and largest entries in S ( t ) , respectively. If ∑ ∞ t =0 a t b t = ∞ , then { S ( t ) } ∞ t =0 is ergodic.

In order to make use of the above result, we first show that long products of P ( t ) 's from P G ,ϵ will eventually become strictly positive. For t 0 ≤ t 1 , we denote

Lemma 9. Under the assumption A1 , there exist T ∈ N and c > 0 such that for all t 0 ≥ 0 ,

Proof. Fix any T ∈ N ≥ 0 . Since ∥ P ( t ) ∥ ∞ ≤ 1 for any P ( t ) ∈ P G ,ϵ , it follows that ∥ P ( t 0 + T : t 0 ) ∥ ∞ ≤ 1 and hence P ( t 0 + T : t 0 ) ij ≤ 1 , for all 1 ≤ i, j ≤ N .

To show the lower bound, without loss of generality, we will show that there exist T ∈ N and c > 0 such that

Since each P ( t ) has the same connectivity pattern as the original graph G , it follows from the assumption A1 that there exists T ∈ N such that P ( T :0) is a positive matrix, following a similar argument as the one for Proposition 1.7 in [23]: For each pair of nodes i, j , since we assume that the graph G is connected, there exists r ( i, j ) such that P ( r ( i,j ):0) ij > 0 . on the other hand, since we also assume each node has a self-loop, P ( t :0) ii > 0 for all t ≥ 0 and hence for t ≥ r ( i, j ) ,

For t ≥ t ( i ) := max j ∈G r ( i, j ) , we have P ( t :0) ij > 0 for all node j in G . Finally, if t ≥ T := max i ∈G t ( i ) , then P ( t :0) ij > 0 for all pairs of nodes i, j in G . Notice that P ( T :0) ij is a weighted sum of walks of length T between nodes i and j , and hence P ( T :0) ij > 0 if and only if there exists a walk of length T between nodes i and j . Since for all t ∈ N ≥ 0 , P ( t ) ij ≥ ϵ if ( i, j ) ∈ E ( G ) , we conclude that P ( T :0) ij ≥ ϵ T := c .

E.2 Proof of Lemma 3

Given the sequence { P ( t ) } ∞ t =0 , we use T ∈ N from Lemma 9 and define

Then { P ( t ) } ∞ t =0 is ergodic if and only if { ¯ P ( k ) } ∞ k =0 is ergodic. Notice that by Lemma 9, for all k ∈ N ≥ 0 , there exists c > 0 such that c ≤ ¯ P ( k ) ij ≤ 1 , ∀ 1 ≤ i, j ≤ N . Then Lemma 3 is a direct consequence of Lemma 8.

F Proof of Lemma 5

F.1 Notations and auxiliary results

Consider a sequence { D ( t ) P ( t ) } ∞ t =0 in M G ,ϵ . For t 0 ≤ t 1 , define

where I N denotes the N × N identity matrix. It is also useful to define

We start by proving the following key lemma, which states that long products of matrices in M G ,ϵ eventually become a contraction in ∞ -norm.

Lemma 10. There exist 0 < c < 1 and T ∈ N such that for all t 0 ≤ t 1 ,

Proof. First observe that for every T ≥ 0 ,

where the second inequality is based on the following element-wise inequality:

By Lemma 9, there exist T ∈ N and 0 < c < 1 such that

Since the matrix product P ( t 1 + T ) P ( t 1 + T -1) ...P ( t 1 +1) is row-stochastic, multiplying it with the diagonal matrix D ( t 1 ) from right decreases the row sums by at least c (1 -D ( t 1 ) min ) = cδ t 1 , where D ( t 1 ) min here denotes the smallest diagonal entry of the diagonal matrix D ( t 1 ) . Hence,

F.2 Proof of Lemma 4

Now define β k := ∏ k t =0 (1 -cδ t ) and let β := lim k →∞ β k . Note that β is well-defined because the partial product is non-increasing and bounded from below. Then we present the following result, which is stated as Lemma 4 in the main paper and from which the ergodicity of any sequence in M G ,ϵ is an immediate result.

Proof. We will prove the two cases separately.

and

[Case β = 0 ] We will show that β = 0 implies lim k →∞ ∥ ˆ Q 0 ,k ∥ ∞ = 0 , and as a result, lim k →∞ ∥ Q 0 ,k ∥ ∞ = 0 . For 0 ≤ j ≤ T -1 , let us define

By construction, β = Π T -1 j =0 β j . Hence, if β = 0 then β j 0 = 0 for some 0 ≤ j 0 ≤ T -1 , which yields lim k →∞ ∥ ˆ Q 0 ,k ∥ ∞ = 0 . Consequently, lim k →∞ ∥ Q 0 ,k ∥ ∞ = 0 implies that lim k →∞ Q 0 ,k = 0 .

[Case β > 0 ] First observe that if β > 0 , then ∀ 0 < η < 1 , there exist m ∈ N ≥ 0 such that

Using 1 -x ≤ e -x for all x ∈ R , we deduce

It also follows from (9) that 1 -cδ t > 1 -η , or equivalently δ t < η c for t ≥ m . Choosing η < c 2 thus ensures that δ t < 1 2 for t ≥ m . Putting this together with the fact that, there exists 4 b > 0 such that 1 -x ≥ e -bx for all x ∈ [0 , 1 2 ] , we obtain

Define the product of row-stochastic matrices P ( M : m ) := P ( M ) . . . P ( m ) . It is easy to verify the following element-wise inequality:

which together with (10) leads to

Then by Lemma 10, we get that

Therefore,

where the last inequality is due to the fact that ∥ B ∥ 2 = 1 . By definition, Q 0 ,M = Q m,M Q 0 ,m -1 , and hence

The above inequality (12) holds when taking M → ∞ . Then taking η → 0 implies η ′ → 0 and together with (12), we conclude that

and therefore,

F.3 Proof of Lemma 5

Notice that both cases β = 0 and β > 0 in Lemma 4 imply the ergodicity of { D ( t ) P ( t ) } ∞ t =0 . Hence the statement is a direct corollary of Lemma 4.

G Proof of Lemma 6

In order to show that JSR( ˜ P G ,ϵ ) < 1 , we start by making the following observation.

Lemma 11. A sequence { P ( n ) } ∞ n =0 is ergodic if and only if ∏ t n =0 ˜ P ( n ) converges to the zero matrix.

Proof. For any t ∈ N ≥ 0 , it follows from the third property of the orthogonal projection B (see, Page 6 of the main paper) that

Hence

Next, we utilize the following result, as a means to ensure a joint spectral radius strictly less than 1 for a bounded set of matrices.

Lemma 12 (Proposition 3.2 in [35]) . For any bounded set of matrices M , JSR( M ) < 1 if and only if for any sequence { M ( n ) } ∞ n =0 in M , ∏ t n =0 M ( n ) converges to the zero matrix.

Here, 'bounded" means that there exists an upper bound on the norms of the matrices in the set. Note that P G ,ϵ is bounded because ∥ P ∥ ∞ = 1 , for all P ∈ M G ,ϵ . To show that ˜ P G ,ϵ is also bounded, let ˜ P ∈ ˜ P G ,ϵ , then by definition, we have

since BB T = I N -1 . As a result,

where the first inequality is due to ∥ B ∥ 2 = ∥ B ⊤ ∥ 2 = 1 , and the second ineuality follows from ∥ P ∥ ∞ = 1 .

Combining Lemma 5, Lemma 11 and Lemma 12, we conclude that JSR( ˜ P G ,ϵ ) < 1 .

H Proof of Lemma 7

Note that any sequence { M ( n ) } ∞ n =0 in M G ,ϵ,δ satisfies β = 0 , where β is defined in Lemma 4. This implies that for any sequence { M ( n ) } ∞ n =0 in M G ,ϵ,δ , we have

Since ∥ M ∥ ∞ ≤ δ for all M ∈ M G ,ϵ,δ , again by Lemma 12, we conclude that JSR( M G ,ϵ,δ ) < 1 .

I Proof of Theorem 1

Recall the formulation of X ( t +1)

Then the first part of the theorem directly follows from Lemma 5.

To derive the exponential convergence rate, consider the linear and nonlinear cases separately:

I.1 Bounds for the two cases

[Case: linear] In the linear case where all D = I N , it follows from Lemma 6 that

where C ′ = C max j ∈ [ d ] ∥ BX (0) · j ∥ 2 and ∥ · ∥ 1 denotes the 1 -norm. Specifically, the first inequality follows from the triangle inequality, and the second inequality is due to the property of the joint spectral radius in (8), where JSR( ˜ P G ,ϵ ) < q < 1 .

[Case: nonlinear] Consider T ∈ N defined in Lemma 10, where there exists a 1 ∈ N ≥ 0 and a 2 ∈ { 0 } ∪ [ K -1] such that T = a 1 K + a 2 . Given the condition ( ⋆ ), and Lemma 10, there exists 0 < c < 1 such that for all m ∈ N ≥ 0 ,

where δ ′ = 1 -δ . Note that since for all n m , m ∈ N ≥ 0 , a 2 + n m ≤ 2 K , we get that

it implies that for all n ∈ N ≥ 0 ,

Since for all m ∈ N ≥ 0 ,

Denote q := (1 -cδ ′ ) 1 ( a 1 +2) K . By the equivalence of norms, we get that for all n ∈ N ≥ 0 ,

Then for any j ∈ { 0 } ∪ [( a 1 +2) K -1] ,

where C := √ Nq -( a 1 +2) K +1 . Rewriting the indices, we conclude that

The above bound implies that for any q satisfies q ≤ q < 1 , where again,

I.2 Proof of the exponential convergence

Based on the inequality extablished for both linear and nonlinear case in (13) and (14), we derive the rest of the proof. Since ∥ Bx ∥ 2 = ∥ x ∥ 2 if x ⊤ 1 = 0 for x ∈ R N , we also have that if X ⊤ 1 = 0 for X ∈ R N × d , then

using which we obtain that

where ∥ · ∥ 1 , 1 denotes the matrix (1 , 1) -norm (recall from Section A.2 that for a matrix M ∈ R m × n , we have ∥ M ∥ 1 , 1 = ∑ m i =1 ∑ n j =1 | M ij | ). The assumption A3 implies that there exists C ′′ such that for all t ∈ N ≥ 0 ,

Thus we conclude that there exists C 1 such that for all t ∈ N ≥ 0 ,

Remark 3. Similar to the linear case, one can also use Lemma 7 to establish exponential rate for oversmoothing when dealing with nonlinearities for which Assumption 4 holds in the strict sense, i.e. 0 ≤ σ ( x ) x < 1 (e.g., GELU and SiLU nonlinearities). Here, we presented an alternative proof requiring weaker conditions, making the result directly applicable to nonlinearities such as ReLU and Leaky ReLU.

J Proof of Proposition 2

Since D -1 deg A is similar to D -1 / 2 deg AD -1 / 2 deg , they have the same spectrum. For D -1 deg A , the smallest nonzero entry has value 1 /d max , where d max is the maximum node degree in G . On the other hand, it follows from the definition of P G ,ϵ that

We proceed by proving the following result.

Lemma 13. For any M in M , the spectral radius of M denoted by ρ ( M ) , satisfies

Proof. Gelfand's formula states that ρ ( M ) = lim k →∞ ∥ M k ∥ 1 k , where the quantity is independent of the norm used [22]. Then comparing with the definition of the joint spectral radius, we can immediately conclude the statement.

Let B ( D -1 deg A ) = ˜ PB . By definition, ˜ P ∈ ˜ P G ,ϵ since D -1 deg A ∈ P G ,ϵ as shown before the lemma. Moreover, the spectrum of ˜ P is the spectrum of D -1 deg A after reducing the multiplicity of eigenvalue 1 by one. Under the assumption A1 , the eigenvalue 1 of D -1 deg A has multiplicity 1 , and hence ρ ( ˜ P ) = λ , where λ is the second largest eigenvalue of D -1 deg A . Putting this together with Lemma 13, we conclude that as desired.

K Numerical Experiments

Here we provide more details on the numerical experiments presented in Section 5. All models were implemented with PyTorch [27] and PyTorch Geometric [10].

Datasets

We used torch_geometric.datasets.planetoid provided in PyTorch Geometric for the three homophilic datasets: Cora, CiteSeer, and PubMed with their default training and test splits.

We used torch_geometric.datasets.WebKB provided in PyTorch Geometric for the three heterophilic datasets: Cornell, Texas, and Wisconsin with their default training and test splits.

Dataset summary statistics are presented in Table 1.

Model details

For GAT, we consider the architecture proposed in Veliˇ ckovi´ c et al. [38] with each attentional layer sharing the parameter a in LeakyReLU( a ⊤ [ W ⊤ X i || W ⊤ X j ]) , a ∈ R 2 d ′ to compute the attention scores.

For GCN, we consider the standard random walk graph convolution D -1 deg A . That is, the update rule of each graph convolutional layer can be written as

where X and X ′ are the input and output node representations, respectively, and W is the shared learnable weight matrix in the layer.

Compute We trained all of our models on a Telsa V100 GPU.

Training details In all experiments, we used the Adam optimizer using a learning rate of 0 . 00001 and 0 . 0005 weight decay and trained for 1000 epoch

Results on large-scale dataset In addition to the numerical results presented in Section 5, we also conducted the same experiment on a large-scale dataset Flickr [46] using torch_geometric.datasets.Flickr . Figure 2 visualizes the results.

10 0

10 1

10 2

number of layers

10

2

10

1

10 0

10 1

10 2

10 3

10 4

10 5

(X)

Flickr GAT

10 0

10 1

10 2

number of layers

10

2

10

1

10 0

10 1

10 2

10 3

10 4

10 5

Flickr GCN

ReLU

LeakyReLU (0.01)

LeakyReLU (0.4)

LeakyReLU (0.8)

GELU

Peer reviews:
comments: SUMMARY:
The authors provide theoretical proofs on the oversmoothing problem in GCNs and GATs through Ergodicity analysis of infinite product of matrices. The authors provide a bound in convergence of oversmoothing problem and provides suggestions on choices in activation function to relief oversmoothing problem.

STRENGTHS:
- Approaching oversmoothing problem with Ergodicity is fairly new
- Implications on choices of activation functions are straight forward
- The article is very easy to follow

WEAKNESSES:
- It would be better if the authors could add a experiment with a plot directly showing JSR

QUESTIONS:
- If we break the assumption A4 by using a $\sigma(x)/x >1$, or $\sigma(0)\neq 0$, does GNNs stop having oversmoothing issues or will there be other problems?

LIMITATIONS:
N/A
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-06-09

comments: SUMMARY:
The objective of this paper is to examine the occurrence of over-smoothing phenomena in attention-based Graph Neural Networks (GNN). Over-smoothing refers to a situation where deepening the network results in similar node representations. The researchers demonstrate the presence of over-smoothing in attention-based GNNs using a versatile methodology that can be applied to various GNN types. They establish this proof by treating the network as a nonlinear and time-varying dynamical system. Moreover, the authors support their assertions with empirical evidence.

STRENGTHS:
* The paper exhibits excellent writing quality, as it effectively communicates the author's intentions even when dealing with complex mathematical concepts. The clarity of the paper makes it easily comprehensible for readers.

* The theoretical claims are clear and the proofs are valid.

* The authors propose a generic approach to examine over-smoothing in GNNs with non-restrictive conditions. While their main focus is on attention-based models, the results include a wider range of models.

WEAKNESSES:
* The main shortcoming of the paper is the lack of suggestions for solving the over-smoothing problem. [1] suggests scaling to avoid the phenomena, are they any other ways to alleviate the problem? 

[1] Oono et al. Graph Neural Networks Exponentially Lose Expressive Power for Node Classification, ICLR (2020)

QUESTIONS:
* Is it possible to extend the over-smoothing to any node similarity measure as defined in Definition 1 ?
* Is it possible to directly expand the results from the paper to transformer-based GNNs? What is possible to say about the existence of over-smoothing in that case?

LIMITATIONS:
There is no evidence of ethical problems with this submission.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-06-19

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper provides a definitive answer to the question that whether the graph attention mechanism can mitigate over-smoothing through a rigorous mathematical analysis. The theoretical results establish that the graph attention mechanism cannot prevent over-smoothing and loses expressive power exponentially.\n\nSTRENGTHS:\nS1. Exploring theoretical results on the performance of attention-based GNNs on over-smoothing problems is meaningful and challenging.\n\nS2. The theoretical results obtained in this paper can provide some instructive and valuable information on over-smoothing research.\n\nWEAKNESSES:\nReliability \n1. The reliability of the motivation can be enhanced by adding more literature that discusses the controversy surrounding whether attention-based GNNs alleviate the over-smoothing problem.\n\nSignificance\n1. Only homophily graphs are considered in the paper. In addition, heterophily datasets also should be considered to verify the overall performance of GNN as pointed out by recent publications [1,2].\n2. In addition, experiments on larger datasets will strengthen the significance of the contributions.\n\n[1]Pei, H., Wei, B., Chang, K. C. C., Lei, Y., & Yang, B. (2020). Geom-GCN: Geometric graph convolutional networks. In ICLR.\n\n[2]Lim, D., Hohne, F., Li, X., Huang, S. L., Gupta, V., Bhalerao, O., & Lim, S. N. (2021). Large scale learning on non-homophilous graphs: New benchmarks and strong simple methods. In NeurIPS, 34, 20887-20902.\n\nQUESTIONS:\n1.Missing a number of reliable literature support the claim of attention-based GNNs' ability to alleviate the over-smoothing problem, and most of the works listed in this paper suggest that attention-based GNNs suffer from over-smoothing. This is insufficient to support the author's argument that there is controversial whether the graph attention mechanism can mitigate over-smoothing.\n\n2.What criteria were used to select the negative slope values in the experiment?\n\n3.How sensitive are the hyperparameters (e.g. negative slope values) to the performance?\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper addresses the question of whether graph attention mechanism could prevent oversmoothing in Graph Neural Networks (GNN) and provides a negative result. Existing results on graph attention are available for 1-layer GNN. The current work analyzes the general case of multi-layered graph attention in the context of nonlinear, time-varying dynamical systems. Through a nicely presented rigorous theoretical analysis, the paper shows that (1) oversmoothing happens even for multi-layered attention based GNN (hence attention based mechanisms fundamentally does not change the aggregator operator) (2) oversmoothing happens at exponential rate and the analysis can be also generalized to GCNs. The numerical experiments demonstrate the validation of the claims made in the paper. The presented analysis could be useful in understanding other aspects of graph attention.\n\nSTRENGTHS:\n1. The paper addresses an important question of oversmoothing in multi-layered graph attention neural networks. It is very well written and the ideas across different sections are nicely connected. There is ample amount of intuition behind choice of various techniques used in the paper and the theorems/lemmas are well explained.\n\n2. The ideas/techniques introduced in the paper are well developed, original and should be useful in understanding other aspects of attention based GNNs. I like that the authors provide remarks (lines 257) which address how the paper differs from previous techniques used in theoretical analysis of graph attention. \n\n3. The results of the paper are of significance in understanding of GNNs in terms of developing an understanding of trajectory of matrices in graph attention and hence indirectly supporting methods like edge-dropping etc.\n\nWEAKNESSES:\n1. Some of the prior work on reducing oversmoothing [1] and impact of the current work for understanding them could be included as limitation for the current work. It would be great if authors could talk about if some of the techniques developed here applies to them.\n\n[1]  Chen, Deli, et al. \"Measuring and relieving the over-smoothing problem for graph neural networks from the topological view.\" Proceedings of the AAAI conference on artificial intelligence. Vol. 34. No. 04. 2020.\n\nQUESTIONS:\nQ1. Typo: The sub-indices for $W^{(k)}$ in recursive formulation of *Eq (6)* is flipped and should be - $j_k, j_{k+1}$ instead of $j_{k+1}, j_k$. This would match those in *Eq 5* case $W_{ji}^{(t)}$ for $j_{k+1}=i$. Same goes for the supplement. Please check that the proof that The proof the follows is alright.\n\nQ2. In lines $286.287$, how is the existence of $q<1$ justified? I understand that this is an assumption in the *Theorem 1*, but could the authors shed light on nature of values $q$ takes since it dictates the convergence.\n\nLIMITATIONS:\nNone", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}