Manuscript Offprint
arXiv:2610.12809The Expressive Power of Random-Feature MPNNs Across Graph Sizes
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Continuous random node features increase the expressivity of message-passing neural networks (MPNNs), but existing theoretical analyses are not fine-grained enough to capture their limitations, particularly in approximating functions across graph sizes or under a fixed number of random bits. We develop a population-level framework for size-uniform approximation. For MPNNs with a graph-size-independent Lipschitz bound in their initial features, including standard mean, max, and order-normalized sum architectures, we show that continuous random features can be quantized to finitely many colors with arbitrarily small uniform error in expected output. This reduction lets us transfer limitations on finite-color distinguishability to limitations on size-uniform approximation with continuous random features. We use this framework to prove that these MPNNs are not size-uniformly universal, analyze the expressivity gains from colors and independent trials, and establish incomparability between random-color MPNNs and higher-order Weisfeiler–Leman methods. We also give finite-color MPNN constructions for tree subgraph isomorphism via color coding and a local MST task.
1 INTRODUCTION
Message-passing graph neural networks (MPNNs) [8, 25] are widely used to learn functions on graphs, but their expressive power is limited by symmetries that message passing cannot break [17, 31]. Random node features provide a powerful way to break these symmetries [1, 6, 10, 24]. Specifically, continuous random features almost surely give every vertex a unique identifier, enabling universality at any fixed graph size [1]. However, these constructions require unbounded precision as graphs grow and do not guarantee that a fixed model can approximate a target uniformly across graph sizes. In practice, we want a trained model to handle larger graphs with a fixed architecture, parameters, and precision. This motivates studying size-uniform approximation, as well as how expressive power depends on the number of random bits per vertex.
Representing the same function across graph sizes is a prerequisite for size generalization, which aims to maintain performance on graphs larger than those seen during training [19, 32, 34]. This is essential for learned graph algorithms, particularly in combinatorial optimization, where larger instances may be too expensive to label for training. Neural algorithmic reasoning pursues this goal through inductive biases that favor algorithmic behavior [27, 28]. Such biases, however, cannot yield size generalization if the model class cannot represent a computation across graph sizes. Recent work gives conditions for size-generalization guarantees [19, 30]. Related work studies uniform expressivity for graph transformers and virtual-node MPNNs [22], universality for transformers over arbitrarily many context tokens [7], and any-dimensional invariant universality [15, 33].
We ask which invariant graph functions a random-feature MPNN can approximate uniformly across graph sizes. To obtain deterministic predictions invariant under vertex relabeling, we consider the expected output over random initializations. Let be an invariant target function, write for the population predictor, and set . Fixed-size approximation allows an -dependent predictor with while size-uniform approximation instead requires one predictor , independent of , with .
Previous work establishes universality for random-feature MPNNs [1] and gives specific algorithmic constructions [11, 24], but does not characterize how expressive power depends on the number of random bits per node feature and the number of independent evaluations. We develop a framework that quantifies these dependencies and identifies graph pairs that cannot be reliably distinguished with limited resources. Building on expectation-based analyses
*Work initiated while at University of California San Diego.
of randomized GNNs [11–13], we study the functions these models represent in expectation and estimate them by averaging independent evaluations. This lets us use the same notions of approximation and distinguishability as for deterministic architectures [17, 31], while accounting for their statistical nature. In particular, we develop WL-based combinatorial bounds on distinguishability that translate into limitations on expected approximation.
We study size-uniform approximation for MPNNs with a size-independent Lipschitz constant in the initial random features. This covers mean, max, and order-normalized sum aggregation, as well as unnormalized sums on bounded-degree graphs, and matches the regime of the size-generalization results of Wittig et al. [30]. It also prevents models from extracting increasingly detailed node identities from vanishing numerical differences.
Our work Our central reduction shows that, for uniformly Lipschitz MPNNs, continuous random features can be replaced by random features taking finitely many values (which we call random colors drawn from a palette), with arbitrarily small uniform error in expected output. Hence, every invariant function approximable size-uniformly by a finite-dimensional continuous-random-feature MPNN is also size-uniformly approximable by a random-color MPNN. The palette size may depend on the target, accuracy, and model, but not on graph size. Continuous precision is thereby reduced to two discrete resources, the number of colors q and the number of independent trials s; see Figure 1 for an overview.
Using CFI graph families [4], we construct an invariant target that no uniformly Lipschitz random-feature MPNN can approximate uniformly across sizes, even on graphs of bounded diameter. The corresponding n-vertex pairs are separated by (folklore) 2-dimensional Weisfeiler–Leman (2-WL). A random-color MPNN using q colors requires at least s independent trials per graph to distinguish them with success probability at least 2/3, where . Thus, additional colors can be exponentially more effective than additional trials on these instances. In addition, random-color MPNNs and higher-order k-dimensional Weisfeiler–Leman (k-WL) are also incomparable, i.e., for every fixed k, a two-color, one-trial MPNN separates a pair that k-WL does not, while for every fixed palette and trial budget, 2-WL separates a pair that the random-color model does not.
Finite colors nevertheless support useful size-uniform computations, including color coding for fixed-tree subgraph detection [2] and a local MST edge task. Building on Wittig et al. [30], a randomized finite-cover argument then links the represented function class to size-generalization guarantees.
Contributions In summary, our main contributions are as follows.
-
Framework for randomized expressivity. We develop a population-level framework for random-feature MPNNs, allowing their expressive power to be studied through invariant function approximation, graph distinguishability, and comparisons with the Weisfeiler–Leman hierarchy (Section 2).
-
Size-uniform characterization. We reduce continuous random features to discrete random features (Theorem 3 and Corollary 4) and prove that random-feature MPNNs are not size-uniformly universal (Corollary 6).
-
Expressivity results. We establish strict color and trial hierarchies for statistical distinguishability by random-color WL (Theorem 7), quantify their tradeoff using CFI graphs (Theorem 5), and prove incomparability with higher-order Weisfeiler–Leman (Theorem 8).
-
Scalable computation and learning. We give finite-color constructions for structural algorithms (Theorem 9 and Proposition 10), and give sufficient conditions for size-uniform generalization from a suitable finite training set (Theorem 11).
Related work Loukas [16] showed that MPNNs equipped with unique node identifiers, sufficiently expressive message and update functions, and sufficient depth and width can simulate arbitrary distributed computations and, in particular, are Turing complete. Vignac et al. [29] incorporated one-hot node identifiers into an equivariant structural message-passing architecture, making the resulting representation independent of the particular identifier assignment.
Randomization offers another route to individualization. Dasoulas et al. [6] showed that random node colorings can break symmetries and substantially strengthen MPNNs, while Sato et al. [24] demonstrated that random features enable MPNNs to simulate randomized local algorithms and improve approximation guarantees for combinatorial optimization problems. Rosenbluth et al. [21] showed that a recurrent GNN with random vertex features can simulate any polynomial-time graph algorithm on connected graphs in polynomial time. GNNs with random node initialization are universal approximators for invariant graph functions on fixed-size graph domains [1, 9]. Pellizzoni et al. [20] subsequently analyzed both the expressivity and statistical sample complexity of node-individualized GNNs, establishing more favorable sample-complexity bounds for permutation-equivariant individualization schemes. Kanatsoulis and Ribeiro [11, 12] proved that MPNNs with random features could compute graph properties that standard MPNNs could not, showing that random features can overcome the expressivity limitations of anonymous

