SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\mathrm {I d} _ {\mathrm {A W}} \left(w _ {0}, W\right) = \left| \left\{u _ {1}, u _ {2}, \dots , u _ {k ^ {*}} \right\} \right| \text {w h e r e} k ^ {*} \text {i s t h e s m a l l e s t i n d e x s u c h s u t h a t} u _ {k ^ {*}} = w _ {0}. \tag {10}
$$
While this method is a simple anonymization process, it misses the correlation between different walks and assigns new node identities based on only one single walk. The correlation between different walks is more important in temporal networks to assign new node identities, as a single walk cannot capture the frequency of a pattern over time [33]. To this end, Wang et al. [33] design a set-based anonymization process that assigns new node identities based on a set of sampled walks. Given a vertex  $u$ , they sample  $M$  walks with length  $m$  starting from  $u$  and store them in  $S_{u}$ . Next, for each node  $w_{0}$  that appears on at least one walk in  $S_{u}$ , they assign a vector to each node as its hidden identity [33]:
$$
g \left(w _ {0}, S _ {u}\right) [ i ] = \left| \left\{W \mid W \in S _ {u}, W [ i ] = w _ {0} \right\} \right| \quad \forall i \in \{0, \dots , m \}, \tag {11}
$$
where  $W[i]$  shows the  $i$ -th node in the walk  $W$ . This anonymization process not only hides the identity of vertices but it also can establish such hidden identity based on different sampled walks, capturing the correlation between several walks starting from a vertex.
Both of these anonymization processes are designed for graphs with pair-wise interactions, and there are three main challenges in adopting them for hypergraphs: ① To capture higher-order patterns, we use SETWALKs, which are a sequence of hyperedges. Accordingly, we need an encoding for the position of hyperedges. A natural attempt to encode the position of hyperedges is to count the position of hyperedges across sampled SETWALKs, as CAW [33] does for nodes. However, this approach misses the similarity of hyperedges with many nodes in common. That is, given two hyperedges  $e_1 = \{u_1, u_2, \ldots, u_k\}$  and  $e_2 = \{u_1, u_2, \ldots, u_k, u_{k+1}\}$ . Although we want to encode the position of these two hyperedges, we also want these two hyperedges to have almost the same encoding as they share many vertices. Accordingly, we suggest viewing a hyperedge as a set of vertices. We first encode the position of vertices, and then we aggregate the position encodings of nodes that are connected by a hyperedge to compute the positional encoding of the hyperedge. ② However, since we focus on undirected hypergraphs, the order of a hyperedge's vertices in the aggregation process should not affect the hyperedge positional encodings. Therefore, we need a permutation invariant pooling strategy. ③ While several existing studies used simple pooling functions such as MEAN(.) or SUM(.) [26], these pooling functions do not capture the higher-order dependencies between obtained nodes' position encodings, missing the advantage of higher-order interactions. That is, a pooling function such as MEAN(.) is a non-parametric method that sees the positional encoding of each node in a hyperedge separately. Therefore, it is unable to aggregate them in a non-linear manner, which, depending on the data, can miss information. To address challenges ② and ③, we design SETMIXER, a permutation invariant pooling strategy that uses MLPs to learn how to aggregate positional encodings of vertices in a hyperedge to compute the hyperedge positional encoding.
A.2 Random Walk on Hypergraphs
Chung [98] presents some of the earliest research on the hypergraph Laplacian, defining the Laplacian of the  $k$ -uniform hypergraph. Following this line of work, Zhou et al. [18] defined a two-step CE-based random walk-based Laplacian for general hypergraphs. Given a node  $u$ , in the first step, we uniformly sample a hyperedge  $e$  including node  $u$ , and in the second step, we uniformly sample a node in  $e$ . Following this idea, several studies developed more sophisticated (weighted) CE-based random walks on hypergraphs [20]. However, Chitra and Raphael [40] shows that random walks on hypergraphs with edge-independent node weights are limited to capturing pair-wise interactions, making them unable to capture higher-order information. To address this limitation, they designed an edge-dependent sampling procedure of random walks on hypergraphs. Carletti et al. [37] and Carletti
et al. [99] argued that to sample more informative walks from a hypergraph, we must consider the degree of hyperedges in measuring the importance of vertices in the first step. Concurrently, some studies discuss the dependencies among hyperedges and define the  $s$ -th Laplacian based on simple walks on the dual hypergraphs [41, 100]. Finally, more sophisticated random walks with non-linear Laplacians have been designed [23, 101-103].
SetWALKs addresses three main drawbacks from existing methods: ① None of these methods are designed for temporal hypergraphism so they cannot capture temporal properties of the network. Also, natural attempts to extend them to temporal hypergraphs and let the walker uniformly walk over time ignore the fact that recent hyperedges are more informative than older ones (see Table 2). To address this issue, SetWALK uses a temporal bias factor in its sampling procedure (Equation 1). ② Existing hypergraph random walks are unable to capture either higher-order interactions of vertices or higher-order dependencies of hyperedges. That is, random walks with edge-independent weights [37] are not able to capture higher-order interactions and are equivalent to simple random walks on the CE of the hypergraph [40]. The expressivity of random walks on hypergraphs with edge-dependent walks is also limited when we have a limited number of sampled walks (see Theorem 1). Finally, defining a hypergraph random walk as a random walk on the dual hypergraph also cannot capture the higher-order dependencies of hyperedges (see Appendix C and Appendix D). SetWALK by its nature is able to walk over hyperedges (instead of vertices) and time and can capture higher-order interactions. Also, with a structural bias factor in its sampling procedure, which is based on hyperedge-dependent node weights, it is more informative than a simple random walk on the dual hypergraph, capturing higher-order dependencies of hyperedges. See Appendix C for further discussion.
A.3 MLP-Mixer
MLP-Mixer [44] is a family of models, based on multi-layer perceptions (MLPs), that are simple, amenable to efficient implementation, and robust to long-term dependencies (unlike RNNs, attention mechanisms, and Transformers [83]) with a wide array of applications from computer vision [104] to neuroscience [105]. The original architecture is designed for image data, where it takes image tokens as inputs. It then encodes them with a linear layer, which is equivalent to a convolutional layer over the image tokens, and updates their representations with a sequence of feed-forward layers applied to image tokens and features. Accordingly, we can divide the architecture of MLP-Mixer into two main parts: ① Token Mixer: The main intuition of the token mixer is to clearly separate the cross-location operations and learn the cross-feature (cross-location) dependencies. ② Channel Mixer: The intuition behind the channel mixer is to clearly separate the per-location operations and provide positional invariance, a prominent feature of convolutions. In both Mixer and SetMixer we use the channel mixer as designed in MLP-Mixer. Next, we discuss the token mixer and its limitation in mixing features in a permutation variant manner:
Token Mixer. Let  $\mathbf{E}$  be the input of the MLP-Mixer, then the token mixer phase is defined as:
$$
\mathbf {H} _ {\text {t o k e n}} = \mathbf {E} + \mathbf {W} _ {\text {t o k e n}} ^ {(2)} \sigma \left(\mathbf {W} _ {\text {t o k e n}} ^ {(1)} \operatorname {L a y e r N o r m} (\mathbf {E}) ^ {T}\right) ^ {T}, \tag {12}
$$
where  $\sigma(.)$  is nonlinear activation function (usually GeLU [80]). Since it feeds the input's columns to an MLP, it mixes the cross-feature information, which results in the MLP-Mixer being sensitive to permutation. Although natural attempts to remove the token mixer or its linear layer can produce a permutation invariant method, it misses cross-feature dependencies, which are the main motivation for using the MLP-Mixer architecture. To address this issue, SETMIXER uses the Softmax(.) function over features. Using Softmax over features can be seen as cross-feature normalization, which can capture their dependencies. While Softmax(.) is a non-parametric method that can bind token-wise information, it is also permutation equivariant, and as we prove in Appendix E.3, makes the SETMIXER permutation invariant.
B.1 Learning (Multi)Set Functions
(Multi)set functions are pooling architectures for (multi)sets with a wide array of applications in many real-world problems including few-shot image classification [106], conditional regression [107], and causality discovery [108]. Zaheer et al. [97] develop DEEPSETs, a universal approach to parameterize
the (multi)set functions. Following this direction, some works design attention mechanisms to learn multiset functions [109], which also inspired Baek et al. [110] to adopt attention mechanisms designed for (multi)set functions in graph representation learning. Finally, Chien et al. [25] build the connection between learning (multi)set functions with propagations on hypergraphs. To the best of our knowledge, SETMIXER is the first adaptive permutation invariant pooling strategy for hypergraphs, which views each hyperedge as a set of vertices and aggregates node encodings by considering their higher-order dependencies.
B.2 Simplicial Complexes Representation Learning
Simplicial complexes can be considered a special case of hypergraphs and are defined as a collection of polytopes such as triangles and tetrahedra, which are called simplices [111]. While these frameworks can be used to represent higher-order relations, simplicial complexes require the downward closure property [112]. That is, every substructure or face of a simplex contained in a complex  $\mathcal{K}$  is also in  $\mathcal{K}$ . Recently, to encode higher-order interactions, representation learning on simplicial complexes has attracted much attention [6, 113-119]. The first group of methods extend node2vec [67] to simplicial complexes with random walks on interactions through Hasse diagrams and simplex connections inside  $p$ -chains [113, 115]. With the recent advances in message-passing-based methods, several studies focus on designing neural networks on simplicial complexes [116-119]. Ebli et al. [116] introduced Simplicial neural networks (SNN), a generalization of spectral graph convolution, to simplicial complexes with higher-order Laplacian matrices. Following this direction, some works propose simplicial convolutional neural networks with different simplicial filters to exploit the relationships in upper- and lower-neighborhoods [117, 118]. Finally, the last group of studies use an encoder-decoder architecture as well as message-passing to learn the representation of simplicial complexes [114, 120].
$\mathsf{CAT - WALK}$  is different from all these methods in three main aspects: ① Contrary to these methods,  $\mathsf{CAT - WALK}$  is designed for temporal hypergraphs and is capable of capturing higher-order temporal properties in a streaming manner, avoiding the drawbacks of snapshot-based methods. ②  $\mathsf{CAT - WALK}$  works in the inductive setting by extracting underlying dynamic laws of the hypergraph, making it generalizable to unseen patterns and nodes. ③ All these methods are designed for simplicial complexes, which are special cases of hypergraphs, while  $\mathsf{CAT - WALK}$  is designed for general hypergraphs and does not require any assumption of the downward closure property.
B.3 How Does CAT-WALK Differ from Existing Works? (Contributions)
As we discussed in Appendix A.2, existing random walks on hypergraphs are unable to capture either ① higher-order interactions between nodes or ② higher-order dependencies of hyperedges. Moreover, all these walks are for static hypergraphs and are not able to capture temporal properties. To this end, we design SETWALK a higher-order temporal walk on hypergraphs. Naturally, SETWALKs are capable of capturing higher-order patterns as a SETWALK is defined as a sequence of hyperedges. We further design a new sampling procedure with temporal and structural biases, making SETWALKs capable of capturing higher-order dependencies of hyperedges. To take advantage of complex information provided by SETWALKs as well as training the model in an inductive manner, we design a two-step anonymization process with a novel pooling strategy, called SETMIXER. The anonymization process starts with encoding the position of vertices with respect to a set of sampled SETWALKs and then aggregates node positional encodings via a non-linear permutation invariant pooling function, SETMIXER, to compute their corresponding hyperedge positional encodings. This two-step process lets us capture structural properties while we also care about the similarity of hyperedges. Finally, to take advantage of continuous-time dynamics in data and avoid the limitations of sequential encoding, we design a neural network for temporal walk encoding that leverages a time encoding module to encode time as well as a MIXER module to encode the structure of the walk.
C SETWALK and Random Walk on Hypergraphs
We reviewed existing random walks in Appendix A.2. Here, we discuss how these concepts are different from SETWALKs and investigate whether SETWALKs are more expressive than these methods.
As we discussed in Sections 1 and 3.2, there are two main challenges for designing random walks on hypergraphs: ① Random walks are a sequence of pair-wise interconnected vertices, even though
edges in a hypergraph connect sets of vertices. ② A sampling probability of a walk on a hypergraph must be different from its sampling probability on the CE of the hypergraph [37-43]. To address these challenges, most existing works on random walks on hypergraphs ignore ① and focus on ② to distinguish the walks on simple graphs and hypergraphs, and ① is relatively unexplored. To this end, we answer the following questions:
Q1: Can ② alone be sufficient to take advantage of higher-order interactions? First, semantically, decomposing hyperedges into sequences of simple pair-wise interactions (CE) loses the semantic meaning of the hyperedges. Consider the collaboration network in Figure 1. When decomposing the hyperedges into pair-wise interactions, both  $(A,B,C)$  and  $(H,G,E)$  have the same structure (a triangle), while the semantics of these two structures in the data are completely different. That is,  $(A,B,C)$  have all published a paper together, while each pair of  $(H,G,E)$  separately have published a paper. One might argue that although the output of hypergraph random walks and simple random walks on the CE might be the same, the sampling probability of each walk is different and with a large number of samples, our model can distinguish these two structures. In Theorem 1 (proof in Appendix E) we theoretically show that when we have a finite number of hypergraph walk samples,  $M$ , there is a hypergraph  $\mathcal{G}$  such that with  $M$  hypergraph walks, the  $\mathcal{G}$  and its CE are not distinguishable. Note that in reality, the bottleneck for the number of sampled walks in machine learning-based methods is memory. Accordingly, even with tuning the number of samples for each dataset, the size of samples is bounded by a small number. This theorem shows that with a limited budget for walk sampling, ② alone is not enough to capture higher-order patterns.
Q2: Can addressing ① alone be sufficient to take advantage of higher-order interactions? To answer this question, we use the extended version of the edge-to-vertex dual graph concept for hypergraphs:
Definition 4 (Dual Hypergraph). Given a hypergraph  $\mathcal{G} = (\mathcal{V},\mathcal{E})$ , the dual hypergraph of  $\mathcal{G}$  is defined as  $\tilde{\mathcal{G}} = (\tilde{\mathcal{V}},\tilde{\mathcal{E}})$ , where  $\tilde{\mathcal{V}} = \mathcal{E}$  and a hyperedge  $\tilde{e} = \{e_1,e_2,\ldots ,e_k\} \in \tilde{\mathcal{E}}$  shows that  $\bigcap_{i = 1}^{k}e_{i}\neq \emptyset$ .
To address ①, we need to see walks on hypergraphs as a sequence of hyperedges (instead of a sequence of pair-wise connected nodes). One can interpret this as a hypergraph walk on the dual hypergraph. That is, each hypergraph walk on the dual graph is a sequence of  $\mathcal{G}$ 's hyperedges:  $e_1 \to e_2 \to \dots \to e_k$ . However, as shown by Chitra and Raphael [40], each walk on hypergraphs with edge-independent weights for sampling vertices is equivalent to a simple walk on the (weighted) CE graph. To this end, addressing ② alone can be equivalent to sample walks on the CE of the dual hypergraph, which misses the higher-order interdependencies of hyperedges and their intersections.
Based on the above discussion, both ① and ② are required to capture higher-order interaction between nodes as well as higher-order interdependencies of hyperedges. The definition of SETWALKs (Definition 3) with structural bias, introduced in Equation 1, satisfies both ① and ②. In the next section, we discuss how a simple extension of SETWALKs can not only be more expressive than all existing walks on hypergraphs and their CEs, but its definition is universal, and all these methods are special cases of extended SETWALK.
C.1 Extension of SETWALKs
Random walks on hypergraphs are simple but less expressive methods for extracting network motifs, while SETWALKs are more complex patterns that provide more expressive motif extraction approaches. One can model the trade-off of simplicity and expressivity to connect all these concepts in a single notion of walks. To establish a connection between SETWALKs and existing walks on hypergraphs, as well as a universal random walk model on hypergraphs, we extend SETWALKs to  $r$ -SETWALKs, where parameter  $r$  controls the size of hyperedges that appear in the walk:
Definition 5 ( $r$ -SETWALK). Given a temporal hypergraph  $\mathcal{G} = (\mathcal{V}, \mathcal{E}, \mathcal{X})$ , and a threshold  $r \in \mathbb{Z}^+$ , a  $r$ -SETWALK with length  $\ell$  on temporal hypergraph  $\mathcal{G}$  is a randomly generated sequence of hyperedges (sets):
where  $e_i \in \mathcal{E}$ ,  $|e_i| \leq r$ ,  $t_{e_{i+1}} < t_{e_i}$ , and the intersection of  $e_i$  and  $e_{i+1}$  is not empty,  $e_i \cap e_{i+1} \neq \emptyset$ . In other words, for each  $1 \leq i \leq \ell - 1$ :  $e_{i+1} \in \mathcal{E}^{t_i}(e_i)$ . We use Sw[i] to denote the  $i$ -th hyperedge-time pair in the SETWALK. That is, Sw[i][0] =  $e_i$  and Sw[i][1] =  $t_{e_i}$ .
The only difference between this definition and Definition 3 is that  $r$ -SETWALK limits hyperedges in the walk to hyperedges with size at most  $r$ . The sampling process of  $r$ -SETWALKs is the same as that of SETWALK (introduced in Section 3.2 and Appendix D), while we only sample hyperedges with size at most  $r$ . Now to establish the connection of  $r$ -SETWALKs and existing walks on hypergraphs, we define the extended version of the clique expansion technique:
Definition 6 (r-Projected Hypergraph). Given a hypergraph  $\mathcal{G} = (\mathcal{V},\mathcal{E})$  and an integer  $r\geq 2$ , we construct the (weighted)  $r$ -projected hypergraph of  $\mathcal{G}$  as a hypergraph  $\hat{\mathcal{G}}_r = (\mathcal{V},\hat{\mathcal{E}}_r)$ , where for each  $e = \{u_{1},u_{2},\ldots ,u_{k}\} \in \mathcal{E}$ :
1. if  $k \leq r$ : add  $e$  to the  $\hat{\mathcal{E}}_r$ ,
2. if  $k \geq r + 1$ : add  $e_i = \{u_{i_1}, u_{i_2}, \ldots, u_{i_r}\}$  to  $\hat{\mathcal{E}}_r$ , for every possible  $\{i_1, i_2, \ldots, i_r\} \subseteq \{1, 2, \ldots, k\}$ .
Each of steps 1 or 2 can be done in a weighted manner. In other words, we approximate each hyperedge with a size of more than  $r$  with  $\binom{k}{r}$  (weighted) hyperedges with size  $r$ . For example, when  $r = 2$ , the 2-projected graph of  $\mathcal{G}$  is equivalent to its clique expansion, and  $r = \infty$  is the hypergraph itself. Furthermore, we define the Union Projected Hypergraph (UP hypergraph) as the union of all  $r$ -projected hypergraphs, i.e.,  $\mathcal{G}^* = (\mathcal{V}, \bigcup_{r=2}^{\infty} \hat{\mathcal{E}}_r)$ . Note that the UP hypergraph has the downward closure property and is equivalent to the simplicial complex representation of the hypergraph  $\mathcal{G}$ . The next proposition establishes the universality of the  $r$ -SETWALK concept.
Proposition 2. Edge-independent random walks on hypergraphs [37], edge-dependent random walks on hypergraphs [40], and simple random walks on the CE of hypergraphs are all special cases of  $r$ -SETWALK, when applied to the 2-projected graph, UP hypergraph, and 2-projected graph, respectively. Furthermore, all the above methods are less expressive than  $r$ -SETWALKs.
The proof of this proposition is in Appendix E.5.
D Efficient Hyperedge Sampling
For sampling SETWALKs, inspired by Wang et al. [33], we use two steps: ① Online score computation: we assign a set of scores to each incoming hyperedge. ② Iterative sampling: we use assigned scores in the previous step to sample hyperedges in a SETWALK.
Algorithm 1 Online Score Computation
Input: Given a hypergraph  $\mathcal{G} = (\mathcal{V},\mathcal{E})$  and  $\alpha \in [0,1]$   
Output: A probability score for each vertex  
1:  $P\gets \emptyset$   
2: for  $(e,t)\in \mathcal{E}$  with an increasing order of  $t$  do  
3:  $P_{e,t}[0]\gets \exp (\alpha t)$   
4:  $P_{e,t}[1]\gets 0,P_{e,t}[2]\gets 0,P_{e,t}[3]\gets \emptyset$   
5: for  $u\in e$  do  
6: for  $e_n\in \mathcal{E}^t (u)$  do  
7: if  $e_n$  is not visited then  
8:  $P_{e,t}[2]\gets P_{e,t}[2] + \exp (\varphi (e_n,e))$   
9:  $P_{e,t}[3]\gets P_{e,t}[3]\cup \{\exp (\varphi (e_n,e))\}$   
10:  $P_{e,t}[1]\gets P_{e,t}[1] + \exp (\alpha \times t_n)$   
return  $P$
Online Score Computation. The first part essentially works in an online manner and assigns each new incoming hyperedge  $e$  a four-tuple of scores:
$$
P _ {e, t} [ 0 ] = \exp (\alpha \times t),
$$
$$
P _ {e, t} [ 1 ] = \sum_ {(e ^ {\prime}, t ^ {\prime}) \in \mathcal {E} ^ {\prime} (e)} \exp \left(\alpha \times t ^ {\prime}\right)
$$
$$
P _ {e, t} [ 2 ] = \sum_ {(e ^ {\prime}, t ^ {\prime}) \in \mathcal {E} ^ {\prime} (e)} \exp \left(\varphi (e, e ^ {\prime})\right),
$$
$$
P _ {e, t} [ 3 ] = \left\{\exp \left(\varphi \left(e, e ^ {\prime}\right)\right) \right\} _ {\left(e ^ {\prime}, t ^ {\prime}\right) \in \mathcal {E} ^ {\prime} (e)}
$$
Iterative Sampling. In the iterative sampling algorithm, we use pre-computed scores by Algorithm 1 and sample a hyperedge  $(e,t)$  given a previously sampled hyperedge  $(e_p,t_p)$ . In the next proposition,
Algorithm 2 Iterative SETWALK Sampling
Input: Given a hypergraph  $\mathcal{G} = (\mathcal{V},\mathcal{E}),\alpha \in [0,1]$  , and previously sampled hyperedge  $(e_p,t_p)$    
Output: Next sampled hyperedge  $(e,t)$    
1: for  $(e,t)\in \mathcal{E}^{t_p}(e_p)$  with an decreasing order of  $t$  do   
2: Sample  $b\sim$  UNIFORM(0, 1);   
3: Get  $P_{e,t}[0],P_{e,p,t_p}[1],P_{e_p,t_p}[2]$  and  $\varphi (e,e_p)$  from the output of Algorithm 1;   
4:  $\mathcal{P}\gets$  Normalize  $\frac{P_{e,t}[0]}{P_{e p,t_p}[1]}\times \frac{\exp(\varphi(e,e_p))}{P_{e p,t_p}[2]};$    
5: if  $b <   \mathcal{P}$  then return  $(e,t)$  return  $(e_X,t_X)$  ..  $\triangleright (e_X,t_X)$  is a dummy empty hyperedge signaling the end of algorithm.
Figure 6: The example of a hypergraph  $\mathcal{G}$  and its 2- and 3-projected hypergraphs.
we show that this sampling algorithm samples each hyperedge with the probability mentioned in Section 3.2.
Proposition 3. Algorithm 2 sample a hyperedge  $(e,t)$  after  $(e_p,t_p)$  with a probability proportional to  $\mathbb{P}[(e,t)|(e_p,t_p)]$  (Equation 1).