Analyzing Data-Centric Properties for Contrastive Learning on Graphs
Abstract
Recent analyses of self-supervised learning (SSL) find the following data-centric properties to be critical for learning good representations: invariance to taskirrelevant semantics, separability of classes in some latent space, and recoverability of labels from augmented samples.
However, given their discrete, non-Euclidean nature, graph datasets and graph SSL methods are unlikely to satisfy these properties.
This raises the question: how do graph SSL methods, such as contrastive learning (CL), work well?
To systematically probe this question, we perform a generalization analysis for CL when using generic graph augmentations (GGAs), with a focus on data-centric properties. Our analysis yields formal insights into the limitations of GGAs and the necessity of task-relevant augmentations.
As we empirically show, GGAs do not induce task-relevant invariances on common benchmark datasets, leading to only marginal gains over naive, untrained baselines.
Our theory motivates a synthetic data generation process that enables control over task-relevant information and boasts pre-defined optimal augmentations. This flexible benchmark helps us identify yet unrecognized limitations in advanced augmentation techniques (e.g., automated methods).
Overall, our work rigorously contextualizes, both empirically and theoretically, the effects of data-centric properties on augmentation strategies and learning paradigms for graph SSL.
Introduction
Self-supervised learning (SSL) [1–9] has revolutionized visual representation learning by producing representations that are more robust [10, 11], transferable [12, 13] and semantically consistent [6] than their supervised counterparts.
This impressive empirical success has motivated a surge of efforts that seek to gain insights into SSL’s behavior [14–21] or adapt successful frameworks to different modalities, including graph data [22–26].
Notably, many analyses of SSL have converged upon the following data-centric properties as critical to its success: (i) augmentations should induce invariance to task-irrelevant attributes, as to better reflect the underlying data generation process and improve generalizability; (ii) samples (and corresponding augmentations) from different underlying classes should be separable in some latent space, as to ensure a high-performing classifier is realizable; and (iii) labels of augmented samples should be recoverable from the un-augmented, natural sample [16, 20, 27] so that representations are semantically consistent for downstream tasks.
Due to the continuous representation of natural images and well-designed augmentation strategies, these properties are indeed aligned with standard visual SSL practices [28].
However, despite the growing popularity of SSL for graph representation learning, it appears unlikely that the above properties are supported for non-Euclidean, discrete data.
Indeed, the design of recoverable graph data augmentation [29–31] remains an open research area because is it difficult to determine prima facie what changes to a graph’s topology or node features will preserve semantics.
Moreover, as graphs are often abstract representations of structured data, it is also unclear what invariances are relevant to the downstream task.
The assumption of a separable latent space may also be violated as intermediate points in this latent space may be meaningless in the discrete, structured input space.
In contrast to natural image data, the systematic evaluation of these properties for graph
SSL is difficult as it must accommodate both discrete and structured data.
Our Work.
Better understanding the relationship between graph SSL practices and the aforementioned properties can help explain the behavior of existing frameworks and inform the design of new approaches.
Therefore, in this work, we take the first step by analyzing commonly used generic graph augmentations (GGAs) and designing useful tools that enable probing of these properties, including a theoretical framework and a synthetic data generation process that helps disentangle the effects of unrecoverable augmentations from performance.
Our contributions can be summarized as follows:
Sec. 3: Analysis of Generalization and Separability.
We provide the first generalization error bound for graph CL when using GGAs, demonstrating that GGAs can induce a performance-separability trade-off that is determined by underlying dataset properties (see Figure 1).
Sec. 4.1: Missing Invariance on Benchmark Datasets.
On standard benchmarks, we show that models trained with GGAs have marginal improvements in accuracy and induce limited task-relevant invariance, at best, when compared to untrained encoders.
We thus reveal a fundamental misalignment between the objectives and practical behavior of graph CL (see Figure 2).
Sec. 4.2: Synthetic Data Generation Process.
We propose a synthetic data generation process that allows for control over augmentation recoverability and dataset separability (see Figure 3).
Using this process, we validate our theoretical observations and demonstrate that recently proposed automated and implicit augmentation methods struggle to induce task-relevant invariances (see Figure 4).
Background
In this section, we first briefly discuss existing graph SSL paradigms; we refer the interested reader to App. G for additional discussion.
We then discuss the motivation behind data-centric properties (task-relevant invariance, separability and recoverabilty) central to this work.
Self-Supervised Graph Representation Learning.
Recent advancements in representation learning have been driven by the SSL paradigm, where the goal is to ensure representations have high similarity between positive views of a sample and high dissimilarity between negative views.
Existing SSL frameworks can be broadly categorized based on the mechanism adopted for enforcing this consistency: contrastive learning (CL) frameworks [1, 8, 7, 22, 29, 31, 32], such as GraphCL[22], use the InfoNCE loss; approaches that rely only on positive pairs, such as SimSiam [2] and BGRL [24] use Siamese architectures with stop gradient [2] and asymmetric branches [21] respectively; SpecCL [15] uses a spectral clustering loss (SpecLoss) to enforce consistency; while others attempt to directly reduce redundancy between views [3, 33].
Despite these differences, all methods rely upon data augmentation to generate positive views, which are assumed to share semantics.
Generic graph augmentations (GGAs) [22] are a popular strategy and assume limited changes to a graph’s node features or topology are unlikely to alter its label.
GGAs include random node dropping, edge perturbation, masking node attributes and sampling subgraphs.
Other strategies include using diffusion matrices [23], GGAs with a non-uniform prior, automated methods which rely upon bi-level optimization [29] or adversarial optimization [31], and implicit methods, such as SimGRACE [32], which use weight-space perturbations as augmentations.
Here, we primarily focus on GGAs due to their popularity, simplicity and effectiveness.
Please see App. G for additional discussion about augmentation paradigms.
Theoretical Analsyis of SSL.
Several different perspectives have recently been used to successfully analyze SSL’s behavior, including learning theory [15, 14, 34], causality [18, 17], information theory [27], and dynamical systems [35].
Many of these analyses assume, either implicitly [18, 34] or explicitly [15, 28, 36], the existence of a latent space that is invariant to augmentation functions and supports the properties of recoverability and separability (also see Figure 1).
Invariance to Augmentations: Producing similar representations for positive views, i.e., augmentations, induces invariance to the corresponding transformation function.
Indeed, if augmentations are related by properties that are not relevant to the downstream task, representations will become invariant to this relationship over the course of SSL training and generalization will improve [37, 16].
Conversely, however, if augmentations induce invariance to relevant properties, then representations will fail to represent this information and are likely to lose task performance (e.g., color invariance is harmful when classifying different Labradors) [20, 38].
This latter point is often ignored by the theoretical analyses mentioned above.
We note Tian et al.
’s information theoretic framework [16] is a notable exception to this critique; we discuss the limitations of their results in App.
C.3.
Recoverability and Separability: These properties state that in the latent space which instantiates the data generation process, two augmentations of a sample (e.g., a clear and blurry dog) are close to each other and unrelated points (e.g., dogs and cats) are sufficiently separated from each other.
It is often implicitly assumed that only task-relevant augmentations are allowed [15, 28].
While originally proposed for manifolds [36], both recoverability and separability have been recently converted to graph connectivity properties [15] and verified empirically on modern deep learning methods [28].
Specifically, recoverability and separability can be used to bound generalization error on unseen data and we demonstrate how this can be done for graph CL in Sec.
Notations.
Let X be a natural dataset with r different classes.
Our use of word natural implies the samples in this dataset were collected via a natural sensing process (e.g., molecules from wet-lab experiments or scene graphs from images).
We use A ( . | g ) to denote the distribution of augmentations for the sample g ∈ X .
Here, A ( g | g ) represents the probability of generating a particular augmentation g , and X := ∪ x ∈P X A ( ·| g ) is the set of all samples transformed via our set of augmentation functions.
Let f : X → R d be a feature extractor, where f ( x ) can be used for downstream tasks.
Unless otherwise noted, let g be a natural (graph) sample from X , A ( ·|· ) be some GGA, and g ∼ A ( ·| g ) be an augmented graph generated using a given GGA.
V g and E g correspond, respectively, to the node and edge sets of g .
We note our generalization analysis will specifically focus on the recently proposed contrastive loss by HaoChen et al.
[15], called SpecLoss ( L ( f ) ), which we define as follows: let g ∼ A ( ·| g ) , g + ∼ A ( ·| g ) , given g ∈ X , and g − ∼ A ( ·| g ′ ) , given g ′ ∼ P X ∧ g ′ ̸
= g .
Then, for the positive/negative pairs ( g , g + ) / ( g , g − ) , SpecLoss is:
L ( f ) = − 2 · E g , g + (cid:2) f
( g )
⊤ f ( g + ) (cid:3) + E g , g − (cid:104)(cid:0) f
( g )
⊤ f ( g − ) (cid:1) 2 (cid:105) .
In a contemporary work, Saunshi et al.
[14, 37] developed a generalization analysis for general contrastive loss functionals, including
SpecLoss.
Our analysis has a similar algorithmic flow as Saunshi et al.’s
and hence the takeaways from our work can be easily extended for other contrastive methods as well.
We provide additional discussion of this extension in App.
C.1.
Generalization Bounds for CL with GGA
As discussed above, recent analyses have found that SSL generalization error can be bounded under the assumptions of invariance to relevant augmentations, recoverability, and separability.
In this section, we demonstrate how GGAs influence these properties by deriving a generalization bound tailored for graph data.
Notably, this bound allows us to demonstrate conditions where using GGAs results in low separability and recoverability, motivating the need for augmentations that induce task-relevant invariances that go beyond generic perturbative graph transformations.
Key Insight: Our main idea for the following analysis is that GGAs can be instantiated in a general manner as a composition of graph edit operations .
This allows us to derive a unifying assumption related to recoverability and separability in terms of the graph edit distance (GED) between samples.
Moreover, because GED amongst samples is a property intrinsic to the dataset, we can now discuss how the tightness of a SSL generalization error bound (SpecLoss’s, specifically) will change as a function of GED between samples of underlying classes and augmentation strength.
3.1 Preliminaries and Formulation
We begin by defining GED and explaining how GGAs can be represented using graph edit operators.
Definition 3.1 (Graph Edit Distance) .
Let the elementary graph operators comprise the set of graph edits: these include node insertion , node deletion , edge deletion , edge addition and an additional categorical feature replacement operator.
Then, GED ( g 1 , g 2 ) =
min ( e 1 ,...,e k ) ∈P ( g 1 ,g 2 ) (cid:80) ki
=1 c ( e i ) , where P ( g 1 , g 2 ) is the set of paths (series of edit operations) that transforms graph g 1 to be isomorphic to graph g 2 .
Here, e i is i -th edit operation in the path and c ( e i ) is the cost for performing the edit.
As shown in Table 1, frequently used GGA transforms can be easily decomposed using standard graph edit operators described in Def. 3.1.
For example, assuming each operator has a unit cost, the edge perturbation augmentation can be seen as applying the minimum cost path consisting of edge deletion and edge addition operations to obtain g from g .
Further, augmentation strength and the set of possible augmentations for a given natural sample can also be expressed in terms of GED:
Lemma 3.2.
Allowable augmentations can be expressed using GED.
Let γ represent augmentation strength or the fraction of the graph that GGAs may modify.
Then, δ ∈ {⌊ γ |V g |⌋ , ⌊ γ |E g |⌋} represents the number of discrete, allowable modifications for the specified GGA, so GED ( g , g ) ≤ δ.
Correspondingly, we have g ∈ A ( g ) ⇔ GED ( g , g ) ≤ δ . [Table] [Table]
[Table] For example, consider a graph g ∼ A ( ·| g ) , generated via node dropping.
Then, g contains 1 − δ nodes and the minimum cost path to transform g to g contains only δ “node deletion” operations.
Further, all augmentations generated from g will have 1 − δ nodes and thus have GED ( g , g ) ≤ δ .
In Appendix D, we prove the above statement and demonstrate how to approximate |A
( g ) | (e.g., the set of allowable augmentations for a given natural sample) using a combinatorial, counting procedure that is dependent on δ .
Because GGAs are applied randomly, note that the probability of generating a particular augmentation is A ( g | g ) ≈ 1 |A ( g ) | .
Given these definitions, we now derive a unifying assumption in terms of GED between samples.
We begin by formally introducing the separability and recoverability assumptions, focusing on the recently proposed, unified version [15]:
Assumption 3.3 (Separability plus Recoverability Assumption, (Assm. 3.5 in [15])) .
Let g ∈ X and y ( g ) be its label, and g ∼ A ( ·| g ) .
Assume that there exists a classifier h , such that h ( g ) =
y ( g ) with probability at least 1 − α .
We refer to α as the error of h .
Figure 1 provides a visualization explaining this assumption.
Intuitively, Assm. 3.3 states that there must exist a classifier h that is able to associate a sample’s label with its augmentations, hence enabling recoverability, i.e., representations of augmentations are close to each other.
Meanwhile, by ensuring augmentations of samples from a class with label “A” are classified as “A” and from a class with label “B” are classified as “B”, the assumption simultaneously enables separability, i.e., representations of samples from different classes should be dissimilar.
As we will see, the generalization bound will be a function of α , the probability that a classifier satisfying Assm.
3.3 associates augmentations of a class’s samples with another class.
As α grows larger, the generalization error bound becomes less tight.
Therefore, it is important to understand how the choice of augmentation and augmentation strength ( γ ) can influence the error of h .
We show one can also understand α as a trade-off between inter-class GED of samples and augmentation strength.
Intuitively, h will incur error on augmented samples that can be generated from a set of natural samples that belong to different underlying classes, as it is unclear how these samples should be embedded in a latent space.
We now formally define such samples.
First, using Lemma 3.2, we can determine if two augmentations could have been generated from the same sample.
Corollary 3.4.
(Co-occuring augmentations.)
Let g ∈ X
and g , g ′ ∈ X .
Then, g ∼ A ( g ) ∧ g ′ ∼
A ( g ) ⇔ GED ( g , g ′ ) ≤ 2 δ , where δ = min {⌊ γ |V g |⌋ , ⌊ γ |E g |⌋ ⌊ γ |V g |⌋ , ⌊ γ |E g |⌋} .
Given the above result, we now define inconsistent samples as follows.
Definition 3.5 (Inconsistent Samples) .
Let g ∈ X , and y :
X → r be a labeling function.
Further, let
X in = { g |
g ∈ X
∧ GED ( g , g ) ≤ δ } be the set of natural samples that may have generated g and
Y ∗ in = { y ( g ) | g ∈ X in } be the set of unique labels.
If g is an inconsistent sample, | Y ∗ in | > 1 .
Essentially, if two augmentations co-occur (see Corr. 3.4) from two or more different natural samples, such that the samples do not share the same underlying label, we refer to such samples as inconsistent (also see Figure 1).
Now, we assume the behavior of h on inconsistent samples is fixed
such that h ( g ) =
y , for some fixed y ∈ Y ∗ in .
This allows us to use h to induce a r -way partition over X , such that each sample, g , belongs to a partition, S h ( g ) .
Further, because h incurs error on inconsistent samples, α can be lower bounded by the ratio of inconsistent to total samples.
To this end, we use GED to identify inconsistent samples by identifying disagreement amongst partitions as follows.
Lemma 3.6 (Using GED to identify inconsistent samples) .
Let g , g ′ ∈ X and GED ( g , g ′ )
≤ 2 δ such that g ∈ S i ∧
g ′ ∈
S j and i ̸
= j , where partitions are induced by h .
Then, at least one ˜ g ∈ { g , g ′ } must be an inconsistent sample.
Note that the above lemma does not rely on ground-truth label information to identify inconsistent samples, but only GED from natural samples.
Given that the error on inconsistent samples is irreducible, as it is unclear which y ∈ Y in is correct, we can lower bound the error of h as follows:
Corollary 3.7 (Error bound due to Inconsistent Samples) .
The error of h can be lower-bounded as
[Equation]
Here, the number of inconsistent samples can be approximated via (cid:80) ri (cid:80)
g ∈ S
i , g ′ / ∈ S i 1 ( GED ( g , g ′ ) ≤ 2 δ ) and |X| can be estimated using a combinatorial counting procedure.
Thus, the above corollary reflects the fact that error on inconsistent samples cannot be reduced due to label un-identifiability.
As mentioned before, the generalization bound by HaoChen et al.
[15] for SpecLoss is a function of α .
Deriving a lower bound on α will allow us to comment exactly when error is likely to become vacuous.
To this end, we need a final definition of partition dissimilarity that induces a notion of clustering of similar datapoints in our analysis.
Definition 3.8 (Partition Dissimilarity) .
Let S 1 , . . .
, S r be an r -way partition of X .
Then, we define the partition dissimilarity for a given partition as
[Equation]
Intuitively, we use the partitions induced by h as a proxy for class labels and co-occurrence as a notion of similarity (see Lemma 3.2).
Then, the quality of the partition is determined by the ratio of the samples that belong to a given partition, but are also similar to samples from other partitions, to the total number of samples that are close to the partition.
Note that partition dissimilarity is an often studied term in clustering problem and a general version of conductance, the property used for spectral clustering on a similarity graph which forms the basis of SpecLoss [15].
3.2 Generalization Error Bound and Discussion
We are now ready to state our main result that re-derives the generalization error of SpecLoss in terms of GGAs, using the definitions of co-occurring pairs (Def. 3.4) and dissimilar partitions (Def. 3.8).
Notably, we will decompose bound in terms of the number of co-occurring augmentation-pairs within the same partition and the number of pairs that cross partitions, which are defined respectively as,
[Equation]
Theorem 3.9 (Generalization Bound for SpecLoss with GGA) .
Assume the representation dimension k ≥ 2 r and Assm.
3.7 holds for α ≥ 0 .
Let F be a hypothesis class containing a minimizer f ∗ pop of SpecLoss, L ( f ) , which produces a ⌊ k/ 2 ⌋ -way partition of X denoted by { S ∗ } .
Let its most dissimilar partition have dissimilarity denoted by ρ ⌊ k/ 2 ⌋ =
min
i ϕ ( S i ∈
{ S ∗ } ) .
Then, f ∗ pop has a generalization error bounded as:
[Equation]
Discussion.
By deriving expressions for α and ϕ as well as equivalently representing the original bound in terms of the more intuitive expressions, µ and λ , we can gain insights into several empirical and intuitive observations in graph CL.
In Sec. 4.2, we study these points further via a synthetic dataset that is designed to provide a controlled setting for fine-grained evaluation of data-centric properties.
Invariance and Relevance of Augmentations.
GGAs assume that limited changes to a graph’s structure will not alter its semantics and aggressively increasing augmentation strength will eventually harm generalization.
However, through our analysis, we see that the generalization error bound is non-decreasing with respect to δ when λ 2 µ ≤ µ , i.e., the number of cross partition pairs dominates the expression, as this ratio depends on δ .
Indeed, for some δ ′ =
δ + ϵ , where ϵ > 0 , µ δ ′ =
(cid:80)
g ∈ S
i , g ′ / ∈ S i 1 ( GED ( g , g ′ ) ≤ 2 δ ) + (cid:80) g ∈ S i , g ′ / ∈ S i 1 (2 δ ≤ GED ( g , g ′ ) ≤ 2 δ + ϵ ) = µ δ + (cid:80) g ∈ S
i , g ′ / ∈ S i 1 (2 δ ≤ GED ( g , g ′ )) ≤ 2 δ + ϵ .
Thus, the number of cross partitions is always non-decreasing with respect to δ.
Thus, we see that when augmentations are agnostic of the task, their corresponding invariances yield poor representations with vacuous generalization.
Separability.
Our analysis also demonstrates that the success of a particular augmentation strength is dependent on the GED between samples belonging to different classes.
Given that inter-class GED is an intrinsic dataset property that proxies dataset separability, this implies that there are combinations of datasets and augmentation strengths for which GGAs will necessarily incur vacuous bounds, even for low augmentation strengths.
In such settings, augmentations that improve recoverability and induce task-relevant invariances are necessary to improve downstream task performance.
While many works have conjectured that task-relevant graph augmentations will improve performance, ours is the first to demonstrate why they are needed.
Indeed, in Sec. 4.1, we find that GGAs are unable to induce such invariances on benchmark datasets.
Recoverability.
As shown in Thm.
3.9, better recoverability will improve the tightness of the generalization bound.
However, we see that from Coll.
3.7, that recoverability will only decrease as δ increases and as discussed above, there exist datasets where GGAs are not amenable.
This further motivates the need for task-relevant augmentations so that the effects of poor augmentations are disentangled from method performance.
Experimental Verification
In this section, we conduct experiments using both standard benchmarks (Sec. 4.1) and our proposed synthetic dataset generation process (Sec. 4.2) to empirically validate our theoretical conclusions.
4.1 A Closer Look at the Effectiveness of Invariance to GGA
In Sec. 3, we demonstrated GGAs can harm generalization by influencing recoverability and separability.
Though computing these properties directly is intractable on benchmark datasets, our analysis for graph datasets and prior works on vision [17, 18, 20] show that if augmentations induce invariances that are task-relevant , downstream error should reduce.
This corresponds to meaningfully related samples having similar representations (recoverable) and unrelated samples having dissimilar representations (separable).
However, by using augmentations that perturb topology or features constrained to a small fraction of the original graph, existing graph SSL methods assume such perturbations are relevant to the downstream task.
If this is the case, our analysis suggests we should see improvement in performance with increased invariance; else, we will witness no tangible correlation.
Experimental Setup. We evaluate seven graph SSL methods on seven, popular benchmark datasets.
Specifically, we use the following representative algorithms: (i) GraphCL
[22], a popular and effective graph CL method; (ii) GAE , Graph Autoencoder [40] that uses a reconstruction cost to learn representations; (iii) Augmentation-Augmented Autoencoder [41], which we adapt to graphs to create the Augmentation Augmented Graph Autoencoder ( AAGAE ) that minimizes the reconstruction error between the reconstruction for an augmented sample and the original; (iv) SpecCL , which uses the SpecLoss [15] for contrastive training; (v) SimSiam
[2], a positive-sample-only framework that uses stop gradient; (vi) BYOL [21], which avoids negatives samples by using asymmetric branches alongside a stop gradient operation; and (vii) Untrained representations , which have been observed to be surprisingly competitive baselines for graph-based learning [42, 43, 31, 38].
To the best of our knowledge, ours is the first work to evaluate AAGAE and SpecCL for graph SSL.
We use the same augmentations and encoder architecture as GraphCL.
We add a straight-through estimator [44] to GAE/AAGAE’s decoder for better training.
See Appendix F for further details. [Figure]
GGAs fail to induce task-relevant invariance on standard benchmarks.
To measure whether augmentations have induced invariance we measure recoverability using the representational similarity measures introduced by Wang and Isola [19].
Called Alignment and Uniformity, the two measures are a generalized version of the InfoNCE loss and also encompass other contrastive losses, such as SpecLoss.
Formally, alignment is defined as: L align ( f ; A ) ≜
[Equation]
To determine if the invariance is taskrelevant, we determine if improved alignment is indicative of improved performance with respect to an untrained baseline model.
Results.
Figure 2 shows the difference in invariance and k NN with respect to an untrained model’s accuracy, averaged over 10 seeds.
As can be seen, there is not noticeable correlation between invariance and accuracy, especially with respect to the untrained baseline.
Notably, on the Reddit dataset, all methods have improved invariance, but do not have significantly better kNN accuracy.
Overall, this experiment demonstrates that learning invariance to GGAs is both difficult and often unrelated to task performance, clearly indicating the GGAs struggle to induce task-relevant invariances and do not support recoverable, separable latent spaces needed for good generalization.
Moreover, given that GGAs have unknown recoverability on standard datasets, and that trained models were not able to sufficiently outperform untrained baselines, there is need for new datasets where it is possible to go beyond GGA and where we can better understand the merits of different graph SSL paradigms.
4.2 Evaluating Graph SSL Methods in a Controlled Setting
Our analysis indicates the role played by recoverability and separability under task-relevant invariances dramatically influences generalization performance.
However, given our results that GGAs do [Figure] not enable these properties and the fact that task-relevance is difficult to define on existing benchmark datasets, empirical verification of our claims requires a dataset that directly enables control over the data generation process.
We thus introduce a synthetic dataset that allows us to illustrate how invariance and class separability must be jointly considered when designing augmentations.
4.2.1 Synthetic Data Generation Process
Given that standard benchmark datasets and augmentation practices are uninformative when evaluating the recoverability and invariance of augmentations, we propose a synthetic data generation process that allows us to understand how the data-dependent assumptions of SSL hold for graph datasets.
This process not only enables oracle augmentations where recoverability is known, but also allows us some control over dataset separability.
Our synthetic dataset generation process is designed in accordance to a latent variable model which assumes that the underlying data generation latent representation space can be partitioned into style and content .
Here, style represents information that is irrelevant to the downstream task and can be perturbed (i.e., augmented) without changing sample semantics, while content represents taskrelevant information that should be preserved.
We note that while von Kügelgen et al.
[17] used the same latent variable model to demonstrate that SSL with data augmentation is able to recover features which disentangle style vs. content , our objective for using this perspective is to develop a grounded benchmark that provides adjustable knobs over content (task-relevant) and style (task-irrelevant) information.
These knobs allow us to understand how data-centric properties affect the performance of different graph SSL algorithms (see Fig. 4).
While designing content-aware augmentations for arbitrary graph datasets is a hard problem [38], with oracle knowledge of the data generation process, we can evaluate content-aware augmentations (CAAs) with high recoverability at varying levels of separability, which we approximate through different style levels.
Generation Process.
The proposed data generation process has three components: a set of C motifs, M , that uniquely determine C classes; a random graph generator, RBG ( n ) , parameterized by the number of nodes (we can equivalently define this based on number of edges); and κ , the style multiplier, which controls how much irrelevant information a sample contains.
To generate a sample, we attach a randomly generated background graph ( i.e. , style component) to a motif ( i.e. , content) according to the style multiplier.
This simple process addresses several limitations often encountered in graph CL evaluation.
Specifically, it (i) allows for varying levels of content-aware augmentation ( i.e. , edges that can be perturbed in the background graph without harming the motif); (ii) is easily extended beyond binary classification; (iii) contains relatively large number of samples; and (iv) offers a natural test bed for GNN size generalization or transfer learning [45].
4.2.2 Difficulties in Recovering Style Invariant Representations
Several real graph datasets can be understood through a style vs. content perspective.
For example, in drug discovery tasks [46], molecules can be split into functional groups (content) and carbon rings or scaffold structure (style).
One may thus ask: how does varying levels of style vs. content affect the performance of graph URL algorithms, and how do different algorithms benefit from the use of content-aware augmentations?
To answer these questions, we conduct the following experiment:
Experimental Setup.
Let C
= 6 , κ = 4 and define RBG ( n ) through a random tree generator, where n is number of the nodes belonging the motif, scaled by κ .
Node features are a constant [Figure] [Figure] [Figure]
A cc u r a cy
Graph CL CAA GGA None 0.
AD-GCL
JOAO+CAA
JOAO+GGA
SimGRACE 1 2 3 4 5 6 7 8 SvC Ratio 0.
A cc u r a cy
SpecLoss
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
cc u
[Figure]
cy
Reconstruction
[Figure]
[Figure]
[Figure]
[Figure]
cc
[Figure]
cy
[Figure]
10-dimensional vector.
To increase task difficulty, we randomly insert between 1-3 motif copies into each sample.
Using the specified instaniation of the generation process, we train GraphCL, AAGAE,
GAE, and SpecLoss with content-preserving edge dropping and random edge dropping at 20% and 60% augmentation strength.
We also evaluate two recently proposed automated augmentation methods, JOAO [29] and AD-GCL[31], as well as SimGRACE [32], which uses implicit, weight space perturbations.
JOAO is trained with a GGA prior and an expanded GGA prior that includes content-preserving edge dropping.
AD-GCL is trained using a learnable edge-dropping augmentor.
A 5-layer GIN encoder is used and models are trained for 60 epochs using Adam (with a learning rate of 0.01).
After training, all models are evaluated using the linear probe protocol [1] at varying style ratios.
Given that style information is not relevant to the downstream task, we expect models that have truly learned invariance to this information will retain strong performance across different ratios.
See Appendix F for more model and training details.
Results.
We make the following observations using Fig. 4, which clearly demonstrate the value of the proposed benchmark in studying the behavior of different SSL and augmentation paradigms.
(i)
In accordance to Sec. 3, we empirically see that both GraphCL and SpecLoss do not loss performance as the style ratio increases when using CAAs, indicating the model has learned task-relevant invariances.
(ii) Auto-encoding reconstruction methods are an alternative SSL paradigm, but unfortunately also struggle to recover style-invariant solutions.
Moreover, the use of the CAAs with such methods does not improve performance as effectively as in contrastive paradigms.
(iii)
For the first time, we are able to evaluate whether automated methods, which aim to recover strong augmentations without expensive hyper-parameter tuning or hand designing, are able to recover an optimal augmentation that generalizes across style ratios.
Unfortunately, we see both AD-GCL [31] and JOAO [29] lose performance as the style ratio increases, indicating such a solution has not been found.
Indeed, JOAO is unable to find such a solution even when the augmentation prior includes the oracle CAAs.
These results not only highlight the brittleness of such automated methods, but indicate our benchmark is a necessary testbed for such methods.
(iv) To avoid corrupting graph semantics when using input-space augmentations, SimGRACE [32] instead uses implicit, weight-space augmentations.
However, we find, despite tuning the perturbation parameter, SimGRACE cannot recover strong, style-invariant performance.
Overall, using our grounded synthetic benchmark, we are not only able to able to compare the performance of graph SSL algorithms when data-centric properties are supported (e.g., recoverable augmentations), but are also able to identify limitations of advanced augmentation methods that were not apparent using standard benchmarks.
4.2.3 Invariance vs. Separability
We now use our synthetic benchmark to investigate how augmentation recoverability influences the balance of invariance and separability in the learned latent space.
Considered in isolation, invariance can be trivially satisfied through representation collapse, i.e., all samples are mapped to highly similar representations.
However, such representations are not separable as they cannot meaningfully distinguish classes.
Therefore, in the following experiment, we jointly consider these properties to understand the benefits of CAAs.
Experimental Setup.
Using a synthetic dataset at κ = 6 , we respectively train GraphCL with contentpreserving and random edge dropping at 20% augmentation strength.
We compute an invariance score for each natural sample by computing the average cosine similarity of its representation with that 30 different augmentations.
We compute a separability score by dividing the maximum cosine similarity to a sample of the same class by the maximum cosine similarity to a sample of another class. 1.0 Invariance S e p a r a b ili t y CAAGGA 0.030 0.
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
Results.
Figure 5 shows kernel density estimates of the number of samples that have a given invariance and separability, when training with GGA or CAA.
GGA induces representations with somewhat higher invariance but much lower separability scores, suggesting some representation collapse are occurred.
Indeed, with a higher augmentation strength (60%), we found that using GGA produced invariance and separability scores very close to 1 for all samples, indicating strong collapse.
On the other hand, CAA helps GraphCL achieve over an order of magnitude higher separability and still preserves comparably high invariance.
We observed similar trends for SpecLoss.
Invariance vs. Separability in Realistic Settings.
In App.
C.2, we replicate this experiment using
BACE [47], a molecule-protein interaction dataset, and the biochemistry-based augmentations proposed by Sun et al.
[48] as CAAs.
We find that our observations continue to hold in this real-world use-case, demonstrating the generality of our theory and practicality of our synthetic benchnmark.
Conclusion
In this work, we rigorously contextualize, theoretically and empirically, the role of data-dependent properties for graph CL.
We propose a novel generalization analysis which, for the first time, formalizes the limitations of using GGAs in graph CL.
As we note in Sec. 3, our results can be extended to other contrastive frameworks by leveraging our insight on representing graph augmentations as composable graph-edit operations and extending the contemporary work of Saunshi et al.
We suspect a similar extension can also be made for predictive methods like BYOL by using the analysis of Wei et al.
[28] (see App.
C.1 for further discussion).
In line with our theory, we empirically demonstrate that GGAs fail to induce useful task-relevant invariances on standard benchmarks.
We note our empirical results already demonstrate the generality of our results across different methods.
Moreover, our insights motivate the design of a principled synthetic benchmark that provides a controlled setting for studying the role of data-dependent properties in graph SSL.
Our benchmark also serves as a useful testbed for evaluating the abilities of automated or implicit augmentations techniques.
Given the shortcomings we illustrate for such methods on synthetic datasets, we argue the development of domain specific strategies [48] may be a more fruitful direction for future work.
Acknowledgements
This work was performed under the auspices of the U.S. Department of Energy by the Lawrence
Livermore National Laboratory under Contract No. DE-AC52-07NA27344, Lawrence Livermore
National Security, LLC and was supported by the LLNL-LDRD Program under Project No. 21ERD-012.
It was also partially supported by the National Science Foundation under CAREER Grant
No. IIS 1845491.
PT started this work as an intern at Lawrence Livermore National Labs.
ESL was partly supported via NSF award CNS-2008151.
A Contributions
PT:
Led project formulation, writing, designing & running experiments, and discussion.
PT originally conceived of representing generic graph augmentations using composable, graph edit operations to derive a generalization bound based on SpecLoss and made early attempts at this derivation, as well as its interpretation.
ESL: Contributed to project formulation, writing, experimental design, and discussion. ESL led theory section, deriving Defn.
3.8 (partition dissimilarity) and Thm 3.
(generalization bound).
ESL and PT refined the analysis together.
ESL and PT jointly conceived of using the synthetic dataset and corresponding experiments.
PT led the corresponding section.
MH:
Contributed to running experiments, discussion, writing, and figure generation.
DK:
assisted in early project ideation and contributed to discussion.
JJT: senior advisor, contributed to project formulation, discussion, writing, and experimental design.
B Reproducibility and Broader Impact
For reproducibility, we have included code at https://github.com/pujacomputes/datapropsgraphSSL. git.
Code is under-development and will be finalized soon.
Our code uses the open source torch geometric [49] and PyGCL [50] frameworks.
Self-supervised representation learning is an increasingly popular paradigm for graph representation learning.
Critical to many SSL frameworks is the choice of augmentation strategy.
As we discuss in this paper, the properties or invariances induced by a particular augmentation strategy are often not well-understood.
Failure to understand these properties can lead to unintended effects when the representations are used in downstream tasks.
We hope that our work is useful in better understanding the role of augmentations and other data-centric properties on graph representation learning.
C Extended Discussion C.1 Extending our Analysis to other Loss Functions
While our analysis focuses on the spectral contrastive loss (SpecLoss) [15] for ease of exposition, it can also be extended to other contrastive loss functions and predictive methods, such as BYOL [21].
As we noted in Sec. 2, this can be easily accomplished by leveraging our insights on representing graph augmentations through composable graph-edit operations and extending the analyses of Saunshi et al.
[37] or Wei et al.
Specifically, the contemporary work of Saunshi et al. proposes a general analysis of contrastive loss functionals and yields a generalization bound similar to Thm.
3.9, e.g., a bound that is dependent on similar data-centric properties and assumptions.
In Sec. 3, we decompose GGAs using GED, and then derive expressions for data-centric properties, such as partition dissimilarity, using this decomposition.
Since the focus of our analysis is on understanding these data-centric properties in terms of intrinsic dataset attributes (e.g., GED between samples), our theory is complementary to the strategy used by Saunshi et al.
Indeed, SpecLoss can be replaced with an alternative contrastive loss functional and adapting the analysis conducted in Sec.
3, we can extend our results to other contrastive losses.
For predictive methods, we can leverage recent work by Wei et al.
[28] which provides an analysis for unsupervised learning methods for continuous data domains (such as images) by enforcing representation consistency on augmented samples–i.e., BYOL-like methods.
Critically,
Wei et al.
’s
generalization analysis relies on properties of the data-generating process’s latent space and makes analogous assumptions to the unified recoverability plus separability assumption used in our own work.
Thus, our theoretical analysis can be extended to BYOL-like methods by deriving equivalent analytical expressions for the latent-space properties used by Wei et al.
Moreover, by representing GGAs using graph edit operations, our derivation of such properties relies upon minimal assumptions and is straight-forward.
We do note, however, that Wei et al.
assume that the dimension of learned representations is equivalent to the number of classes in the dataset.
This can be an invalid assumption in unsupervised learning.
In contrast, our analysis is more flexible since we only assume the latent dimension is greater than the number of classes.
C.2 Evaluation on a Non-Synthetic Dataset
Our analysis in Sec.
3 motivates the need for content-aware augmentations (CAAs) by demonstrating that generic graph augmentations (GGAs) often lead to inconsistent samples, harming representation separability and yielding task irr elevant invariances.
In Sec. 4.2, we empirically validated these claims in a controlled setting through our new synthetic benchmark and the corresponding oracle
CAAs (see Fig. 5).
To demonstrate the generality of our analysis in a practical setup, we repeat this experiment in a realistic setting where domain knowledge is available to design content-aware augmentations.
Experimental Setup.
We analyze BACE, a molecule-protein interaction dataset.
We train our models by closely following the setup of Sun et al.
[48], who propose biochemistry-inspired augmentations for learning domain-informed representations.
In our paper’s terminology, these augmentations can be regarded as content-aware augmentations.
To ensure fair comparison, we use only “local" CAA, which does not incorporate additional “global" domain knowledge (see Sun et al.
[48] for further details).
We compare against the strongest GGA baseline reported by the authors, called “mask edge features" augmentation.
[Figure]
For evaluation, we use the trained models to compute the invariance and separability for each sample.
As in Sec.
4.2.3, an invariance score is obtained by computing the mean cosine similarity of a sample’s representation with 30 of its augmentations.
A separability score is computed by dividing the maximum cosine similarity of a given sample and same-class samples by the maximum cosine similarity of a given sample and different-class samples.
Results.
As demonstrated in Fig.
6, the biochemistry-inspired content-aware augmentations induce much better invariance and separability than the GGA.
These results provide further corroboration to our synthetic dataset experiments in 5) and theory in Sec.
3, where we argued that preserving content improves recoverability and leads to taskrelevant invariances with better separability.
C.3 On Using Mutual Information for Analyzing Task-Relevance in Augmentations
While several different perspectives have been recently proposed for studying self-supervised learning’s behavior, many of these frameworks assume that augmentations induce invariance to information that is irr elevant to the downstream task, ignoring the potential for augmentations to induce invariance to task-relevant information and harm generalization performance.
However, as we discussed in Sec. 2, a notable exception is the information-theoretic analysis of Tian et al.
Specifically, Tian et al.
rely upon an information-theoretic framework that interprets the InfoNCE loss as a lower bound of mutual information between two samples.
They demonstrate under this framework that optimal augmentations are ones that maximally perturb information irrelevant to the downstream task.
However, this viewpoint suffers from the fallacy that InfoNCE is rarely empirically correlated with mutual information.
Indeed, Poole et al.[51] demonstrate that this interpretation is only valid when mutual information between two samples is very large.
For high-dimensional inputs, this will hold true when an augmentation does not alter the input at all, which does not align with the practical behavior of graph (or even image) augmentations.
This renders the analysis by Tian et al.
relatively inexact compared to our own analysis.
In contrast, we emphasize that our analysis, which has been designed from the ground-up for graph data and augmentations, is more exact.
By representing graph augmentations as composable graphedit distance (GED) operations, we are able to rigorously relate the generalization abilities of a contrastive trained model to intrinsic dataset properties.
Specifically, by deriving definitions for partition dissimilarity (Defn 3.8) and inconsistent samples (Lemma 3.6) using GED, our generalization bound relies upon minimal additional assumptions (Thm 3.9).
In Sec.
4.2.3 and Sec.
C.2, we verify that our theoretical observations are well supported by our experiments on both synthetic and realworld datasets, further demonstrating the validity of our chosen analysis framework.
D Generic Graph Augmentations and Graph Edit Distance
The key insight for our analysis in Sec.
3 is that GGAs can be instantiated in a general manner as a composition of graph edit operations.
This allows us to derive a unifying assumption related to recoverability and separability in terms of the graph edit distance (GED) between samples.
Here, we provide proofs and additional discussion for the statements made in Sec. 3.
We also discuss how our analysis can be interpreted with respect to the population augmentation graph (PAG) proposed by
HaoChen et al.
[Table]
[Table]
perturbed
[Table]
augmented samples
[Table]
be generated from Augmentation, A , given natural
[Table]
D.1 GGA and Graph Edit Distance
Graph edit distance ( GED ) is used to capture similarity between two graphs.
Intuitively, it captures the cost of making elementary edit operations on a graph, g 1 , to transform it to be isomorphic to another graph, g 2 .
Formally,
Definition D.1 (Graph Edit Distance (Defn. 3.1)) .
Let the elementary graph operators ( node insertion , node deletion , edge deletion , edge addition ) [Table] and the categorical feature replacement operator comprise the set of graph edits.
Then, GED ( g 1 , g 2 ) =
min ( e 1 ,...,e k ) ∈P ( g 1 ,g 2 ) (cid:80) ki
=1 c ( e i ) , where
P ( g 1 , g 2 ) is the set of paths (series of edit operations) that transforms g 1 to be isomorphic to g 2 .
Here, e i is i -th edit operation in the path, and c ( e i ) is the cost for performing the edit.
[Table]
As shown in Table.
1, elementary graph edit operators can be used to straight-forwardly represent the node dropping, edge perturbation and subgraph sampling generic graph augmentations [22].
By introducing an additional graph operator, categorical feature replacement , we are also able to consider distance with respect to categorical node attributes.
This operator performs a “replacement” whenever there is a disagreement between g 1 and g 2 ’s node attributes.
Then, the GED is the total cost of structural changes and attribute disagreements between two graphs.
Here, we assign a unit cost per operation so all operations are treated equally.
Assigning cost to reflect different inductive biases over augmentations is an interesting direction left for future work.
Next, we briefly discuss some examples of using graph edit operators to represent GGAs.
Let ( g , g ) represent the original and augmented graph respectively, where we perform node dropping to obtain g .
Recall that the node dropping augmentation may only drop up to some fraction of nodes in g .
Then, clearly the minimum cost path can then be found using only node deletion operators, and the GED ( g , g ) is bounded by the number of allowed node drops.
Similarly, if g was obtained through the edge perturbation augmentation, which randomly adds or removes a fraction of edges, then GED ( g , g ) is bounded by the number of allowable edge modifications and can be obtained using only edge addition/deletion operators.
(Here, we allow nodes without edges to still exist, so performing node addition/deletion would not result in a lesser GED .)
The sub-graph sampling augmentation extracts a connected sub-graph that contains at most a fraction of total nodes.
The minimum cost path can then be defined using only node deletions , e.g. where the operator is applied to all nodes not in the sampled sub-graph.
Therefore, GED ( g , g ) is bounded by | g | − | g | .
As discussed above, the categorical attribute masking augmentation can be recovered by directly applying the categorical feature replacement operator.
Then, the minimum cost path is then the number of differences between the augmented and original samples’ node attributes.
We formalize the relationships between augmentations and GED in the following Lemmas.
Lemma D.2.
Allowable augmentations can be expressed using GED.
(Reproduction of Lemma 3.2) Let g be a natural sample in X , A be some GGA, g ∼ A ( ·| g ) be an augmented sample generated from g and γ be the augmentation strength or the fraction of the graph that GGAs may modify.
Then, δ ∈ {⌊ γ |V g |⌋ , ⌊ γ |E g |⌋} represents the number of discrete, allowable modifications for the specified
GGA, so GED ( g , g ) ≤ δ.
Correspondingly, we have g ∈ A ( g ) ⇔ GED ( g , g ) ≤ δ .
Proof.
Let P be the shortest path comprised of the edit operators defined in Table.
1 for the given
GGA, A .
Then, given that at most δ discrete modifications are permitted and each operator has unit cost, len ( P ) ≤ δ and (cid:80) e i ∈P c ( e i ) ≤ δ .
Thus, GED ( g , g ) ≤ δ.
Lemma D.3.
Upper-bound on Size of Augmentation Set.
The size of A ( g ) can be upper-bounded through a combinatorial counting process.
For example, to determine A ( g ) when the considered augmentation is node dropping, we can delineate all sets of possible nodes with size up-to γ |V g | .
Formally, the upper-bound on the number of samples generated using node dropping are:
[Equation]
We note that this value is an upper-bound because isomorphic pairs are treated as two separate graphs.
Furthermore, note the size of the augmentation set grows exponentially with graph size.
A similar counting process can be used to determine the number of possible augmented samples obtained through edge perturbation, sub-graph sampling or feature masking.
For example, the edge-dropping augmentation could be counted as: |A
( g ) | ≤ (cid:80) |
[Equation]
We further note that because generic graph augmentations (GGAs) perturb the graph randomly, each augmented sample,
g ∈ A ( g ) , is equally likely, e.g., A ( g | g ) = 1 |A| .
E Details for Generalization Analysis E.1 Generalization Analysis
Recently, HaoChen et al.
[15] demonstrated that spectral clustering over a graph that captures similarity of augmented data can recover class partitions as augmentations belonging to the same class are more similar, and thus well-connected.
These well-aligned partitions can be recovered through spectral decomposition of the similarity graph and the resulting embeddings can be used as features for downstream tasks.
The SpecLoss objective, which performs this decomposition, is then defined as follows [15]: Let g ∼ A ( ·| g ) , g + ∼ A ( ·| g ) , given g ∈ X and g − ∼ A ( ·| g ′ ) , given x ′ ∼ P X
∧ g ′ ̸
= g .
Then, for the positive/negative pairs ( g , g + ) / ( g , g − ) , the loss L ( f ) is:
[Equation]
By defining SpecLoss through spectral decomposition, its generalization error can be bounded using the recoverability and separability assumptions, which can also be understood in terms of the structure of the similarity graph.
Indeed, in Sec. 3, we demonstrated how GGAs and GED influence recoverability and separability by deriving an analogous generalization bound for SpecLoss that is tailored for graph data.
At a high-level, to find this bound, we derived expressions for recoverability, α , and separability, ρ , based on graph edit distance, and then used these expression to recover the SpecLoss bound.
We then performed some additional manipulation to derive the final expression presented in Thm. 3.9.
Here, we provide the details and proofs behind these steps.
We begin by restating the Separability plus
Recoverability assumption.
Assumption E.1 ( Separability plus Recoverability Assumption , (Reproduction of Assm. 3.3)) .
Let g ∈ X
and y ( g ) be its label, and g ∼ A ( ·| g ) .
Assume that there exists a classifier h , such that h ( g ) =
y ( g ) with probability at least 1 − α .
We refer to α as the error of h .
Now, recall from Sec. 3, that h will incur irreducible error on inconsistent samples, which are defined as follows:
Corollary E.2.
( Co-occuring augmentations.
,Reproduction of Coll.
3.4) Let g ∈ X and g , g ′ ∈ X .
Then, g ∼ A ( g ) ∧ g ′ ∼ A ( g ) ⇔
GED ( g , g ′ ) ≤ 2 δ , where δ = min {⌊ γ |V g |⌋ , ⌊ γ |E g |⌋ ⌊ γ |V g |⌋ , ⌊ γ |E g |⌋} .
Proof.
Recall, that g ∼ A ( g ) ⇐⇒
GED ( g , g ) ≤ δ and g ′ ∼ A
( g ) ⇐⇒ GED ( g ′ , g ) ≤ δ .
Then, GED ( g , g ′ ) ≤ 2 δ and are co-occurring augmentations as they both belong to A ( g ) .
Definition E.3 ( Inconsistent Samples , Reproduction of Defn. 3.5) .
Let g ∈ X , and y :
X → r be a labeling function.
Further, let X in = { g |
g ∈ X
∧ GED ( g , g ) ≤ δ } be the set of natural samples that may have generated g and Y ∗ in = { y ( g ) | g ∈ X in } be the set of unique labels.
If g is an inconsistent sample, | Y ∗ in | > 1 .
Now, we fix the behavior of h on inconsistent samples such that h ( g ) =
y , for some fixed y ∈ Y ∗ in .
Then, h induces an r -way partition over X , such that each sample, g , belongs to a partition,
S h ( g ) .
Further, because h will always incur error on inconsistent samples, α can be lower bounded by the ratio of inconsistent to total samples.
To this end, we use GED to identify inconsistent samples by identifying disagreement amongst partitions as follows.
Lemma E.4 ( Using GED to identify inconsistent samples , Reproduction of Lemma 3.6) .
Let g , g ′ ∈ X and GED ( g , g ′ ) ≤ 2 δ such that g ∈ S i ∧
g ′ ∈
S j and i ̸
= j , where partitions are induced by h .
Then, at least one ˜ g ∈ { g , g ′ } must be an inconsistent sample.
Proof.
By definition, GED ( g , g ′ ) ≤ 2 δ implies that at least one of the following must be true: [Equation] i
[Equation]
GED
[Equation]
[Equation]
GED
[Equation]
[Equation]
g
[Equation]
( g [Equation] = j ∧ GED ( g 2 , g ) ≤ δ ∧ GED ( g 2 , g ′ )
≤ δ.
WLOG, assume (i).
Now, g ′ ∈ S
j ⇔ h ( g ) =
j , so j ∈ | Y ∗ in | .
However, GED ( g 1 , g ) ≤ δ , so by Lemma 3.2 and Defn.
3.5, y ( g 1 ) = i ∈ Y ∗ in .
Since, i ̸
= j , | Y ∗ in | > 1 , g must be an inconsistent sample.
Note, if (ii) holds, then g ′ is an inconsistent sample.
Note that the above lemma does not rely on ground-truth label information to identify inconsistent samples, but only GED from natural samples.
Given that the error on inconsistent samples is irreducible, as it is unclear which y ∈ Y in is correct, we can lower bound the error of h as follows:
Corollary E.5 ( Error bound due to Inconsistent Samples , Reproduction of Coll. 3.7) .
The error of h can be lower-bounded as
[Equation]
Here, the number of inconsistent samples can be approximated via (cid:80) ri (cid:80)
g ∈ S
i , g ′ / ∈ S i 1 ( GED ( g , g ′ ) ≤ 2 δ ) and |X| can be estimated using a combinatorial counting procedure.
Thus, the above corollary reflects the fact that error on inconsistent samples cannot be reduced due to label un-identifiability.
Partition dissimilarity, which induces a notion of clustering of similar data-points in our analysis, can be defined as the following:
Definition E.6 ( Partition Dissimilarity , Reproduction of Defn. 3.8) .
Let S 1 , . . .
, S r be an r -way partition of X .
Then, we define the partition dissimilarity for a given partition as
[Equation]
We can now state the main result that re-derives the generalization error of SpecLoss in terms of
GGAs, using the definitions of co-occurring pairs (Def. 3.4) and dissimilar partitions (Def. 3.8).
Notably, we decompose bound in terms of the number of co-occurring augmentation-pairs within the same partition and the number of pairs that cross partitions, which are defined respectively as, λ = (cid:80) g ∈ S ∗ , g ′ ∈ S ∗ 1 ( GED ( g , g ′ ) ≤ 2 δ ) , and µ = (cid:80) g ∈ S ∗ , g ′ / ∈ S ∗ 1 ( GED ( g , g ′ ) ≤ 2 δ ) .
Theorem E.7 ( Generalization Bound for SpecLoss with GGA , Reproduction of Thm 3.9) .
Assume the representation dimension k ≥ 2 r and Assm.
3.7 holds for α ≥ 0 .
Let F be a hypothesis class containing a minimizer f ∗ pop of SpecLoss, L ( f ) , which produces a ⌊ k/ 2 ⌋ -way partition of X denoted by { S ∗ } .
Let its most dissimilar partition have dissimilarity denoted by ρ ⌊ k/ 2 ⌋ =
min
i ϕ ( S i ∈
{ S ∗ } ) .
Then, f ∗ pop has a generalization error bounded as, where the middle term is from the original SpecLoss bound:
[Equation]
Proof.
The conversion from recoverability ( α ) and conductance ( ρ ) and within partition ( µ ) and across partition pairs ( λ ), can be derived as follows.
We assume that the data distribution is I.I.D and the size of the class partitions are roughly equivalent.
[Equation]
[Table]
[Equation]
Now, notice that the above equation can be understood as the number of inconsistent samples vs. the original samples.
Let, λ = (cid:80) g ∈ S ∗ , g ′ ∈ S ∗ 1 ( GED ( g , g ′ ) ≤ 2 δ ) and µ = (cid:80) g ∈ S ∗ , g ′ / ∈ S ∗ 1 ( GED ( g , g ′ ) ≤ 2 δ ) .
Then, we have recovered the bound presented in Theorem
[Equation]
Recall, that inconsistent samples can be determined through graph edit distance (Defn. 3.5) between augmented samples.
Moreover, that the maximum allowable edit distance between augmented samples is determined by augmentation strength.
E.2 Connections to the Population Augmentation Graph
The original bound for SpecLoss uses the population augmentation graph (PAG).
While we did not use the PAG in our analysis for ease of exposition, we note that our analysis can be adapted for the
PAG as follows:
Definition E.8 (Population Augmentation Graph [15]) .
Let G p be the PAG where the vertex set is all augmented data X .
For any two augmented data g , g ′ ∈ X , define the edge weight w gg ′ as the marginal probability of generating g and g ′ from a random natural data g ∼ P X :
[Equation]
To extend our analysis to the PAG, we show that connectivity in the PAG is also determined by
GED.
Then, the definition of inconsistent samples, and partition dissimilarity (conductance) straightforwardly follow.
Lemma E.9.
Connectivity in the PAG is determined by GED.
Let g , g ′ ∈ X , and g ∈ X .
Then, w gg ′ > 0 ⇔ GED ( g , g ′ ) ≤ 2 δ.
Proof.
By Lemma 3.4, w gg ′ > 0 ⇔ A ( g | g ) >
∧ A ( g ′ | g ) > 0 .
Moreover, if A ( g | g ) > 0 then, g is the augmentation set of g .
If g ∈ A ( g ) then, GED ( g , g ) ≤ δ .
Then, w gg ′ > 0 ⇔ GED ( g , g ) ≤ δ ∧ GED ( g ′ , g ) ≤ δ , which in turn applies, w gg ′ > 0 ⇔ GED ( g , g ′ ) ≤ 2 δ .
Corollary E.10 ( Conductance according to GGA ) .
Recall, the conductance ϕ G of a partition S i in a graph G measures how many edges cross partitions relative to total number of edges a node possesses and that A ( g | g )
≈
[Equation]
Then,
[Equation]
where w x represents the size of x ’s edge-set.
Using this definition, we can substitute into the original SpecLoss generalization bound and recover the result presented in Thm. 3.9.
F Dataset Generation and Experimental Details
[-6 Class: B    
-]
[-Class: D  
-]
[-Class: E 0  
-]
We use the motifs shown in Fig.
F to define a 6 class graph classification task.
It is important to ensure that the motifs are not isomorphic, as many GNNs are less expressive than the 1-Weisfeiler
Lehman’s test for isomorphism ([52]).
For each class, 1000 random samples are generated as follows : (i) We randomly select between 1-3 motifs to be in each sample.
At this time, motifs all belong to the same class, though this condition could easily be changed for a more difficult task.
(ii) We define the number of content nodes, C n , as the size of the selected motif, scaled by the {+3  7 2 Class: A      6 Class: B    
 Class: C Class: D  
+}
{+Class: E 0  
+}
Class: F
Content Motifs [Table] number of motifs in the sample. (iii)
For a given style ratio, we determine the number of possible style nodes as S n = ρC n (iv).
We define RBG ( n ) using networkx’s 2 random tree generator: networkx.generators.trees.random_tree .
We note that other random graph generators would also be well suited for this task.
(v) For additional randomness, we create background graphs using
S n ± 2 , and also randomly perturb up-to 10% of edges in sample.
We repeat this set-up with ρ ∈ { 0 . 5 , 1 . 0 , 1 . 5 , 2 . 0 , 2 . 5 , 3 . 0 , 3 . 5 , 4 . 0 , 4 . 5 , 5 . 0 , 5 . 5 , 6 . 0 , 6 . 5 , 7 . 5 , 8 . 0 } to generate the datasets used in Sec 4.2.
Experimental Set-up: We follow You et al.
[22] for TUDataset experiments.
When reporting the kNN accuracy, we tune k ∈ { 5 , 10 , 15 , 20 } separately on validation data for each dataset and method to allow for the strongest baselines.
For synthetic datasets we use the following setup.
Our encoder is a 5-layer GIN model with mean pooling.
We set input node features to be a constant 10-dimensional feature vector, and a hidden layer dimension is 32; we concatenate hidden representations for a representation dimension of 160.
Models are pretrained for 60 epochs.
Subsequently, we use a linear evaluation protocol and train a linear head for 200 epochs.
All models are trained with Adam, lr = 0.01.
G Related Work
[Table]
Graph Data Augmentation: Unlike images, graphs are discrete objects that do not naturally lie in
Euclidiean space, making it difficult to define meaningful augmentations.
Furthermore, while for images or natural language, there may be an intuitive understanding of what changes will preserve task-relevant information, this is not the case for graphs.
Indeed, a single edge change can completely change the properties of a molecular graph.
Therefore, only a few works consider graph data augmentation.
[60] note that a node classification task can be perfectly solved if edges only exist between same class samples.
They increase homophily by adding edges between nodes that a neural network predicts belong to the same class and breaking edges between nodes of predicted dissimilar classes.
However, this approach is expensive and not applicable to graph classification. [30] argue that information preserving topological transformations are difficult for the aforementioned reasons and instead focus on feature augmentations.
Throughout training, they add an adversarial perturbation to node features to improve generalization, computing the gradient of the model weights while computing the gradients of the adversarial perturbation to avoid more expensive adversarial training [61].
This approach is not directly applicable to contrastive learning, where label information cannot be used to generate the adversarial perturbation.
Graph Self-Supervised Learning:
In graphs, recent works have explored several paradigms for self-supervised learning: see [62] for an up-to-date survey.
Graph pre-text tasks are often reminiscent of image in-painting tasks [63], and seek to complete masked graphs and/or node features ([64, 13]).
Other successful approaches include predicting auxiliary properties of nodes or entire graphs during pre-training or part of regular training to prevent overfitting ([13]).
These tasks often must be carefully selected to avoid negative transfer between tasks.
Many contrast-based unsupervised approaches have also been proposed, often inspired by techniques designed for non-graph data.
[26, 65] draw inspiration from [9] and maximize the mutual information between global and local representations.
MVGRL ([23]) contrasts different views at multiple granularities similar to [8].
[22, 58, 25, 24, 59] use augmentations (which we summarize in Table G) to generate views for contrastive learning.
We note that random corruption, sampling or diffusion based approaches used to create generic graph augmentations often do not preserve task-relevant information or introduce meaningful invariances.