Figure 1: Overview of our random-feature MPNN framework. Size-uniform quantization with a finite palette . Here , , and . Both branches use the same MPNN and coupled initializations.
message passing [31] by acting as probabilistic node identifiers. Their guarantees, however, primarily concern fixed-size expressivity or approximation on bounded graph domains and do not characterize when symmetry breaking yields a scalable algorithmic representation that transfers across graph sizes.
2.1 Randomized MPNNs
Let be a class of finite graphs and let be a compact node-feature space equipped with a probability distribution .
A depth- MPNN initializes , and updates its representations for according to
where is coordinate-wise ReLU and is a bias shared by all vertices. We consider mean, max, min, and order-normalized sum aggregation; the detailed hypothesis classes are specified in Section A.2. A graph-level MPNN applies a permutation-invariant readout function READOUT to the final node representations to produce a scalar output , where denotes the collection of initial node features.
For , a random initialization assigns each vertex an independent random feature drawn from ,
The resulting random-feature MPNN has output . When the support of comprises finitely many points, we call the corresponding random features random colors to emphasize their discrete nature, and we refer to the support as the palette. An MPNN with such an initialization is called a random-color MPNN. The color distribution need not be uniform. We consider graphs that are not given node attributes as input and are instead assigned random attributes. It is straightforward to extend our setting to graphs with input node attributes that are concatenated with the random initialization.
2.2 Size-uniform approximation
A single initialization produces a random output. Taking its expectation gives a deterministic graph invariant whose approximation power we can analyze. For a graph-level MPNN with fixed parameters, we write its population predictor as
Size-uniform approximation requires a single model to achieve the desired accuracy throughout the graph domain, including on arbitrarily large graphs when these belong to the domain.
Definition 1 (Size-uniform approximation). For a graph class and a graph invariant , a class of random-feature MPNNs uniformly approximates if, for every , there exists a single with
In particular, if contains graphs of arbitrarily large size, we call this approximation size-uniform. The class is a size-uniform universal approximator for graph invariants if contains all finite graphs and it uniformly approximates every graph invariant .
To replace continuous features by finitely many colors, we need small nodewise perturbations to have a controlled effect on the output even as graphs grow. We therefore require a Lipschitz bound that is independent of graph size. Specifically, fix a norm on and use the max-over-nodes input norm . This norm measures the largest perturbation at any vertex.
Definition 2 (Uniform Lipschitzness). An MPNN is uniformly -Lipschitz with respect to if, for every graph and all ,
The same constant L applies to every graph. Consequently, perturbing each initial feature by at most changes the output by at most , independently of the number of vertices. This is the stability property used in our quantization argument. The following lemma shows that it holds for several standard MPNN architectures.
Lemma 1 (Uniform Lipschitzness of standard MPNNs). For fixed depth, widths, and parameters, ReLU MPNNs with mean, max, min, or order-normalized sum aggregation and mean pooling are uniformly Lipschitz. The same holds for unnormalized sum aggregation on graph classes of bounded degree.
The proof is given in Section A.4.
2.3 Colors, trials, and distinguishability
The population predictor describes the function represented in expectation. We next ask how reliably finitely many evaluations can estimate this function and reveal differences between graphs.
We refer to a single evaluation with an independent random initialization as a trial. For an MPNN , draw independent initializations and define
Then for every , so the number of trials affects estimation but not the represented population function.
Graph-pair distinguishability connects this estimation problem to expressivity: approximating a target that takes different values on two graphs requires separating their population outputs. We measure this separation by the population gap . Write for the diameter of the feature space.
For inputs , compute empirical means and from two independent batches of trials, even when . For a margin , the test of against rejects when . The following proposition shows that a positive population gap can be detected with a number of trials that depends on the gap and the model's feature sensitivity, but not on graph size.
Proposition 2 (Population separation yields finite-trial distinguishability). Let be uniformly -Lipschitz, and fix with . For any , the test above has probability of error at most for every whenever the number of trials is greater than
The proof is given in Section A.
To prove limitations on finite-trial testing, we use random-color Weisfeiler–Leman (random WL). Each trial independently colors the vertices and applies standard Weisfeiler–Leman refinement. An arbitrary test then compares the resulting patterns across trials. These patterns contain enough information to determine the output of an MPNN on the same colored graph. Thus, for uniform q-color initializations, limitations of random-color WL also apply to the corresponding random-color MPNNs, including tests that use more than their empirical means.
Definition 3 (Random-color WL distinguishability). Let and . A non-isomorphic pair is statistically -distinguishable by random-color WL if a randomized binary test satisfies
where , are independent batches of s 1-WL patterns from independent uniform q-colorings of A and B, respectively.
Here, q controls the number of colors available within each trial, while s controls the number of independent observations. The full construction and statistical reductions are in Section A and Definition 6.
These notions complete the connection to function approximation. By Proposition 2, a lower bound ruling out successful testing at a sufficiently large trial budget also rules out the corresponding population gap. Such a bound limits how accurately the model can approximate a target that assigns different values to the two graphs. We formalize the resulting obstruction to size-uniform universality in Corollary 14 in Appendix A.6.
3 EXPRESSIVITY BOUNDS
We now analyze the expressive power of random-feature MPNNs across graph sizes. We first show that uniform Lipschitzness lets us replace continuous random features with finite random colors, and use this reduction to establish non-universality. We then prove strict color and trial hierarchies for statistical distinguishability and establish incomparability with higher-order Weisfeiler–Leman methods.
3.1 From continuous features to random colors
We begin by using uniform Lipschitzness to quantize random features with an error independent of graph size. Let be a finite palette and let be a quantization map taking every point in to its nearest point in , with . Applying to each node gives , and we consider the quantized population predictor .
Theorem 3 (Size-uniform quantization). Let be a uniformly -Lipschitz MPNN with random features supported on compact . For every finite palette ,
The result follows as is independent of the number of nodes and Lipschitzness bounds the output change by . Compactness ensures the existence of finite palettes with arbitrarily small . For a concrete example, consider uniform features on . An -level grid per coordinate gives quantization to equally likely colors and quantization error at most .
Corollary 4 (Finite colors suffice). Every graph invariant size-uniformly approximable by uniformly Lipschitz MPNNs with compactly supported random features is also size-uniformly approximable by uniformly Lipschitz random-color MPNNs.
Intuitively, this corollary follows as a sufficiently fine palette preserves a model's output up to arbitrarily small error. Uniform Lipschitzness then ensures that this same palette remains sufficient as graphs grow. The palette may need to become finer as we demand more accurate approximation, but it need not grow with graph size. In addition to palettes generated by quantization, we will also consider palettes that are one-hot encodings of colors. We show that these palettes have equivalent approximation power in Section B.
3.2 Non-universality and trial lower bounds
We now use quantization to establish limitations on size-uniform approximation. We construct a pair of non-isomorphic graphs using Cai–Fürer–Immerman gadgets [4] that require an exponential number of trials to distinguish.
Theorem 5 (Exponential trial requirement). There exist non-isomorphic connected graph pairs , with vertices and diameter 2, such that statistical -distinguishability by random-color WL requires
for .
The pair is built from many copies of the 1-WL-indistinguishable pair and , connected by CFI gadgets so that hiding the distinction within any one pair also hides the distinction between and . For a fixed palette, the and blocks in each pair are both monochromatic with constant probability, independently across pairs. When this happens, WL cannot distinguish the and blocks. The probability that a trial avoids all such events is then exponentially small in graph size, so exponentially many trials are required. These graph pairs can be used to construct a graph invariant taking value 1 on and 0 on that uniformly Lipschitz random-feature MPNNs cannot approximate uniformly over graph size. This establishes their non-universality.
Corollary 6 (Failure of size-uniform universality). Uniformly Lipschitz MPNNs with i.i.d. uniform features on are not size-uniform universal approximators for bounded graph invariants, even for input graphs of bounded diameter or bounded degree.
3.3 Colors and trials
The previous section gives an example where colors are exponentially more useful than trials; we now show that increasing either resource strictly increases statistical distinguishability.
Theorem 7 (Strict color and trial hierarchies). For statistical distinguishability by random-color WL as in Definition 3, the following hold.
(i) Trials. For every integer , there are non-isomorphic finite graphs , that are statistically -distinguishable but are not statistically -distinguishable.
(ii) Colors. For every pair of integers , there are non-isomorphic finite graphs that are statistically -distinguishable but are not statistically -distinguishable for any .
The trial hierarchy is already strict with two colors. Both statements follow from a common graph construction. That is, a parity gadget combines pairs of cycle blocks so that a trial reveals the graph identity when every input pair has at least one nonmonochromatic block. Otherwise, the conditional WL observation laws agree for the two graphs. This yields an explicit revelation probability and an exact expression for the optimal testing error. We then choose the graph parameters so that this error crosses 1/3 upon adding one trial or one color. The full construction and proofs are given in Section H.
3.4 Comparison with Weisfeiler–Leman
We now show that with fixed trials and palette size, random-color MPNNs are incomparable with k-WL for .
Theorem 8 (Incomparability with higher-order WL). For every :
(i) There exists a k-WL-indistinguishable graph pair that is distinguished with success probability greater than 2/3 by a uniformly Lipschitz MPNN with order-normalized sum aggregation, using two colors and one trial.
(ii) For every fixed , there exists a graph pair distinguished by 2-WL, and hence by -WL, that is not statistically -distinguishable by random-color WL.
For the first direction, start with an n-vertex graph pair that k-WL cannot distinguish. Attach a path of the same length to every vertex, preserving k-WL indistinguishability. The independent binary colors along each path, read in order from its attachment vertex, form an identifier for that original vertex. If the paths have length , then these identifiers are unique with high probability, and thus, 2 colors provide enough information to distinguish every original vertex. An MPNN can collect these identifiers and use them to recognize the graph. This example shows how random colors and graph structure can powerfully combine to distinguish vertices.
For the reverse direction, consider the pair from Theorem 5, which is constructed with CFI gadgets. The 2-WL distinctions between the and blocks propagate through the parity tree, revealing which root endpoint carries the marker. The exponential trial lower bound then rules out reliable distinction with any fixed palette and trial count on sufficiently large pairs. The formal incomparability result appears in Section E.
4 ALGORITHMIC APPLICATIONS
Finite random colors also support algorithmic computations across graph sizes. We give MPNN constructions for tree subgraph detection via color coding and a local MST edge task, with resource requirements independent of graph size.
4.1 Tree subgraph detection
We adapt the color-coding algorithm of Alon et al. [2] to random-color MPNNs. Consider a graph G with n vertices and a fixed rooted tree T with k vertices. Independently assign each vertex in G a uniform color from [k]. A subgraph of G isomorphic to T is called colorful if its vertices have distinct colors; each fixed copy is colorful with probability . Alon et al. [2] give a dynamic program that searches for colorful copies of T, using colors to distinguish their vertices. We show that an MPNN can implement this dynamic program with depth, width, and trial count independent of n.
Theorem 9 (Rooted tree detection). Let be a rooted tree with vertices and let . There is a random-color MPNN using colors, layers, hidden dimension , max aggregation, and binary vertex outputs such that, for every graph and vertex ,
independent trials suffice to detect a non-induced copy of T rooted at v with no false positives and false-negative probability at most . The test at v accepts when its average binary output is positive.
Taking the maximum over vertex outputs gives a graph-level detector for T with the same resource bounds and error guarantees (Corollary 31). The network and trial budgets depend only on k and desired confidence, not on the input graph's size n. A subcase is detecting simple paths on k vertices. The construction and proof appear in Theorem 30. Note that without colors, MPNNs with identical initial vertex features cannot solve this task in general. For example, contains a simple four-vertex path whereas does not, but these graphs are indistinguishable by 1-WL and hence indistinguishable by any MPNN with identical initial vertex features (Proposition 28).
We use k-WL to denote folklore WL (k-FWL), which is equivalent to oblivious -WL for ; see Morris et al. [18, Sections 3.1–3.2].
4.2 Local MST edge detection
Next, we consider a task for detecting MST edges that requires only local information. An edge belongs to every minimum spanning tree (MST) if and only if it is the unique minimum-weight edge across some cut. For a graph with uniform weights, this is exactly the set of bridge edges. We analyze the set of such edges that unbalanced cuts can witness, so we need only local information to identify them. Specifically, let be a simple graph with edge weights in a fixed finite ordered set. Write for the edges that uniquely minimize a cut with fewer than vertices on one side of the cut. We give an MPNN that detects such edges. As this is an edge prediction task, we compute the output for each edge by applying a shared MLP, called the edge decoder, to the sum of its endpoint embeddings together with its edge weight.
Proposition 10 (Size-independent local MST edge detection). Fix an integer , a finite weight set , and . There is a max-aggregation random-color MPNN with an edge decoder such that, for every such graph , its output misses at most an fraction of and incorrectly includes at most an fraction of , with probability at least . Its palette size, depth, and number of independent trials depend only on , not on graph size.
Our construction tests whether removing the candidate edge and all heavier edges leaves its endpoints in different components, with at least one component containing fewer than k vertices. Each endpoint collects the colors it can reach, allowing the network to recognize a small component and compare the two endpoints' components. With sufficiently many colors and trials, this controls both missed edges and false detections. The construction and proof are given in Proposition 33. In contrast, we also show that MPNNs with identical initial vertex features cannot compute in general (Theorem 34).
5 LEARNABILITY OF RANDOMIZED GNNS
We study the learnability of randomized MPNNs trained using averages over finitely many random node initializations. We fix the depth D, hidden dimensions, aggregation scheme, and initialization law on a compact feature space K, subject to the weight and bias bounds in Section A.2. We consider scalar graph-level outputs with mean pooling and a linear readout.
The graph pseudometric compares the distributions of depth-D neighborhood representations under random node initialization and uniform vertex sampling. It is the Wasserstein distance between these distributions, using a recursive metric reflecting the aggregation scheme; see Section K. Distinct graphs may have distance zero if their representation distributions coincide. The graph domain G is totally bounded under this pseudometric, and the mean predictor , where , satisfies
Here, is an explicit Lipschitz certificate computed from the network parameters; see Section J.2. These properties allow accuracy on a suitable finite training set to control approximation error throughout . Let be -Lipschitz under . For training graphs and independent initializations of each graph, define
where and .
Theorem 11 (Uniform generalization from Monte Carlo training). For every and , there exist a finite training set and a tolerance such that the following holds. For any sufficiently large , draw independent initializations of each training graph from . Then, with probability at least ,
simultaneously for all .
Thus, sufficiently small sampled regularized error guarantees uniform approximation by the mean predictor, regardless of graph order. The training-set size is controlled by the graph domain's covering number at a radius determined by the desired accuracy and the target's Lipschitz constant. Uniform Monte Carlo concentration makes the guarantee hold even when parameters are selected using the same sampled initializations. For any fixed test graph, Monte Carlo concentration controls the error from averaging fresh independent initializations, without retraining. The proof and an explicit sufficient sample size are given in Sections L and M.
6 EXPERIMENTS
We perform a range of experiments to explore the role of random colors in expressivity and size generalization. Section N gives additional details.
Bridge prediction across graph sizes We train random-color MPNNs to identify bridge edges in unweighted Erdős–Rényi graphs with 16 or 32 vertices and

Figure 2: Balanced test accuracy for detecting bridges of smaller-side size . Error bars show SE over five training seeds.
test on 512-vertex graphs. Our local MST edge-detection result (Proposition 10) motivates examining the size of the smaller endpoint component after deleting a bridge. We train separate models to detect bridges with exactly vertices on the smaller side, treating all other edges as negatives. A standard MPNN with constant initialization and max aggregation assigns the same score to every edge, yielding exactly 50% balanced accuracy for all three target sizes. With 16 trials and a fixed training budget, increasing the number of one-hot colors increases mean balanced test accuracy (Figure 2). In particular, larger palettes improve detection, while bridges with larger smaller-side components remain harder to identify. Furthermore, detection generalizes to larger graphs using a fixed finite palette.
Tree substructure detection: colors and trials Motivated by our color-coding construction (Theorem 9), we train models to detect the full balanced degree-three tree of depth two—a root with three children, each with two leaves—as a non-induced subgraph rooted at each vertex. Training and test graphs are random 3-regular graphs on 24 vertices and we vary the palette and trial count. On these graphs, the target is equivalent to the vertex's two-hop neighborhood having the maximum possible size of 10. We train using the maximum output across trials. At test time, we sum predictions across trials and apply a threshold chosen on validation graphs.
Increasing either the palette size or the number of trials increases mean test accuracy (Figure 3). These results support our tree-detection construction (Theorem 9): finite colors enable detection, whereas constant initial features give identical outputs at every vertex of these 3-regular graphs. The gains from both resources align with our color and trial hierarchies (Theorem 7).
Inference-time quantization Motivated by our quantization result (Theorem 3), we examine whether quantizing random features preserves predictive performance. We replicate GCN-RNI on EXP [1] and rGIN on TRIANGLE [24], then quantize their random features to two values per coordinate without retraining. EXP classifies graph-encoded Boolean formulas; we evaluate the 64-

Figure 3: Rooted tree detection with different numbers of colors and trials. Cells show mean node test accuracy (%) SE across five training seeds.
| Setting | Continuous | 2 colors/coordinate |
|---|---|---|
| EXP: graph accuracy (%) | ||
| 1 coordinate | ||
| 64 coordinates | ||
| TRIANGLE: node ROC-AUC (%), | ||
| 1 coordinate | ||
Table 1: Inference-time performance under quantization. Mean SE across ten folds for EXP, and ten single-trial feature draws of one trained model for TRIANGLE.
coordinate baseline and a scalar variant. On TRIANGLE, we predict triangle membership using 20-vertex 3-regular training graphs and 20- and 100-vertex test graphs. Both models retain most of their predictive performance (Table 1), supporting our message that finite palettes can preserve the expressive benefits of continuous random features, including under size generalization.
7 CONCLUSIONS
We analyze random-feature MPNNs through the vertex distinguishability provided by finite random colors. This offers a natural intermediate between anonymous message passing and the use of continuous random features as unique vertex identifiers. For uniformly Lipschitz MPNNs, finite colors retain the size-uniform approximation power of continuous random features, while making the capabilities and limitations of random-feature MPNNs explicit. Our framework also makes the roles of palette size and trial count clear, laying a theoretical foundation for understanding how to use random features in practice.
An important next step is to identify further algorithms that can be implemented using graph-size-independent numbers of colors and trials. Although our examples establish limitations and incomparability with -WL, a broader characterization of which graph pairs these models can distinguish remains open. Our statistical testing framework permits arbitrary combinations of trials, but our approximation and learning analysis centers on averaging. Studying other ways of combining trial information, beyond averaging and expectations, is another interesting direction, as aggregation across trials is an important architectural choice.
ACKNOWLEDGEMENTS
We thank Sanjoy Dasgupta for insightful discussions during the early stages of this work.
YW, RRN, and MB are supported by NSF grant CCF-2217058, and YW and RRN are additionally supported by NSF grants CCF-2112665 and CCF-2310411. CM is partially funded by a DFG Emmy Noether grant (468502433), Israel ISF-DFG Grant (587125021), and a RWTH Junior Principal Investigator Fellowship under Germany's Excellence Strategy. AV is supported by the German Research Foundation (DFG) within Research Training Group 2236/2 (UnRAVeL).
AI USE STATEMENT
We used generative AI tools to help refine and check our mathematical arguments, explore mathematical approaches, design and implement experiments, analyze results, and prepare figures. We also used these tools for literature searches and to draft and revise the manuscript. All material developed or modified with AI assistance was explicitly reviewed and verified by the authors.
Bibliography
[1] Ralph Abboud, İsmail İlkan Ceylan, Martin Grohe, and Thomas Lukasiewicz. The surprising power of graph neural networks with random node initialization. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence (IJCAI-21), pages 2112–2118. International Joint Conferences on Artificial Intelligence Organization, 2021. doi:10.24963/ijcai.2021/291.
[2] Noga Alon, Raphael Yuster, and Uri Zwick. Color-coding. Journal of the ACM, 42(4):844–856, 1995. doi: 10.1145/210332.210337.
[3] Vladimir I. Bogachev. Measure Theory. Springer-Verlag, Berlin, Heidelberg, 2007. doi: 10.1007/978-3-540-34514-5.
[4] Jin-Yi Cai, Martin Fürer, and Neil Immerman. An optimal lower bound on the number of variables for graph identification. Combinatorica, 12(4):389–410, 1992. doi: 10.1007/BF01305232.
[5] Yijia Chen, Jörg Flum, and Mingjun Liu. Some remarks on the uncolored versions of the original CFI-graphs. arXiv preprint arXiv:2507.01459, 2025. doi: 10.48550/arXiv.2507.01459.
[6] George Dasoulas, Ludovic Dos Santos, Kevin Scaman, and Aladin Virmaux. Coloring graph neural networks for node disambiguation. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI-20), pages 2126–2132. Inter-
national Joint Conferences on Artificial Intelligence Organization, 2020. doi: 10.24963/ijcai.2020/294.
[7] Takashi Furuya, Maarten V. de Hoop, and Gabriel Peyré. Transformers are universal in-context learners. In International Conference on Learning Representations, pages 80820–80845, 2025. URL https://proceedings.iclr.cc/paper_files/paper/2025/hash/c9028f7874df04843e7bf435ee4cd3c3-Abstract-Conference.html.
[8] Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1263–1272. PMLR, 2017. URL https://proceedings.mlr.press/v70/gilmer17a.html.
[9] Lukas Gonon, Thilo Meyer-Brandis, and Niklas Weber. Universality and approximation rates of graph neural networks with random features. arXiv preprint arXiv:2607.26699, 2026. doi: 10.48550/arXiv.2607.26699.
[10] Mikhail Isaev, Tamás Makai, Brendan McKay, Paweł Prałat, Jane Tan, and Maksim Zhukovskii. Canonical labelling of random regular graphs. arXiv preprint arXiv:2602.17567, 2026. doi: 10.48550/arXiv.2602.17567.
[11] Charilaos I. Kanatsoulis and Alejandro Ribeiro. Counting graph substructures with graph neural networks. In International Conference on Learning Representations, pages 42023–42054, 2024. URL https://proceedings.iclr.cc/paper_files/paper/2024/hash/b7b4a06644d0747c9482c4e25646a43f-Abstract-Conference.html.
[12] Charilaos I. Kanatsoulis and Alejandro Ribeiro. Graph neural networks are more powerful than we think. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7550–7554. IEEE, 2024. doi: 10.1109/ICASSP48485.2024.10447704.
[13] Charilaos I. Kanatsoulis, Evelyn Choi, Stefanie Jegelka, Jure Leskovec, and Alejandro Ribeiro. Learning efficient positional encodings with graph neural networks. In International Conference on Learning Representations, pages 36125–36152, 2025. URL https://proceedings.iclr.cc/paper_files/paper/2025/hash/59883a1524bf58cf2dd86d0fc8d499e2-Abstract-Conference.html.
[14] Alexander S. Kechris. Classical Descriptive Set Theory, volume 156 of Graduate Texts in Mathematics. Springer, New York, 1995. doi: 10.1007/978-1-4612-4190-4.
[15] Eitan Levin, Yuxin Ma, Mateo Díaz, and Soledad Villar. On transferring transferability: Towards a theory for size generalization. In Advances in Neural Information Processing Systems, volume 38, pages 67015–67083. Curran Associates, Inc., 2025. doi:10.52202/085713-2247.
[16] Andreas Loukas. What graph neural networks cannot learn: Depth vs width. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=B1l2bp4YwS.
[17] Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4602–4609, 2019. doi:10.1609/aaai.v33i01.33014602.
[18] Christopher Morris, Yaron Lipman, Haggai Maron, Bastian Rieck, Nils M. Kriege, Martin Grohe, Matthias Fey, and Karsten Borgwardt. Weisfeiler and Leman go machine learning: The story so far. Journal of Machine Learning Research, 24(333):1–59, 2023. URL https://jmlr.org/papers/v24/22-0240.html.
[19] Robert R. Nerem, Samantha Chen, Sanjoy Dasgupta, and Yusu Wang. Graph neural networks extrapolate out-of-distribution for shortest paths. In Proceedings of the Thirty-Ninth Conference on Learning Theory, volume 336 of Proceedings of Machine Learning Research, pages 5273–5331. PMLR, 2026. URL https://proceedings.mlr.press/v336/nerem26a.html.
[20] Paolo Pellizzoni, Till Hendrik Schulz, Dexiong Chen, and Karsten Borgwardt. On the expressivity and sample complexity of node-individualized graph neural networks. In Advances in Neural Information Processing Systems, volume 37, pages 120221–120251. Curran Associates, Inc., 2024. doi: 10.52202/079017-3821.
[21] Eran Rosenbluth and Martin Grohe. Repetition makes perfect: Recurrent graph neural networks match message passing limit. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 40, pages 25168–25175, 2026. doi: 10.1609/aaai.v40i30.39707.
[22] Eran Rosenbluth, Jan Tönshoff, Martin Ritzert, Berke Kisin, and Martin Grohe. Distinguished in uniform: Self-attention vs. virtual nodes. In International Conference on Learning Representations, pages 17926–17946, 2024. URL https://proceedings.iclr.cc/paper_files/paper/2024/hash/4dffa92bf101da4f9109dbf71651047c-Abstract-Conference.html.
[23] Walter Rudin. Principles of Mathematical Analysis. McGraw-Hill, third edition, 1976.
[24] Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Random features strengthen graph neural networks. In Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), pages 333–341. SIAM, 2021. doi: 10.1137/1.9781611976700.38.
[25] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. doi: 10.1109/TNN.2008.2005605.
[26] Rolf Schneider. Convex Bodies: The Brunn-Minkowski Theory, volume 151 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, second edition, 2014. doi:10.1017/CBO9781139003858.
[27] Petar Veličković, Rex Ying, Matilde Padovano, Raia Hadsell, and Charles Blundell. Neural execution of graph algorithms. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SkgK00EtvS.
[28] Petar Veličković, Adrià Puigdomènech Badia, David Budden, Razvan Pascanu, Andrea Banino, Misha Dashevskiy, Raia Hadsell, and Charles Blundell. The CLRS algorithmic reasoning benchmark. In Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pages 22084–22102. PMLR, 2022. URL https://proceedings.mlr.press/v162/velickovic22a.html.
[29] Clément Vignac, Andreas Loukas, and Pascal Frossard. Building powerful and equivariant graph neural networks with structural message-passing. In Advances in Neural Information Processing Systems, volume 33, pages 14143–14155. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/hash/a32d7eeaae19821fd9ce317f3ce952a7-Abstract.html.
[30] Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, and Christopher Morris. Which algorithms can graph neural networks learn? In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 135232–135307. PMLR, 2026. URL https://proceedings.mlr.press/v306/wittig26a.html.
[31] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=ryGs6iA5Km.
[32] Keyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. How neural networks extrapolate: From feedforward to graph neural networks. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=UH-cmocLJC.
[33] Shengtai Yao, Eitan Levin, and Mateo Díaz. Any-dimensional invariant universality. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 147489–147513. PMLR, 2026. URL https://proceedings.mlr.press/v306/yao26f.html.
[34] Gilad Yehudai, Ethan Fetaya, Eli Meirom, Gal Chechik, and Haggai Maron. From local structures to size generalization in graph neural networks. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 11975–11986. PMLR, 2021. URL https://proceedings.mlr.press/v139/yehudai21a.html.
A ADDITIONAL FRAMEWORK DETAILS
A.1 Graphs with random node features and graph statistics
The graph with random node features is
Let denote the resulting space of graphs with node features. A graph invariant is a function on graphs that is permutation invariant (unchanged by vertex relabeling), and a graph statistic is a scalar-valued graph invariant whose input is a graph with (random) node features. For a graph statistic we refer to a single evaluation with initialization , as a trial, where the output and its law are
A.2 Message-passing neural networks
Let be a class of graphs with node features and let . A depth- MPNN initializes , where is the initial feature of node , and updates its representations for according to
In this work, we specialize the update function to
where is the coordinate-wise ReLU activation function and is a bias shared by all vertices. We consider the following aggregation schemes:
and
where the maximum and minimum are taken coordinate-wise.
Let collect the update and readout parameters, and let , and denote the corresponding classes of maps . The class is defined analogously. We assume throughout that
The constants are shared across all and layers and are independent of graph size. When a linear readout is used, we also assume .
The graph-level output uses a permutation-invariant readout chosen as part of the architecture:
We write for the network output, where denotes the initial node features.
We assume that is integrable for every .
A.3 Population approximation
For a graph statistic , its -mean is the graph invariant defined by
A.4 Uniform Lipschitzness
Proof of Lemma 1. Take the coordinate maximum norm on each hidden space and the induced matrix norm . For two initializations of the same nonempty graph, write
Mean and order-normalized sum aggregation are nonexpansive in this max-over-nodes norm. Coordinatewise max and min are also nonexpansive, since each coordinate changes by at most . For unnormalized sums on graphs of maximum degree at most , the corresponding bound is . Define empty neighborhood aggregates and the readout of the empty graph to be zero.
Let for the normalized, max, and min aggregations, and for unnormalized sums. Since ReLU is nonexpansive and the biases cancel in differences, each update satisfies
Mean pooling is nonexpansive. Composing these bounds with the final linear map gives a feature-Lipschitz constant
This constant is independent of graph size. For any other fixed norm on the input space, choose such that . Then gives uniform Lipschitzness with respect to .
Write for the diameter of the feature space. The input norm and uniform Lipschitzness are defined in Definition 2.
Uniform Lipschitzness immediately bounds the output diameter, independently of graph size.
Lemma 12 (Uniform output diameter). Let be a uniformly -Lipschitz MPNN. Then, for every graph , is supported on an interval of length at most .
Proof. For any , every nodewise difference is at most , so . Uniform L-Lipschitzness then gives . Thus the image of has diameter at most , which proves the claim.
A.5 Empirical averaging
In addition to analyzing the expressivity of the mean of random-feature MPNNs, we also consider the complexity of finite-sample estimation, which is required in practice. To estimate , draw independently initialized trials and define
For an MPNN , write . Then for every , so the number of trials affects estimation but not the represented population function.
Definition 4 (Size-uniform high-probability approximation). For a graph invariant , , , and , an MPNN size-uniformly approximates with error and failure probability at most using trials if
For the L-Lipschitz models we consider, population-level approximation (as in Definition 1) immediately gives a finite-trial high-probability approximation. The key is that the required number of samples is constant for any fixed model, and in particular independent of graph size.
Proposition 13 (Automatic finite-trial bound). Let be a graph invariant. For , suppose that is uniformly -Lipschitz and . Then, for any , the invariant size-uniformly approximates the invariant with error and failure probability at most using any number of trials satisfying
Proof. By Lemma 12, each of the independent trials averaged by lies in an interval of length at most . Hoeffding's inequality therefore yields
(11)
Thus, with probability at least , . In this case, the triangle inequality and the population approximation hypothesis give
(12)
This bound is independent of so taking the infimum over completes the proof.
A.6 Graph-pair reductions and statistical distinguishability
We also consider whether random-feature MPNNs distinguish graph pairs at the population level. For an MPNN , define its population gap on by
We say that mean-distinguishes the pair with margin if .
We next connect the population gap to empirical isomorphism testing. For a graph statistic , an -trial test for receives two independent batches
(14)
where and the entries of each batch are i.i.d. with laws and , respectively. The test returns one when it declares that the batches came from different graphs.
Definition 5 (Statistical distinguishability). For , the pair is statistically -distinguishable if there is a test such that
Thus the test must distinguish same from different in all four choices of .
For observed batches , consider the empirical-mean test
Proof of Proposition 2. By Lemma 12, the outputs on each fixed graph lie in an interval of length at most . Pairing the two batches, the empirical difference is therefore an average of independent variables with range length at most . Its mean is zero when and has absolute value at least when . An error requires a deviation of at least , so Hoeffding's inequality bounds every case by
Graph isomorphism testing will be particularly useful for bounding the power of random features. Specifically, by contraposition, a lower bound against all -trial tests implies . Finally, we can convert bounded population gap to non-universality, in the function approximation framework.
Corollary 14 (Non-universality from graph pairs). Let be a class of random-feature MPNNs. Suppose that, for some , for every there exist non-isomorphic graphs with
Then is not size-uniformly universal.
Proof. First, enumerate the isomorphism classes in and consider the graph invariant that assigns each class its index. If there is some that approximates uniformly with error strictly less than , then for and non-isomorphic, contradicting the hypothesis. Hence does not size-uniformly approximate .
B QUANTIZATION FOR SIZE-UNIFORM FUNCTION APPROXIMATION
B.1 Quantization setup
For a finite nonempty palette , fix a quantization map and define its radius by
The corresponding nodewise quantization operator is . By construction,
For , let be the covering number of . Since is compact, we may choose a palette with and take to be a nearest-point map, so that . Thus consists of i.i.d. random colors drawn from a palette of size .
To make this concrete, take , and consider rounding to a uniform grid. For , let
(21)
Let round each coordinate to the nearest point in , and abbreviate . Let
Since rounding changes each coordinate by at most , we have
Consequently,
If is uniform, then is uniform on the palette . The random-color WL results below use uniformly distributed colors.
B.2 Size-uniform quantization
For an MPNN and a finite palette , define the population predictor obtained from the quantized features by
Proposition 15 (Size-uniform quantization). Let be a uniformly -Lipschitz MPNN and let be a graph invariant. Then, for every finite nonempty ,
Proof. For every graph ,
(27)
Taking the supremum over and applying the triangle inequality completes the proof.
As a consequence, if approximates with error at most and , taking gives a predictor that uses colors with error at most . For the midpoint grid on , taking gives the explicit rate
The palette size may depend on the target, accuracy, feature space, and Lipschitz constant, but not on graph size. Let be the class of Lipschitz MPNNs with random node features supported on , and let be the subclass of random-color MPNNs as defined in Section 2.
Theorem 16 (Finite colors preserve the approximation class). The classes and uniformly approximate the same graph invariants.
Proof. One direction follows from . For the other direction, suppose that uniformly approximates , and fix . Choose whose population predictor has error at most , and let be its uniform Lipschitz constant. Choose a finite palette such that . Such a palette exists by compactness. By Proposition 15, the quantized model belongs to and approximates with error at most .
B.3 One-hot and vector color encodings
The quantization reduction uses the vectors in a finite palette as colors, while our later results use one-hot vectors for simplicity. We now compare these two representations.
An encoding of colors in a feature space is an injection . The one-hot encoding maps to the coordinate basis vector .
Let be another encoding, and let be -Lipschitz. Define its conversion error as
For a coloring , we can convert the encodings by .
If is uniformly -Lipschitz, then applying nodewise before gives a uniformly -Lipschitz model. Moreover, for i.i.d. colors drawn from any distribution on , uniform Lipschitzness gives
Proposition 17 (Encoding invariance). Fix and any distribution on . Uniformly Lipschitz MPNNs using one-hot colors and those using any injective vector encoding uniformly approximate the same graph invariants.
Proof. For a fixed finite palette, a biased ReLU network can interpolate each of the assignments and exactly. We implement the conversion using finitely many initial nodewise layers, setting in these layers. Their depth, width, and weights may depend on the encodings, but not on graph size. The conversion therefore has a graph-size-independent Lipschitz constant. Composing it with the original MPNN gives the same output for every coloring. The resulting population predictors are therefore identical, although their Lipschitz constants may differ by a factor that is independent of graph size.
Taking and to be a bijection from onto shows that the vector colors produced by quantization and their one-hot encodings have the same size-uniform approximation power.
C INDISTINGUISHABILITY WITH RANDOM FEATURES USING CFI
In this section we introduce a family of graph pairs that requires an exponential number of trials in the graph size to distinguish with a fixed number of random colors. Our construction applies beyond MPNNs to any test based on the WL patterns of these graphs. The results of Sections 2 and B convert this trial lower bound into non-universality of uniformly Lipschitz MPNNs with continuous random features for bounded graph invariants. The construction gives this obstruction on connected graphs of maximum degree eight. Adding a virtual node gives a second family of diameter two with the same trial lower bound, so non-universality holds under either restriction separately.
C.1 Random-color WL
We begin by defining random-color WL, in which graph isomorphism testing is performed by comparing the WL patterns of two graphs over independent random coloring trials. For , write . For a coloring , define the 1-WL pattern of a vertex recursively. Set
and, for , let
Here denotes adjacency and denotes a multiset. The complete 1-WL pattern of is then . The graph-level observation is the unlabeled multiset
Sample a random coloring with and define
We write for the law of .
We use the same setting as Definition 5, with WL observations in place of scalar outputs.
Definition 6 (Random-color WL distinguishability). For and , a non-isomorphic pair is statistically -distinguishable by random-color WL if there is a binary-valued, possibly randomized test satisfying the following. For every , let
be independent batches with i.i.d. entries of laws and , respectively. Then
For signed target encodings, use a nonnegative shift and a constant coordinate, and absorb the shift into the first message-passing layer.

Figure 4: The parity/CFI gadget.
The test may post-process the complete WL observations arbitrarily and is not restricted to an empirical mean. For a scalar-output MPNN and a fixed color encoding , the observation determines the network output by the standard 1-WL upper bound [31]. Thus random-color WL tests include all tests based on random-color MPNN outputs.
We now construct graph pairs whose random-color WL distributions are exponentially close in total variation for any fixed number of colors. The construction uses the parity gadget from Cai et al. [4], which we refer to as the CFI gadget. Let denote the number of colors.
C.2 The parity gadget
The CFI gadget is designed to construct graphs whose isomorphism class depends on the parity of choices made across many local structures.
The core gadget has three distinguished unordered vertex pairs
and four internal vertices
Here denotes addition modulo two. Each internal vertex is adjacent exactly to the three distinguished vertices
The central property is that endpoint swaps extend to an automorphism over the entire gadget precisely when they have even parity. Interpreting each swap as a bit flip, the third swap is therefore the XOR of the first two. This is the k = 3 case of Lemma 6.1 of Cai et al. [4].
Lemma 18 (Extension property of the parity gadget). Let , and let be the permutation of the distinguished vertices that swaps the endpoints of pair if , swaps the endpoints of pair if , and swaps the endpoints of pair if .
Then extends to an automorphism of the parity gadget if and only if
C.3 The graph pair family
We now compose the parity gadgets so that a parity choice made at any input pair can be transmitted to a single root pair.
Fix input vertex pairs
For each , attach two six-vertex blocks to the input pair as follows. Attach to all six vertices of a copy of , and attach to all six vertices of a copy of . Here is the disjoint union of two triangles and is a six-cycle. Thus the two sides of the input pair are non-isomorphic as rooted attached blocks.

Figure 5: The CFI graph pair with four input pairs . The intermediate pairs and are each shared by a child gadget and the root gadget. Shading indicates vertex roles, not random colors. The diameter-two variants are obtained by adding one virtual node adjacent to every vertex shown in each graph.
Next, build a full binary tree of parity gadgets whose leaves are the input pairs . Each internal node of the tree is one copy of the parity gadget above. We identify each child's output pair with its parent's input pair, matching superscripts. The output of the tree is a final vertex pair
Finally, attach a marker leaf to in and to in . We write when the dependence on matters. The vertex pairs, gadgets, attached blocks, and marker give
Each input endpoint has degree eight, each intermediate endpoint has degree four, and every other vertex has degree at most three. Thus both graphs are connected and have maximum degree eight. The case is shown in Figure 5. For , let be obtained from by adding a virtual node adjacent to every original vertex, including the marker. We omit when it is clear from context. Then
The graphs have diameter two. Their original vertices have degree at most nine, while has degree , so the virtual node is the unique vertex of degree greater than nine. In random-color WL, it receives an independent uniform color from the same palette as every other vertex.
C.4 Non-isomorphism
We next verify that the graphs and , obtained by attaching the marker leaf to and , respectively, are non-isomorphic.
Lemma 19. The graphs and are not isomorphic. The graphs and are also not isomorphic.
Proof. Suppose that is a graph isomorphism, and let be the marker leaf of . Since the marker and the unmarked root endpoint are the unique vertices of degrees one and two, respectively, ,
, and . The four internal vertices of the root gadget are precisely the neighbors of or other than the marker. Since preserves adjacency and maps the root pair and marker to their counterparts, it maps this four-vertex set in onto the corresponding set in . The individual internal vertices may be permuted.
For a gadget with output pair , let be its set of four internal vertices. Two distinct input vertices belong to the same pair if and only if , where denotes the neighborhood of . Since preserves this condition, it maps input pairs to input pairs, possibly interchanging the two. Such a pair is a leaf of the gadget tree exactly when its endpoints have degree eight. Otherwise, the four internal vertices of its child gadget are the neighbors of its endpoints outside . Induction from the root therefore shows that preserves the pair–gadget tree, up to permutation of sibling subtrees.
For each pair , let be its image pair and define by
Since exchanges the root endpoints, . At every input pair , the non-isomorphic and attachments force . By Lemma 18, every gadget with input pairs and output pair satisfies
This relation is unchanged when we interchange the two input pairs. We prove for every pair by induction on the height of the subtree rooted at . At height zero, is an input pair , for which . For the induction step, let be the output pair of a gadget with input pairs . Their subtrees have smaller height, so the induction hypothesis gives . Hence . Taking gives , contradicting .
Any isomorphism between and must map to , since these are their unique vertices of degree greater than nine. Deleting the virtual nodes would then give an isomorphism between and , which we have ruled out.
C.5 Block erasure
We next identify an event under which the random coloring conceals the local difference between the and attachments at an input pair. For each input pair , let be the event that both attached six-vertex blocks are monochromatic. The two blocks need not have the same color.
Since a six-vertex block is monochromatic with probability , we have
Lemma 20 (Block erasure). Let and let be a coloring for which holds. Let be obtained from by replacing the attachment at with and the attachment at with , on the same vertex sets and with all other edges unchanged. Then
Proof. At round zero, corresponding vertices have the same color in G and H, and each replaced block is monochromatic. Suppose that corresponding vertices have the same patterns at round t and that all vertices within each replaced block share a pattern. In both graphs, each block vertex has two neighbors within its block and one at the unchanged attachment endpoint. Thus, at round , corresponding block vertices have the same pattern, and all vertices within each block share a pattern. All other vertices have unchanged neighborhoods, so their patterns also agree. By induction, corresponding vertices have the same patterns at every round, and the graph-level observations are equal.
C.6 One erased input hides the root
The parity tree is designed so that concealing one input pair also conceals which root endpoint carries the marker leaf. Let be the event that at least one input block pair is erased.
Lemma 21. Conditioned on B, the random-color WL sample distributions of and are identical,
The same equality holds with and in place of and .
Proof. On , choose an erased input pair . Let be the graph formed by the parity gadgets, without the attached blocks or marker. We define an automorphism along the unique path from to in the parity-gadget tree. For each pair , set if lies on this path and otherwise, and define
Each gadget has either two incident pairs swapped or none, so its swap bits satisfy . By Lemma 18, these swaps extend to a gadget automorphism. Explicitly, on its internal vertices, set
Since the gadget maps agree on shared pairs and the gadgets have disjoint internal vertex sets, these maps define an automorphism of .
To extend to a bijection , map the marker of to that of and fix all attached blocks except those at . Exchange the two blocks at using a fixed bijection in one direction and its inverse in the other. Since , this extension preserves the marker edge. The only edges it fails to preserve are within the exchanged and blocks. For a coloring satisfying , both blocks are monochromatic. Thus Lemma 20 gives
Here assigns to each image vertex the color of its preimage.
The coloring map preserves the set of erased input pairs. If we use the same choice of for each such set, this map is reversible and gives a bijection between the colorings satisfying . This bijection preserves their uniform conditional law. Since matched colorings have identical WL observations, their laws agree conditioned on .
For the virtual-node graphs, extend each bijection by setting and carrying the color of to . This extension preserves all edges incident to the virtual node. The only remaining discrepancies are within the two exchanged monochromatic blocks. The induction in Lemma 20 still applies: each block vertex receives the additional pattern of the virtual node, and the two virtual nodes receive equal multisets of patterns from all original vertices. Thus corresponding vertices have identical patterns at every round. Since the virtual-node color is independent of , the extended coloring bijection also preserves the uniform conditional law.
C.7 Total variation and sample complexity
We now convert the root-hiding event into an upper bound on total variation and, subsequently, into a lower bound on the required number of trials.
Proposition 22 (Upper bound on CFI total variation). The random-color WL distributions of and satisfy
For fixed q, this bound is . The same bound holds for and .
Proof. By Lemma 21, the conditional laws on B agree. Since B has the same probability in both graphs,
Here denotes the complement of B, namely the event that no input block pair is erased. The events are independent because they depend on disjoint attached blocks. Therefore
The conditional-law equality in Lemma 21 and the probabilities of the events are unchanged by adding the virtual node, so the same argument proves the bound for .
Corollary 23 (Lower bound on the number of random-color WL trials). Fix and . If the pair is statistically -distinguishable by random-color WL, then
In particular, for fixed and , the required number of trials is . The same lower bound holds for , with in place of in the asymptotic statement.
Proof. By Proposition 22 and subadditivity of total variation under products, independent trials satisfy
Here denotes the joint law of independent draws from and , and denotes the joint law of independent draws from . Let and . A test with failure probability at most has expected output at most under and at least under . Consequently,
(58)
Rearranging gives the first claim. The second follows from when and are fixed. For the virtual-node pair, the same total-variation bound applies and , giving the remaining claim.
C.8 Non-universality
We now use the trial lower bound to prove non-universality for bounded graph invariants, separately on bounded-degree graphs and bounded-diameter graphs.
Corollary 24 (Non-universality from CFI pairs). The class of scalar-output uniformly Lipschitz MPNNs with uniform initialization on is not a size-uniform universal approximator for bounded graph invariants on either of the following graph classes:
(i) connected graphs of maximum degree at most eight;
(ii) graphs of diameter two.
Proof. Fix a uniformly Lipschitz model . By Proposition 15, choose a midpoint grid , with , such that quantization changes each population mean by at most , uniformly over graphs. The quantized features are uniform on the grid points. The restriction of to remains uniformly Lipschitz. By Proposition 2, a finite number of trials suffices to detect any quantized population gap of at least with failure probability at most . These tests are also random-color WL tests, and both and are independent of graph size.
Choose for the first graph class and for the second. For sufficiently large , Corollary 23 rules out statistical -distinguishability of . The quantized population gap must therefore be less than . Including the two quantization errors gives .
For the chosen graph class, define a bounded graph invariant to equal 1 on graphs isomorphic to for some and 0 otherwise. By Lemma 19 and the strictly increasing orders of each family, we have and for every . Uniform approximation to with error less than would force for every , contradicting the bound above. Thus the model class fails to uniformly approximate a bounded graph invariant on each of the two graph classes.
C.9 Colors and trials
The trial lower bound also quantifies the tradeoff between the number of colors and the number of trials.
Corollary 25 (Colors and trials). Distinguishing the CFI pair by random-color WL with success probability at least , using colors and trials per graph, requires
The same conclusion holds for with in place of .
Proof. By Corollary 23 with ,
Multiplying by and using proves the claim. For the virtual-node pair, the same trial lower bound and give the stated conclusion.
The number of colors enters this bound polynomially, whereas the number of trials enters only logarithmically. Thus, compensating for a smaller color palette can require exponentially more trials.
Conversely, one trial per graph with colors achieves success probability at least 2/3. By the union bound, both colorings are injective with probability at least . On this event, one WL refinement determines each graph up to isomorphism. Define the test to return zero if either coloring is not injective and otherwise compare the reconstructed graphs. This test satisfies the required guarantee for every . Thus polynomially many colors suffice in a single trial, whereas any fixed number of colors requires exponentially many trials by Corollary 23. For the virtual-node pair, the same injective-coloring test uses colors. Therefore this exponential separation holds both on graphs of maximum degree eight and, separately, on graphs of diameter two.
D SEPARATION FROM UNCOLORED 1-WL
Now we show that random colors strictly increase expressive power over standard uncolored 1-WL.
Proposition 26 (Random colors detect three-step returns). For arbitrarily large n, there are n-vertex graphs , that are 1-WL indistinguishable, but are separated by a depth-3, uniformly Lipschitz random-color MPNN F using two initial colors, with .
Proof. For each , set . Let and be disjoint unions of copies of and , respectively. Both graphs are 2-regular on vertices, so uncolored 1-WL yields one color class of size at every round on both graphs. Thus, the graphs are 1-WL indistinguishable.
Define the normalized neighbor-averaging operator by
and set at isolated vertices. Write for three successive applications of this operator. For initial features , set
The MPNN stores signed values through their positive and negative parts and performs normalized neighbor averaging. In the third layer, it computes the absolute value using . Normalized averaging is nonexpansive in the max-over-nodes norm, and the final average does not introduce any dependence on . Thus is uniformly 2-Lipschitz.
Let each vertex receive an independent uniform color . The identity for and gives
Let be the probability that a length-3 random walk from returns to . The centered colors are independent with zero mean, so all terms with are zero in expectation, while . Therefore,
On , this probability is at every vertex, as the walk can go around its triangle in one of the two directions. On , it is 0, since is bipartite and a walk of odd length cannot return to its starting vertex. Thus and , giving .
By Proposition 2, this constant population gap yields statistical distinguishability using a constant number of trials.
E INCOMPARABILITY WITH HIGHER-ORDER WL
We now compare random-color MPNNs with higher-order WL, using statistical distinguishability as defined in Definition 6. Under the convention stated in the main text, k-WL colors ordered k-tuples of vertices. Initially, a tuple's color records equality and adjacency among its entries. For an update, each vertex w gives a list of k colors: those of the tuples obtained by replacing the first entry by w, then the second, and so on. The new color records the old color and the multiset of these lists over all vertices w.
Theorem 27 (Incomparability with higher-order WL). For every :
-
some k-WL-indistinguishable pair is distinguished with success probability greater than 2/3 by a uniformly 1-Lipschitz two-color MPNN with order-normalized sum aggregation using one random-color trial per graph;
-
for every fixed , some pair distinguished by 2-WL, and hence by -WL, is not statistically -distinguishable by random-color WL, and hence cannot be distinguished with the same guarantee by any -color MPNN using trials.
Proof. Random colors beat k-WL. Choose connected, non-isomorphic CFI graphs , on vertices, each of degree three, that are k-WL equivalent [4, Theorem 5.2 and Corollary 6.5]. Forget their colors; this preserves k-WL equivalence and non-isomorphism [5, Corollary 7.11]. Attach a path to each original vertex , adding new vertices, and denote the resulting graphs by , , of order . Each original vertex now has degree four, while the added vertices have degree one or two. Any isomorphism between the new graphs would therefore map original vertices to original vertices, giving an isomorphism between and . Thus the new graphs remain non-isomorphic.
We verify directly that attaching these paths also preserves k-WL equivalence. Consider a tuple , where is an original vertex and is a position on its attached path. We claim that after iterations its color is determined by the path positions and the color of after iterations on the original graph. Initially, the original tuple color records which coincide and which are adjacent. Together with the path positions, this determines equality and adjacency in the new tuple: edges either join consecutive positions on the same path or adjacent original vertices at position zero.
For the induction step, every replacement vertex has the form . Consider the tuples obtained by replacing each entry in turn with . By induction, their list of colors is determined by the corresponding list using in the original graph, together with the path positions. The next original WL color records its current color and the multiset of these lists over all . Repeating this for each accounts for every replacement in the new graph, proving the claim. Since the original graphs have identical tuple-color counts at every iteration, the new graphs do too, for each choice of path positions. Hence and remain -WL equivalent.
Independent uniform binary features give the original vertices independent uniform identifiers , with
We compute these identifiers directly with an order-normalized sum MPNN. Aggregating a constant-one channel at u gives on these graphs; multiplying by the fixed constant N recovers the degree. We mark the degree-one path tips and propagate this indicator to neighbors for t rounds, retaining previously reached vertices. The vertex is first reached by this propagated indicator at round , so the first arrival time identifies its path position. In particular, the original vertices are exactly those first reached at round t, so they can identify themselves. Each vertex u then stores a binary matrix , whose entry indicates that color has been observed at path position j. Initialize all matrices to zero, then at each added vertex in position j with color i, set entry to one. For rounds, each added vertex combines its own and its neighbors' matrices entrywise by logical OR (computed by summing and clipping at one), while original vertices keep their matrices zero. Every added vertex then learns its path's complete matrix. One further aggregation delivers this matrix to the original vertex through its unique path neighbor. Its other neighbors are original vertices and contribute zero. The matrix thus determines .
Next, original vertices exchange one-hot encodings of their identifiers, with added vertices sending zero. Each original vertex encodes its incident original edges in a matrix whose rows and columns are indexed by the possible identifiers. In the row indexed by its own identifier, it places a one in each column corresponding to a neighbor's identifier; all other entries are zero. Added vertices contribute zero matrices. When identifiers are distinct, mean pooling followed by multiplication by gives the original graph's adjacency matrix in these identifier coordinates. Pooling the one-hot identifiers alongside the matrices also gives the number of vertices with each identifier. On the finite set of possible pooled inputs, a ReLU MLP can represent any function exactly. We choose it to accept precisely when distinct identifiers occur, and the graph encoded on those identifiers is isomorphic to . A collision leaves fewer than occupied identifiers and is rejected. The resulting Boolean output satisfies precisely on collision-free inputs, and always.
All the Boolean operations above have exact ReLU implementations. The required neighbor sums are obtained by multiplying the order-normalized sums by the fixed constant .
By Lemma 1 and Lipschitzness of the fixed ReLU readout, this network has a finite size-uniform Lipschitz bound . Divide its output by to obtain a uniformly 1-Lipschitz network, without changing equality comparisons between outputs. The architecture depends on the chosen pair; this is not a single size-uniform recognition algorithm. Writing for the unscaled output, declare the two inputs the same exactly when their independent single-trial outputs agree. The worst-case success probability is .
2-WL beats every fixed random-color budget. Use from Section C, with input pairs and a perfect binary parity tree. The marker is the unique degree-one vertex, so 2-WL recognizes it. Let be the graph obtained by deleting the marker. The pair colors reveal whether a replacement vertex is the marker, so 2-WL can recover its refinement on by omitting this vertex from the updates.
2-WL distinguishes the attachments by their triangle counts: in , each vertex of a attachment lies in three triangles, whereas each vertex of a attachment lies in two. This separates the input endpoints consistently in both graphs. Once a gadget's inputs are distinguished, its internal vertices count their superscript-0 input neighbors, so its output endpoints see the distinct count multisets and . Since 2-WL refines ordinary color refinement, these distinctions propagate through successive parity gadgets up the tree, distinguishing the root endpoints . The marker's attachment to or then distinguishes the two graphs.
For fixed and , choose large enough that . Then Corollary 23 rules out statistical -distinguishability. For , every block pair is erased, so Lemmas 20 and 21 give identical 1-WL observations for every trial count. The same indistinguishability bound extends to MPNNs.
F SUBGRAPH ISOMORPHISM FOR TREES
We now adapt the color-coding algorithm of Alon et al. [2] to a random-color MPNN. Specifically, we show that for any rooted tree there exists a random-color MPNN that can decide at each vertex of a given graph if a copy of is rooted at , using a number of layers, hidden dimension size, and number of trials independent of the size of . In this section, we use the MPNN architecture with coordinatewise max aggregation and binary vertex outputs.
First we show that even graph-level detection is impossible for standard MPNNs.
Proposition 28. No MPNN with identical initial vertex features can decide whether an arbitrary graph contains a simple path of length three.
Proof. The graphs and are both 2-regular on six vertices, so they are 1-WL indistinguishable and yield identical outputs under any such MPNN. However, contains a simple path of length three, whereas does not.
Let be a colored graph with . A set of vertices is colorful if all vertices in have different colors. For a graph , a colorful subgraph embedding is an injective edge-preserving map such that is colorful. The embedded subgraph need not be an induced subgraph.
Let be a rooted tree. For a vertex , let denote the subtree of with root .
Lemma 29 (Colorful tree subgraph isomorphism). Let be a rooted tree with vertices. There is an MPNN that can determine, for each vertex of a colored graph with , whether there is a colorful subgraph embedding of mapping its root to , with hidden dimension and message-passing layers.
Proof. We use a dynamic program to find colorful subgraph embeddings of T. We first describe the dynamic program and prove its correctness. We then show that this dynamic program can be implemented on an MPNN.
Let be the root of . The dynamic program iteratively adds edges to the graph using a post-order traversal from the root ; whenever it visits a nonroot node, it adds the edge connecting that node to its parent. At iteration , let denote the spanning subgraph of with all edges added so far, and let denote the subtree of at node , following edges away from . We use a dynamic programming table with entries corresponding to , where denotes the power set of . The dynamic programming table will store True/False corresponding to
There is a colorful subgraph embedding
from the subtree to G
such that and .
(66)
Clearly, there is a colorful embedding from T to G mapping r to v if and only if is True.
The base case of the dynamic program consists of singleton trees. For all vertices and nodes , we set the entry as is the only node in the subtree . All other entries at iteration zero are False.
Let be the edge added at iteration , where is the child and is the parent. We only need to update the dynamic programming table entries corresponding to , since the subtrees at all other nodes remain the same.
where denotes disjoint union. For , set . As a sketch of why this is correct, observe that any colorful embedding of with will have to map to a neighbor of , so it can be decomposed as embeddings of and . If we can guarantee embeddings of these trees rooted at and exist, and their images have disjoint color sets, then this implies they can be combined to an embedding of rooted at (the images won't share nodes as they have different colors). Induction over the added edges proves correctness.
We now argue that message passing can achieve this. We initialize node features as one-hot vectors in corresponding to node colors . Our hidden vectors between iterations will be of size ; after iteration , the node feature will correspond to the dynamic programming table entry . Accordingly, we index our node features by for and . Our MPNN will then have if and otherwise. Here indexes dynamic-programming iterations, each implemented by a constant number of MPNN layers.
Initially, we apply a linear encoding layer that sets for all nodes , with all other entries zero. Our message-passing updates will be of the form
(68)
where the maximum is coordinatewise, and is a ReLU MLP. At isolated vertices, set .
We will repeatedly make use of the fact that a two-layer ReLU MLP can implement a threshold function with the property that for and for .
Each iteration will then correspond to adding an edge to the tree. Max aggregation gives iff
\begin{aligned}&f_{i}\left(\boldsymbol{h}_{v}^{(i-1)},\boldsymbol{m}_{v}^{(i)}\right)[p,S]\\&=f\Bigg(\sum_{S=S^{\prime}\sqcup S^{\prime \prime}}\mathrm{ReLU}\Big(\boldsymbol{h}_{v}^{(i-1)}[p,S^{\prime}]\Big.\\&\quad\left.+\boldsymbol{m}_{v}^{(i)}[a,S^{\prime \prime}]-1\Big)\Bigg).\\ \end{aligned} \tag{69}
Thus, this entry is 1 iff there exists such that and are true for some neighbor of . This can be implemented by a three-layer ReLU MLP with hidden dimension . The first layer takes the sum of and , subtracts 1, and applies ReLU, storing it in an intermediate feature . This feature is 1 iff both inputs are 1. The final two layers sum up over all choices of and take a threshold. These two layers set neighbor weights to zero, and copy all entries for unchanged through the self-update.
After iterations, the vertex output is 1 iff a colorful copy of is rooted at , and 0 otherwise. Including initialization, the construction uses layers and hidden dimension , with parameters depending only on .
Theorem 30 (Random-color MPNN for rooted tree detection). Let be a rooted tree with vertices. There is a random-color MPNN using initial colors, hidden dimension , and message-passing layers, using max aggregation and binary vertex outputs, with the following guarantee. For every graph and vertex , one random-color trial accepts at only if contains a copy of rooted at . If such a copy exists, then one trial accepts at with probability at least
Consequently, for any , running
independent trials and accepting at v when its average binary output is positive (equivalently, when any trial accepts at v) decides whether G contains a copy of T rooted at v with false-positive probability 0 and false-negative probability at most for each v.
Proof. Use the colored MPNN from Lemma 29 with color set [k]. In one random-color trial, each vertex of G receives an independent uniform color from [k], and the colored MPNN checks at each v for a colorful copy of T rooted at v. If the trial accepts at v, then the detected colorful copy is in particular an uncolored copy of T rooted at v, so there are no false positives.
Fix v such that G contains a copy of T rooted at v, and fix one such copy. The k vertices of this copy receive distinct colors with probability . On this event, the fixed copy is colorful, so the colored MPNN accepts at v. Thus one trial accepts at v with probability at least . For s independent trials, the false-negative probability at v is at most
Participation in any role follows by running all choices of the pattern root in parallel and taking the maximum at each vertex, with the same asymptotic resource bounds.
Corollary 31 (Tree subgraph detection). For every tree and , max-over-nodes readout in Theorem 30 detects whether a graph contains a subgraph isomorphic to , with the same resource and trial bounds, no false positives, and false-negative probability at most .
Proof. Root T arbitrarily and take the maximum over vertex outputs in each trial. A positive graph contains a fixed copy rooted at some vertex, whose miss probability is at most ; a negative graph has no positive vertex outputs. For the empty graph, set the readout to zero.
Corollary 32 (Detecting simple paths). For every , there is a random-color MPNN that detects whether a graph contains a simple path of length , meaning a path with edges and vertices, using initial colors, hidden dimension , and message-passing layers. One trial has no false positives and accepts with probability at least
whenever such a path exists. Hence, for any ,
independent trials give false-positive probability 0 and false-negative probability at most .
Proof. Apply Corollary 31 to the path tree on vertices.
G A LOCAL MST EDGE TASK
We next consider a local task for computing MST edges. Let be a simple graph with edge weights , where is a fixed finite ordered alphabet. We aim to identify edges that uniquely minimize the weight across a cut with . For , this is exactly the set of edges occurring in every MST (or every minimum spanning forest if is disconnected).
An edge belongs to every MST if and only if it is the unique minimum-weight edge crossing some cut. The cut, however, may have many vertices on both sides. We therefore consider a local version of this task, identifying only edges whose membership in every MST can be established by a cut with fewer than k vertices on one side.
Fix an integer , and let denote the edges with exactly one endpoint in . This constrained edge set is
(75)
To identify edges in , we look for a small component separated from the opposite endpoint after removing the candidate edge and all heavier edges. For , define
and let denote the connected component of in . If the endpoints are separated, is uniquely lightest across the boundary of either component. A component with fewer than vertices therefore gives the required cut. Conversely, any qualifying set contains the component of its endpoint. Hence,
We use the edge-feature extension of message passing: messages may depend on the sender's state and a fixed encoding of the edge weight. Coordinatewise max aggregation and updates implement the filters below using the initial colors, which are retained in the node states. The edge decoder is a shared ReLU MLP of the form , where are the final endpoint embeddings. An empty maximum is taken to be zero.
The next proposition shows that random colors allow a random color MPNN to compute this task for constant .
Proposition 33 (Finite-color local Kruskal edge detection). Fix an integer , a finite ordered alphabet , and . There is a finite-color edge-output MPNN, using a constant number of independent random-color trials, such that for every weighted graph with weights in , the random output satisfies
The number of colors, number of trials, and depth depend only on , and , not on .
Proof. Fix . In one random trial, assign each vertex an independent uniform color
For each and , write
(80)
Thus, retains edges of weight at most , except weight- edges with endpoint colors . An edge selects the channel and . This channel deletes , but may also delete other edges with the same weight and endpoint colors.
Run message-passing rounds in each channel, maintaining the finite state
the set of colors seen within distance at most t from v in . Initialize
and update by
We encode each color subset by its indicator vector. The union update is then a coordinatewise OR, which we implement using max aggregation and fixed ReLU updates. All channels are stored in the same node state. To implement the filter, group incoming messages by the sender's initial color and the edge weight, take coordinatewise maxima within each group, and select the groups allowed by the receiver's initial color and the channel. These selections are finite Boolean operations and can be implemented by fixed ReLU updates. The number of channels depends only on q and , not on .
After rounds, set
(84)
For an edge , the desired decision rule uses its selected channel and accepts in one trial if
To implement this rule from the sum of endpoint embeddings, retain the initial one-hot color and all indicators and bits in each final node state. The summed color coordinates determine the unordered endpoint colors, including the case of equal colors, and hence select the channel together with . The summed coordinate is positive exactly when at least one endpoint has . The two sets differ exactly when some summed indicator coordinate equals one. On inputs in , the ReLU function
is the indicator of this event. Taking the Boolean OR over these coordinates and the conjunction with the condition gives the decision rule. Channel selection and these Boolean operations are exactly implementable by a fixed ReLU MLP applied to and the encoded edge weight. Its width and depth depend only on . The final network accepts an edge when the average of its independent binary trial outputs is positive, equivalently when any trial accepts it.
Fix an edge . For each endpoint , choose if ; otherwise, choose a connected -vertex set containing . Set , so . These sets depend on , not on the random colors.
Suppose that the colors on W are all distinct. The selected channel is a subgraph of , and it retains every edge of with both endpoints in W: the only vertices of W with colors and are u and v, and e is already absent.
from . Here we use that is simple. If , the channel therefore preserves the whole component, so is its color set and . If , the connected set lies within distance at most from in the channel, so at least distinct colors are seen and .
Consequently, if both endpoint components are large, the decoder rejects. If they are the same small component, their color sets agree, and the decoder again rejects. If they are different and at least one is small, their color sets differ: two small components have disjoint color sets, while a large component contributes at least k colors. Thus the decoder is correct whenever the colors on W are distinct. This event has probability at least
where denotes the falling factorial. Therefore, after independent trials, each target edge is missed with probability at most , and each non-target edge is falsely accepted with probability at most .
Set . Choose large enough that , then choose so that , and finally increase , if necessary, so that
Then each target edge is missed with probability at most , and each non-target edge is falsely accepted with probability at most . Markov's inequality applied to the two error counts yields failure probability at most . If either edge class is empty, its error count is identically zero.
Theorem 34 (Deterministic obstruction for the local Kruskal task). Let and let . There is a connected weighted graph on ten vertices, with weights in , such that no deterministic uncolored MPNN with identical initial vertex features and an edge-weight-aware symmetric edge decoder computes .
Proof. Take two disjoint copies of , subdivide one edge in each copy, and join the two new subdivision vertices by an edge (Figure 6). Give every edge weight 1.
Every vertex of H has degree three. Since the initial vertex features are identical and every edge has the same weight, induction on the message-passing layers shows that all vertex states remain identical. Thus, any symmetric edge decoder receives the same endpoint states and edge weight for every edge.
However, is a bridge whose removal leaves two components of size , so . Every other edge lies on a cycle of weight-1 edges, so none uniquely minimizes any cut. Consequently, no deterministic uncolored MPNN with an edge-weight-aware symmetric decoder computes on this graph.

5 vertices
5 vertices
Figure 6: Counterexample in Theorem 34. Every vertex has degree three and every edge has weight 1. The highlighted edge is the only bridge; deleting it leaves two five-vertex components. Thus for .
H EXPRESSIVITY HIERARCHIES FOR COLORS AND TRIALS
Corollary 25 shows that colors and trials can have very different quantitative effects. We now show that increasing either resource strictly increases expressivity, i.e., the ability to distinguish non-isomorphic graphs with high probability. To do that, we use statistical -distinguishability by random-color WL as defined in Definition 6, i.e., a test receives s independent trials per graph with q uniform colors and has failure probability at most for each of the four input pairs.
Specifically, we show the two hierarchy results regarding the number of colors and trials, respectively:
Theorem 35 (Strict hierarchy in the number of trials). For every integer , there are non-isomorphic finite graphs , that are -distinguishable by random-color WL, but are not statistically -distinguishable.
Ignoring the last trial gives the corresponding non-strict inclusion. The theorem shows that two colors suffice, which is optimal. For colors, we compare budgets of at most colors, i.e., the test may choose a uniform palette of size , fixed across all its trials.
Theorem 36 (Strict hierarchy in the number of colors). For every pair of integers , there are non-isomorphic finite graphs that are statistically -distinguishable by random-color WL, but are not statistically -distinguishable for any .
Hence, for every fixed number of trials, increasing the allowed palette size strictly enlarges the set of distinguishable graph pairs. We prove both theorems using one graph class. In each trial, the observation either conceals the graph identity or determines it exactly. We then carefully choose the construction parameters so that the optimal failure probability crosses when one trial or one color is added.
H.1 Construction of the graph class
Let be prime, and create the following disjoint union of cycles
Both graphs are 2-regular on vertices. The following results show that 1-WL distinguishes them unless both graphs are monochromatic.
Lemma 37. Two colored copies of and are indistinguishable by 1-WL if and only if both are monochromatic in the same color. If a root is added to each graph and joined to every block vertex, the resulting colored graphs are indistinguishable if and only if the blocks are monochromatic in the same color and the two roots have the same initial color.
Proof. Suppose that the colored blocks are indistinguishable, and run color refinement on their disjoint union. For each stable color , let be its multiplicity in and let be its multiplicity in the triangular component of . Every stable color occurring in either graph occurs in both. Let be the number of neighbors of color of a vertex of color .
The quotient on stable colors is connected because is connected. A color occurring in the triangle brings all its neighboring colors into the triangle, so for every stable color . For distinct adjacent colors, counting edges gives
Hence, the fraction is constant on the connected quotient. Summing the multiplicities gives . Since is prime and , every positive is divisible by . As , there is only one stable color. Both blocks are therefore monochromatic in the same initial color. Conversely, equally colored monochromatic 2-regular graphs of the same order have identical WL colors.
In the rooted graphs, the roots have degree and the block vertices have degree three. Under indistinguishability, the two roots therefore have the same stable color. Removing their common contribution from the block vertices' neighbor multisets leaves the same argument. The converse follows by a standard induction over the refinement rounds.
We next use these blocks to distinguish the endpoints of a parity gadget. Fix input pairs , , and a root pair . Add an edge within every pair. For each input , attach to and to , joining each endpoint to every vertex of its block. For , write
Create one internal vertex for each such vector, with neighborhood
Finally, define , for , by attaching one marker leaf to . Note that each graph has vertices. For fixed , set .
The following results show that 1-WL can recover the structural role of .
Lemma 38 (Structural roles). The complete WL observation of identifies the input endpoints, block vertices, internal vertices, root endpoints, and marker leaf. For every , an input endpoint's structure after rounds determines the t-round WL observation of its attached block in isolation. The endpoint also identifies its pair partner through their pair edge. These statements hold for every initial coloring.
Proof. We first look at the vertex degrees of the different structural roles in the graph :
| Role | Degree |
|---|---|
| marker leaf | |
| block vertex | |
| internal vertex | |
| unmarked root | |
| marked root | |
| input endpoint | . |
The degrees are distinct for and , so one 1-WL round can identify such structures. Each input endpoint has exactly one input-endpoint neighbor (i.e., the partner), and, by construction, its block neighbors are precisely its neighbors of degree 3.
For a colored graph , abbreviate its full structures by . Let be the structure obtained by running 1-WL inside the block containing the vertex . We prove by induction that determines for every block vertex . The base case holds because . The structure records its own structure and those of its neighbors. Because , each neighbor pattern determines the neighbor's degree. Retaining exactly the neighbors of degree 3 and applying the induction hypothesis implies
These are exactly the neighbors inside the block. An input endpoint's pattern then gives the multiset of structures over every vertex of its attached block.
We now show that swapping the endpoints propagates through the gadget.
Lemma 39 (Parity extension). Consider the parity gadget before adding the blocks and marker. Swapping the endpoints of when and of when extends to an automorphism of the gadget if and only if
Proof. Let ; the input neighbors force to map to . Its root edge is preserved exactly when
This is equivalent to the stated condition. When it holds, the map preserves every edge. Permuting input pairs also preserves the gadget and does not change this condition.
In addition, we can show that the graphs and are non-isomorphic.
Lemma 40 (Non-isomorphism). For every prime and , the graphs and are not isomorphic.
Proof. An isomorphism must preserve the roles in Lemma 38 and map the marked root in to in . Moreover, an isomorphism also maps input-pair edges to input-pair edges and preserves the subgraph induced by each endpoint's degree-three neighbors. Since is connected and is disconnected, it cannot exchange the two endpoint types. It may therefore permute input pairs but cannot swap their endpoints. By Lemma 39, it cannot swap the root endpoints either, leading to a contradiction.
H.2 Erasure and the trial law
In one trial, assign every vertex an independent uniform color from [q]. Hence, a block is monochromatic with probability . For input i, let be the event that both attached blocks are monochromatic while their colors need not agree. By the above, these events are independent and have probability
Let
and
We call input erased when occurs. For fixed , write for the probability law of .
Lemma 41. For , the conditional WL observation laws on agree, whereas the conditional laws on have disjoint supports. Moreover, the observation also determines whether or occurred. Consequently, there are mutually singular probability laws such that, for ,
For , the two trial laws agree and .
Proof. We first show that one erased input hides the graph identity. Fix a coloring of in , and choose the least erased index . On the same vertex sets, we replace the block at by and the block at by . Therefore, each replaced block is monochromatic, has vertices, and is 2-regular internally. At every refinement round, all vertices of such a block have the same structure, determined by two copies of its preceding structure and the structure of its endpoint. A straightforward structural induction therefore shows that these replacements preserve the full WL observation.
The resulting graph is isomorphic to , i.e., swap the endpoints of and , send to , exchange the two blocks at input , and fix all other inputs and blocks. Here is the vector with its only nonzero coordinate at . We now map every vertex color along this isomorphism, including the colors on the internal vertices, endpoints, and marker. We then choose the block bijections in inverse pairs. This defines an involution between the two copies of , i.e., it preserves every event and hence the least erased index. Also, all colorings have the same probability, so the map preserves the conditional uniform law on . The coupled observations agree. The least erased index is used only to define this map on labeled colorings, i.e., the observer need not recover it.
Next, because the degree-three neighbor patterns retain their initial colors, two WL rounds determine whether an endpoint's own block is monochromatic. In the first round, the same information about its unique input-endpoint neighbor. Thus the complete observation determines the existence of an erased input and hence the event E.
It remains to recover the graph identity on . The color partition on the disjoint union of two colored -vertex blocks stabilizes within rounds. By Lemma 37, the -round observation therefore identifies the type of any nonmonochromatic block. By Lemma 38, an endpoint's full structure after rounds determines this observation. On , every input has at least one nonmonochromatic block. Its type determines the endpoint's superscript. That is, if the other block is monochromatic, the pair edge gives its endpoint the complementary superscript. Thus, after rounds, every input endpoint's pattern determines its superscript, without recovering the input index.
After one further round, determines the number of its input neighbors with superscript one and hence . All internal neighbors of have parity . Since degree identifies the marked root, its pattern after rounds determines . The two conditional supports on are therefore disjoint. Since is observable, they are also disjoint from the common conditional support on . This gives the decomposition. When , every input is erased, and the same coupling proves equality of the deterministic observations.
H.3 Optimal failure probability
The decomposition makes the optimal error depend only on the probability that both batches reveal their graph identities.
Proposition 42. Suppose that, for ,
where are mutually singular probability laws. Among randomized tests using two independent batches of s i.i.d. observations, the smallest worst-case failure probability for deciding whether their generating graph identities agree is
The worst case ranges over all four ordered choices from , indexed by their graph identities.
Proof. Mutual singularity makes the three alternatives observable. A batch reveals its identity if it contains an observation from or , an event of probability . If both batches reveal their identities, compare them and answer correctly. Otherwise, flip an independent fair coin. This test has failure probability in each of the four input cases.
For the lower bound, put the uniform prior on the four ordered pairs of graph identities. If a batch contains only observations from Q, its identity remains an independent uniform bit conditional on both observed batches. Unless both identities are revealed, their equality therefore has conditional probability 1/2. Every test has average failure probability at least under this prior, and its worst-case failure probability is at least its average. This proves optimality.
Set . The proposition gives
(96)
For the constructed pair, use when . For , the trial laws agree, so the optimal failure probability is , also given by the formula at .
H.4 Strict hierarchies
We are now ready to prove the two hierarchy results. We begin by proving the hierarchy results on the number of trials.
Proof of Theorem 35. Fix , and set
Then . Choose a prime sufficiently large that, with ,
Let be the smallest positive integer such that . The second inequality ensures . Minimality gives
Thus . By Equation (96), trials per graph achieve failure probability at most , whereas every test with trials has worst-case failure probability greater than . Take and . By Lemma 40, they are non-isomorphic, which gives the claim.
We now give the hierarchy results for the number of colors.
Proof of Theorem 36. Fix , and set
For a prime , put and choose
When , we have , so
(99)
For , the same strict inequality holds because . Since is nondecreasing in , every palette size gives optimal failure probability greater than with trials per graph.
On the other hand, , and Bernoulli's inequality gives
(100)
As tends to infinity through the primes, the last expression tends to one. Choose sufficiently large that it exceeds . By Equation (96), colors and trials per graph then give failure probability at most . Taking and proves the claim.
I REPRESENTATION SPACES FOR MESSAGE-PASSING NETWORKS
We fix an aggregation scheme . All measures below are finite Borel measures. Graphs are finite and nonempty; for mean, max, and min aggregation, we assume that every vertex has a nonempty neighborhood.
I. 1 Metrics on measures and compact sets
Let be a compact metric space. Write for the nonnegative measures on with total mass at most one, and for the probability measures on . For , define the bounded-Lipschitz metric
The bound on makes this expression finite even when the measures have different total masses.
Let denote the collection of nonempty compact subsets of . Its Hausdorff metric is
I. 2 Iterated representation spaces
Set and . Given , define the neighborhood space
equipped with
Define
For normalized-sum and mean aggregation, these are spaces of iterated degree measures: each representation records the initial feature together with measures on lower-depth representations. For max and min aggregation, we replace measures with compact neighborhood sets.
I. 3 Induced representations and pseudometrics
For a graph with initialization , set and recursively define
where
Here is the Dirac probability measure at . The normalized-sum measure has mass , the mean measure has mass one, and the neighborhood sets are finite and nonempty. Thus .
The induced pseudometric on rooted attributed graphs is
It is a pseudometric because distinct rooted attributed graphs may have identical representations.
For graph-level representations, define
The induced graph-level pseudometric is
where the Wasserstein distance uses the ground metric .
The induced representation maps are continuous, hence Borel measurable, by induction on depth using the continuity of the finite measure and neighborhood-set constructions. So their laws under random initialization are well defined.
J COMPACTNESS OF THE REPRESENTATION SPACES AND LIPSCHITZ PROPERTY
This section collects the compactness and Lipschitz properties of the deterministic representation framework used in our analysis. We recall the relevant results and refer to Wittig et al. [30] for the underlying arguments. We develop the extension to random initialization in the next appendix.
J.1 Compactness of Representation Spaces
Compactness of the representation spaces follows inductively from compactness of the initial feature space ; each successive space is a product of the preceding space and a space of neighborhood measures or compact sets. The following lemma provides the compactness properties needed for this construction.
Lemma 43. If is a compact metric space, then and are compact under , and is compact under .
Proof. For complete proofs, see [30, Theorems 96 and 98]. For the spaces of measures, compactness follows from the compactness and metrizability of the weak* topology together with the fact that the Kantorovich metric metrizes this topology; see [14], Theorem 17.22, and [3], Theorem 8.3.2. For , compactness with respect to the Hausdorff metric follows from the Blaschke selection theorem; see [26, Theorem 1.8.4].
Corollary 44. For every , is a compact metric space.
J.2 Lipschitzness of MPNNs
Set . For , define
where
The maximum and minimum are taken coordinate-wise.
The map realizes the MPNN on the structural representation space. The following identity, obtained by induction on , shows that the structural representation contains all information required to compute the node output. Consequently, Lipschitz bounds for transfer directly to the MPNN under the induced pseudometric.
Lemma 45. For every initialization x, vertex v, and depth ,
Proof. We prove the result by induction on . For , we have
Now suppose that , for every vertex . For , we write . Then, by definition of ,
By the induction hypothesis, the first term inside the activation is
It remains to identify the aggregation term. By construction of , applying to this neighborhood representation recovers the corresponding aggregation of the depth- hidden states. Indeed, for the sum and mean cases, integration against the induced atomic measure gives the required weighted sum of
which, by the induction hypothesis, equals the corresponding sum or mean of . For ,
and the same argument gives, for ,
with maxima and minima taken coordinate-wise. Thus, in every case, is exactly the neighborhood aggregate appearing in the definition of the message-passing update. Hence
This completes the induction.
Lemma 46. Let satisfy and . For ,
For ,
The same bounds hold for minimum aggregation.
Proof. For each unit vector , the scalar function has uniform norm at most and Lipschitz constant at most . After scaling by , it is an admissible test function in Equation (101); the zero case is immediate. Taking the supremum over unit vectors proves the first bound. The second follows from .
For each coordinate , Hausdorff proximity gives
Summing the squared coordinate bounds yields the factor . Since , each coordinate of has absolute value at most , proving its norm bound. Replacing by proves the claims for minimum aggregation.
Combining these aggregation bounds with the 1-Lipschitz property of ReLU yields recursive bounds on the magnitude and Lipschitz constant of each layer. We denote these bounds by and , respectively; the resulting recursions provide an explicit Lipschitz certificate for the final readout. Write
Initialize and . The bias contributes to the magnitude bound but cancels in differences of updates. For normalized-sum and mean aggregation, define
For max and min aggregation, define
Proposition 47 (Boundedness and Lipschitz continuity). For every ,
Consequently, has Lipschitz certificate .
Proof. The statement trivially holds at depth zero. Suppose it holds at depth . ReLU is 1-Lipschitz and satisfies . For and ,
Apply Lemma 46 to the second term. The resulting coefficients of and are bounded by . Their sum is therefore at most . The norm estimates in the same lemma give . This completes the induction. Composition with the linear readout gives the final assertions.
Since , , , and the architecture is fixed, these recursions yield uniform finite bounds
where we may choose . The constants do not depend on graph order.
K RANDOMLY INITIALIZED REPRESENTATIONS
We now extend the compactness and Lipschitz properties to representation laws induced by random node initialization. The resulting domain is totally bounded under the Wasserstein distance and therefore admits finite covers at every positive scale. Taking expectations of the MPNN outputs yields predictors on this domain that retain the deterministic Lipschitz certificates established above.
K.1 Compactness of the probability-measure domain
Lemma 48. If is compact, then is compact.
Proof. We assume , since otherwise the claim is immediate. By Lemma 43, every sequence in has a weakly convergent subsequence. It remains to show that weak convergence implies convergence in . Fix and let
The functions in are uniformly bounded by and equicontinuous. Since is also closed under uniform convergence, it is compact in the uniform norm by Arzelà–Ascoli [23, Theorem 7.25]. Now suppose converges weakly to . Given , choose a finite -net of . Kantorovich–Rubinstein duality then gives
The maximum tends to zero by weak convergence, and can be chosen arbitrarily small. Hence . Every sequence therefore has a -convergent subsequence, which proves compactness.
Applying this lemma to shows that is compact. Its subset need not be compact, but it is totally bounded (i.e., admits a finite -cover for every ).
K.2 Expected outputs and Lipschitzness
For , define
These laws are well defined by the measurability established in Section I.3. Moreover, is the mean of the random measure , in the sense that
for every bounded measurable .
By Lemma 45,
The boundedness of permits exchanging expectation and the finite vertex sum, giving
For and any coupling ,
Thus, averaging preserves the certificate , with Lipschitz continuity now measured with respect to on probability measures and absolute value on scalar outputs. The same argument gives
On graphs without specified initializations, define
This is a pseudometric, and
Relabeling a graph permutes its node representations and preserves the i.i.d. initialization law. Hence and are invariant under vertex relabeling.
L UNIFORM MONTE CARLO APPROXIMATION
Fix training graphs and write . For each graph, the initializations are independent and have law . The following argument is conditional on the training graphs and does not require them to form a cover. Dependence between node representations within an initialization is allowed.
Let . By Equation (104),
where and depend only on the fixed architecture, feature space, and weight and bias bounds. Thus, is uniformly bounded and equicontinuous on the compact space . Arzelà–Ascoli ([23, Theorem 7.25]) implies total boundedness in the uniform norm. For , let
with covering centers chosen in . The class is separable in the uniform norm, and the sampling deviation is continuous in this norm, so its supremum over is measurable.
Proposition 49 (Uniform sampling bound). For every ,
Proof. Choose an -net of , with , and define
For fixed , these variables are independent over , belong to , and satisfy
Hoeffding's inequality gives
A union bound makes this estimate simultaneous over all , with failure probability at most .
For any , choose such that . Replacing by changes its sampled graph-level average by at most and its expectation by at most . Hence, on the simultaneous event,
for every and .
Taking and , a sufficient sample size is
With probability at least , this ensures
Since , averaging over the training graphs yields
The same bound holds for the regularized losses because their regularizers coincide.
M PROOF OF LEARNABILITY GUARANTEE
Below we prove Theorem 11 from the main paper. For fixed training graphs , we recall the definitions
We also write
Note that and use the same regularizer since the Lipschitz certificate only depends on the parameters of the MPNN and not on the initialization of node features.
Proof. Fix and , and set
By total boundedness of , choose a finite -net . For every , there is an index such that . The triangle inequality and the Lipschitz bounds give
Choose
By the uniform Monte Carlo bound proved in Section L, every satisfying Equation (105) gives an event of probability at least on which
On this event, any with satisfies
Consequently,
| Split | |||
|---|---|---|---|
| Train | |||
| Validation | |||
| Test | |||
| Test | |||
| Test |
Table 2: Bridge datasets: graph count / positive-edge count.
N EXPERIMENTAL DETAILS
Computing infrastructure. Experiments ran on a shared server using three NVIDIA RTX A6000 GPUs (48 GB each) and two AMD EPYC 7452 32-core CPUs. We used PyTorch 2.9.1 with CUDA 12.8, running each training fit on a single GPU and independent fits in parallel.
Asset licenses. The GNN-RNI repository providing EXP includes a GNU GPLv3 license, with no separate dataset license stated. The pinned k-gnn and random-features (TRIANGLE) releases contain no explicit license statement. Our reproduction scripts fetch third-party code and data directly from these repositories.
N.1 Bridge prediction
Data and targets. We sample graphs from , allowing disconnected graphs. Training and validation each contain equal numbers of graphs at ; independent test splits use . For each target , an edge is positive exactly when it is a bridge whose removal leaves a smaller endpoint component of size ; every other edge is negative, including bridges of other sizes. We retain every sampled graph and extend splits to obtain at least 1,000 training positives and 200 per evaluation split (Table 2). All palettes and training seeds share the data for their target.
Model and training. Each trial assigns independent uniform colors from , encoded as one-hot vectors padded to 32 coordinates for every palette. The six-layer, width-32 ReLU MPNN uses max aggregation and a symmetric two-layer edge head, with 22,305 trainable parameters in every condition. Training averages 16 sigmoid-probability trials before class-balanced binary cross-entropy over pooled edges. We sample graphs uniformly with replacement in batches of eight and use Adam at without weight decay for 100,000 updates, without early stopping. We select checkpoints by lowest validation balanced error. Each target and palette uses five training seeds, varying initialization, minibatches, and training colors.
Evaluation and reporting. Test inference averages 16 fresh trials and thresholds at 1/2; validation and test color streams are fixed and shared across fits. FNR pools positive edges across test graphs, while FPR pools all negative edges, including wrong-size bridges. Figure 2 reports balanced accuracy, , and Table 3 reports its complementary error. Standard errors (SEs) equal the sample standard deviation across five training seeds divided by , conditional on the fixed dataset. Table 4 exposes confusion hidden by pooled balanced error: at , FPRs on side-5 and side-7 bridges are and , and precision is , despite balanced error. The learned detectors are motivated by the local MST construction but do not implement its algorithm.
N.2 Tree substructure detection
Data and exact labels. The fixed ten-vertex pattern has a root with three children and two leaves per child. In a simple 3-regular graph, it embeds as a non-induced subgraph rooted at exactly when the closed two-hop ball around has ten vertices; edges between the six leaves are allowed. We sample connected random 3-regular graphs on 24 vertices, rejecting isomorphic duplicates within and across splits. We use 256 training, 64 validation, and 1,000 test graphs, with 4,096, 1,024, and 16,000 selected root vertices, respectively, balanced exactly by label within each split. Graphs are split before roots are selected; models receive full graphs, and all fits share the splits. Evaluation tests unseen graphs of the same size.
Table 3: Exact-side bridge detection: balanced test error (%), mean SE across five training seeds.
| Colors | ||||
|---|---|---|---|---|
| 4 | 2 | |||
| 4 | 4 | |||
| 4 | 16 | |||
| 4 | 32 | |||
| 5 | 2 | |||
| 5 | 4 | |||
| 5 | 16 | |||
| 5 | 32 | |||
| 6 | 2 | |||
| 6 | 4 | |||
| 6 | 16 | |||
| 6 | 32 |
Table 4: Neighboring-side false-positive rates and overall precision (%) at , averaged over five training seeds. Bridges of sizes and are negatives for target ; precision is the fraction of predicted positives with the correct label.
| Colors | Side FPR | Side FPR | Precision | |
|---|---|---|---|---|
| 4 | 2 | 54.08 | 38.79 | 42.29 |
| 4 | 4 | 27.96 | 10.87 | 61.67 |
| 4 | 16 | 0.97 | 4.65 | 90.60 |
| 4 | 32 | 0.39 | 1.79 | 93.18 |
| 5 | 2 | 87.38 | 93.02 | 11.91 |
| 5 | 4 | 67.23 | 68.02 | 29.65 |
| 5 | 16 | 23.15 | 43.40 | 43.61 |
| 5 | 32 | 6.78 | 26.17 | 56.69 |
| 6 | 2 | 93.47 | 94.72 | 8.18 |
| 6 | 4 | 87.83 | 98.18 | 8.75 |
| 6 | 16 | 83.62 | 95.15 | 10.24 |
| 6 | 32 | 70.47 | 92.81 | 13.50 |
Model and training. We use two width-32 residual ReLU message-passing layers with max aggregation and a vertex MLP, without graph pooling. Independent uniform one-hot colors are projected to the hidden space; hidden widths are fixed, but the input projection grows with the palette. We train all combinations of colors and trials with five training seeds. The models have 5,345, 5,537, and 7,329 trainable parameters for , respectively, independent of trial count. Training uses binary cross-entropy on each root's maximum trial logit, fresh colors, and Adam at without weight decay. Each update samples 32 roots per class with replacement. We allow up to 200,000 updates, stopping after 25,000 updates without improved validation max-trial cross-entropy, assessed every 250 updates. We select the checkpoint minimizing this loss.
Inference and reporting. Let be the logit at vertex in trial , and let denote the sigmoid function. At inference, we sum trial probabilities and predict
Thus, a vertex is predicted to have the maximum two-hop neighborhood size of ten exactly when its summed score exceeds the threshold ; otherwise it is predicted negative. We choose separately for each trained model to minimize validation classification error and hold it fixed on the test set. Evaluation color streams are fixed across training seeds. Figure 3 reports mean node accuracy SE across five seeds on the fixed, balanced test set; Table 5 retains individual errors, including the variation at . These learned detectors do not implement the exact color-coding dynamic program or require colorful witnesses.
| Seed 0 | Seed 1 | Seed 2 | Seed 3 | Seed 4 | ||
|---|---|---|---|---|---|---|
| 2 | 1 | 46.45 | 46.52 | 46.44 | 46.52 | 46.52 |
| 2 | 16 | 38.17 | 39.46 | 41.93 | 41.02 | 42.89 |
| 2 | 64 | 36.00 | 36.77 | 37.01 | 36.94 | 36.19 |
| 8 | 1 | 36.86 | 37.64 | 37.10 | 37.89 | 37.44 |
| 8 | 16 | 10.71 | 14.26 | 11.60 | 12.11 | 11.02 |
| 8 | 64 | 2.96 | 25.66 | 1.30 | 2.31 | 15.18 |
| 64 | 1 | 30.64 | 28.21 | 31.44 | 28.51 | 28.04 |
| 64 | 16 | 10.01 | 7.89 | 3.30 | 18.70 | 8.47 |
| 64 | 64 | 0.09 | 0.86 | 0.32 | 0.48 | 1.41 |
Table 5: Tree detection test error (%) for each training seed, with colors and trials. All models use the same 16,000 labeled roots on 1,000 unseen graphs.
N.3 Inference-time quantization
EXP data and model. We use the released EXP dataset [1]: 1,200 graphs on 32–64 vertices, in 600 oppositely labeled, 1-WL-indistinguishable pairs. The released ten-fold splits contain 972 training, 108 validation, and 120 test graphs per fold, with balanced labels and pairs kept together. This is held-out classification, not size extrapolation. Our GCN-RNI reimplementation uses eight width-64 mean-neighbor layers, separate root transforms, ELU, max graph pooling, and an MLP classifier. Inputs are 64 independent Unif coordinates, or one followed by 63 zeros, keeping the architecture fixed at 72,354 trainable parameters. Original vertex labels are not inputs.
EXP training. We use Adam at , batches of 20, negative log-likelihood, and 500 epochs, with one fresh feature draw per prediction and final checkpoints. We follow the paper's ELU rather than the released script's tanh default, and use its Gaussian-input learning rate because no separate uniform-input rate is reported.
TRIANGLE data and model. The released TRIANGLE data [24] contain 1,000 20-vertex 3-regular training graphs and 1,000 test graphs at each of 20 and 100 vertices. Labels indicate triangle membership, with original class frequencies retained. Following rGIN, we use four width-64 layers with sum aggregation including the root, MLP updates, batch normalization, ReLU, and a vertex classifier, totaling 30,930 trainable parameters. We replace its 100-value random scalar with a fresh independent Unif[0, 1) scalar per vertex; no other vertex features are supplied.
TRIANGLE training. We train one model for 17,500 Adam updates (350 epochs), with batches of 32 graphs and learning rate 0.01, halved every 50 epochs. We retain the upstream cross-entropy on softmax outputs, weighted inversely by class frequency. Training uses one trial per prediction; evaluation uses the final checkpoint without test-based selection.
Frozen-model evaluation. Continuous and quantized conditions share feature draws and test graphs, with weights and batch-normalization statistics fixed. We average metrics from single-trial predictions, not predictions across trials. EXP quantizes each active coordinate to or according to its sign; each fold averages argmax classification accuracy over 50 draws. We report mean accuracy and descriptive SE across ten fold means, whose training sets overlap. TRIANGLE uses and reports mean one-versus-rest ROC-AUC over both classes. Its mean and SE use ten paired feature draws of one trained model, not multiple training seeds. Both SEs are sample SD divided by . The exploratory palette sweep in Figure 7 shows close agreement with continuous inputs for , with nonmonotonic behavior at smaller palettes.


Figure 7: TRIANGLE inference-time quantization of one frozen rGIN trained with continuous features on 20-vertex cubic graphs. Test sets contain 1,000 graphs at each size. Points and error bars show mean ROC-AUC ± SE across ten paired single-trial feature draws; squares and dashed lines mark the continuous baseline. The axis break omits 51–86% ROC-AUC. These error bars do not measure training-seed variability.
CONTENTS
1 Introduction 1
2 Formal Framework 3
2.1 Randomized MPNNs 3
2.2 Size-uniform approximation 3
2.3 Colors, trials, and distinguishability 4
3 Expressivity Bounds 5
3.1 From continuous features to random colors 5
3.2 Non-universality and trial lower bounds 5
3.3 Colors and trials 5
3.4 Comparison with Weisfeiler–Leman 6
4 Algorithmic Applications 6
4.1 Tree subgraph detection 6
4.2 Local MST edge detection 7
5 Learnability of Randomized GNNs 7
6 Experiments 7
7 Conclusions 8
A Additional Framework Details 12
A.1 Graphs with random node features and graph statistics 12
A.2 Message-passing neural networks 12
A.3 Population approximation 13
A.4 Uniform Lipschitzness 13
A.5 Empirical averaging 13
A.6 Graph-pair reductions and statistical distinguishability 14
B Quantization for Size-Uniform Function Approximation 15
B.1 Quantization setup 15
B.2 Size-uniform quantization 16
B.3 One-hot and vector color encodings 16
C Indistinguishability with Random Features Using CFI 17
C.1 Random-color WL 17
C.2 The parity gadget 18
C.3 The graph pair family 18
C.4 Non-isomorphism ..... 19
C.5 Block erasure ..... 20
C.6 One erased input hides the root ..... 20
C.7 Total variation and sample complexity ..... 21
C.8 Non-universality ..... 22
C.9 Colors and trials ..... 22
D Separation from Uncolored 1-WL ..... 23
E Incomparability with Higher-Order WL ..... 24
F Subgraph Isomorphism for Trees ..... 25
G A Local MST Edge Task ..... 28
H Expressivity Hierarchies for Colors and Trials ..... 30
H.1 Construction of the graph class ..... 31
H.2 Erasure and the trial law ..... 33
H.3 Optimal failure probability ..... 33
H.4 Strict hierarchies ..... 34
I Representation Spaces for Message-Passing Networks ..... 35
I.1 Metrics on measures and compact sets ..... 35
I.2 Iterated representation spaces ..... 35
I.3 Induced representations and pseudometrics ..... 36
J Compactness of the Representation Spaces and Lipschitz Property ..... 36
J.1 Compactness of Representation Spaces ..... 36
J.2 Lipschitzness of MPNNs ..... 37
K Randomly Initialized Representations ..... 39
K.1 Compactness of the probability-measure domain ..... 39
K.2 Expected outputs and Lipschitzness ..... 39
L Uniform Monte Carlo Approximation ..... 40
M Proof of Learnability Guarantee ..... 41
N Experimental details ..... 42
N.1 Bridge prediction ..... 42
N.2 Tree substructure detection ..... 42
N.3 Inference-time quantization ..... 44