{'fraction_non_alphanumeric': 0.028998879588743164, 'fraction_numerical': 0.0066236077242470175, 'mean_word_length': 4.934102463824795, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Explicit Pairwise Factorized Graph Neural Network for Semi-Supervised Node Classification

Node features and structural information of a graph are both crucial for semi-supervised node classification problems. A variety of graph neural network (GNN) based approaches have been proposed to tackle these problems, which typically determine output labels through feature aggregation. This can be problematic, as it implies conditional independence of output nodes given hidden representations, despite their direct connections in the graph. To learn the direct influence among output nodes in a graph, we propose the Explicit Pairwise Factorized Graph Neural Network (EPFGNN), which models the whole graph as a partially observed Markov Random Field. It contains explicit pairwise factors to model output-output relations and uses a GNN backbone to model input-output relations. To balance model complexity and expressivity, the pairwise factors have a shared component and a separate scaling coefficient for each edge. We apply the EM algorithm to train our model, and utilize a star-shaped piecewise likelihood for the tractable surrogate objective. We conduct experiments on various datasets, which shows that our model can effectively improve the performance for semi-supervised node classification on graphs.


INTRODUCTION
We live in a world full of interconnections. For example, publications are connected with citation links; Social media users are connected when they follow each other [Qu et al., 2019]; protein structures are interconnections of amino acids. Modeling relational data is an important topic for machine learning. These relational data can be represented by graphs, which model a set of objects with node features and their relationships with graph edges [Zhou et al., 2018].
In this paper, we focus on the problem of classifying nodes of a graph, such as a graph of a citation network. This problem can be framed as graph-based semi-supervised learning since the label information is available for only a small subset of nodes.
For problems involving data which have grid-like graph structures, e.g., images and videos, Convolutional Neural Networks (CNN) have achieved state-of-the-art results [Veličković et al., 2018]. However, many problems involve data such as 3D meshes and citation networks, which are represented by graphs having a general structure. An increasing number of researchers try to generalize the notion of convolution for general graph structure, motivated by its success in the domain of computer vision, to address the problems involving general graphs. And there are many attempts to extend neural networks to deal with graphs with arbitrary structure: Graph Neural Networks (GNNs), such as Graph Convolutional Networks (GCN) [Kipf and Welling, 2017] and Graph Attention Networks (GAT) [Veličković et al., 2018] have been receiving increasing attention because of their effective node representation learning on general graphs. These methods take into account the graph structure and aggregate features from neighbor nodes.
However, one weakness of these methods is that they neglect direct local dependency among output label nodes, which can be important for node classification. To learn the interdependency of connected node labels, we propose to model the whole graph with a pairwise partially observed Markov Random Field (MRF) and use explicit pairwise factors to model direct dependencies between connected node labels.
To benefit from the representational power of GNNs, we apply a GNN backbone to learn appropriate unary factors that can reflect the influence from the node input features on node output labels. To avoid overfitting, we use a shared compatibility matrix to parametrize the pairwise factors, which is further multiplied by an edgewise coefficient to reflect the difference among the edges in a graph.
The partially observed MRF representation learns node representation and node label interdependency simultaneously, taking into account both observed and unobserved nodes. However, the conventional learning objective of maximizing observed data log-likelihood requires marginalizing unobserved nodes, which has an exponential computational cost and is thus intractable. To address this challenge, we use the EM algorithm [Koller and Friedman, 2009] to learn the MRF and maximize instead the evidence lower bound with alternating E-steps and M-steps: in each E-step we update the candidate distribution on the unobserved nodes, which is then used in the subsequent M-step to maximize the expected complete data log-likelihood.
This alternating training is still challenging because the inference process on general loopy graphs is known to be intractable [Koller and Friedman, 2009]. To remedy this issue and perform training efficiently, we introduce a piecewise likelihood [Sutton and McCallum, 2009] based local training method, which provides a surrogate objective that makes the inference process more manageable. It divides the graph into tractable subgraphs for easy inference, and avoids the intractable global inference procedure.
Our contributions are: • We propose the explicit pairwise factorized graph neural network (EPFGNN), which uses explicit pairwise output-output factors to augment a graph neural network backbone so that we can model direct dependencies among output label nodes in graphs.
• We use a shared compatibility matrix to parametrize pairwise factors and extend it with an edgewise multiplicative scaling coefficient. This ensures that the model can aggregate the neighbor node features and label information flexibly on both assortative graphs and disassortative graphs, while simultaneously avoid overfitting.
• We propose an EM-based learning procedure, and employ piecewise likelihood as surrogate objective to make the training on MRF tractable while retaining the structural information.
• We conduct a series of experiments 1 , which shows that our model, along with the proposed training procedure, can effectively tackle semi-supervised node classification on graphs, outperforming existing baselines.
where h k i is the hidden representation of a node at k-th layer, N (i) is the set of neighbor nodes connected with node i. The node representations are updated by weighted aggregations of the features from each central node and its neighbors. A variety of aggregation and update functions have been proposed by different GNN variants. An effective GNN model named Graph Convolution Network (GCN) by Kipf and Welling [2017] reduces the computational complexity of eigen-decomposition involved in spectral graph convolution by introducing several approximations. The GCN layer is defined as follows: whereÃ = A + I N is the adjacency matrix with selfconnections, andD ii = jÃ ij indicates the degree of node i. Since the graph has an arbitrary structure, the number of neighbors varies for different nodes, and can be large in graphs of massive scale. It is then inefficient to aggregate features from all neighbor nodes. To address this issue, GraphSAGE [Huang et al., 2018] applies a layer-wise sampler to control the size of neighbors. While GraphSAGE assumes the contribution of neighbors to the central node has equal importance, the method named Graph Attention Network (GAT) [Veličković et al., 2018] applies an attention mechanism to weigh the different contributions from neighbor node features to the central node.
While the aforementioned GNN models can effectively process graph structured data for semi-supervised node classification, they neglect the direct interdependency among output nodes despite their connections in the graph structures. To address this problem, graph Markov neural network (GMNN) [Qu et al., 2019] proposes a pseudo-likelihood based variational EM framework to model the interdependency among node labels. In the M-step, they optimize the graph neural network by maximizing the pseudo-likelihood. The pseudo-likelihood assumes the conditioning of connected node labels This assumption deviates from typical semi-supervised settings since many of the nodes are unobserved. In E-steps, GMNN uses another graph neural network to aggregate the information from connected node labels. This implicitly assumes that the graph is assortative, as typical feature aggregation operation in GNNs perform smoothing. However, in case of disassortative graphs where connected nodes tend to disagree with each other, the above assumption no longer holds.
Surrogate objective function Given a graph representation G = (V, E), where V is the set of nodes, and E is the set of edges. Denote the set of node features as X and the corresponding node labels as Y. We employ a Markov random field [Lafferty et al., 2001] [Koller et al., 2007] to model the node classification problem. Since the inference on the MRF with loops is known to be intractable [Koller and Friedman, 2009], the common learning strategy of maximizing data likelihood is infeasible [Nowozin and Lampert, 2011]. This issue motivates the finding of a surrogate objective function p approx (y|x) that approximates the original likelihood. There are two kinds of surrogate training objectives named pseudo-likelihood (PL) [Koller and Friedman, 2009] and piecewise training (PW) objective [Sutton and McCallum, 2009].
Pseudo-likelihood (p P L ) consists of the product of nodewise conditional likelihood given its Markov blanket. The intuition is that we can obtain the probability density of a node if its Markov blanket is observed. However, the pseudo-likelihood is known to have difficulties modeling longer-range dependencies [Koller and Friedman, 2009].
Piecewise training objective (p P W ) [Sutton and McCallum, 2009] is an alternative way to make the learning on MRF tractable. It models the graph using a factor graph and split the whole graph into tractable subgraphs called pieces. It is inspired by the intuition that the global distribution will be reasonable if all the local factors fit the data well. Given the set of subgraphs P , the set of the factors F within each subgraph R ∈ P , and the partition function Z R (x) of each subgraph that normalizes the piecewise likelihood, the piecewise training objective can be formulated as Piecewise training objective typically yields better results compared to pseudo-likelihood [Sutton and McCallum, 2009], as the factors in the original likelihood are conserved in the piecewise training objective, and the interdependencies among nodes are better retained.

METHODOLOGY
We denote a graph as G = (V, E) , where V is the set of nodes, E is the set of edges. Under the framework of semisupervised node classification, the full node features x V and a small subset of node labels Y V are observed in the graph. Thus, node labels are split into labeled and unlabeled subset Y V = (Y L , Y U ). Our goal is to learn a model that can predict these unknown classes Y U based on the full input features x V , observed output labels y L , and the graph structure. We use the GNN backbone to learn the valid input-output factors that reflect the influence of input node features on the node output labels. The output of GNN backbone is used as the input-output factor value. Furthermore, every connected node pairs are connected with a pairwise factor. We use the shared compatibility matrix of size c × c to parametrize the pairwise factor, where c is the output dimension.

MODEL REPRESENTATION AND LEARNING OBJECTIVE
To achieve our goal, we propose the explicit pairwise factorized graph neural network (EPFGNN). We represent the overall distribution P (Y V |x V ) by a MRF and assume that it admits the following factor decomposition: In the above expression, all factors are constrained to be positive, and Z(x V ) is the partition function that ensures normalization of the distribution. As shown in Figure 1, this factorization needs two kinds of factors to model the whole distribution: : EPFGNN training framework. The GNN backbone output is used as input-output factor value. We additionally parametrized the pairwise factor with a compatibility matrix for every connected node pair. We apply EM alternating training method to tackle the intractable challenge caused by partial observation on MRF. In the M-step, we split the graph into star-shaped pieces and maximize the expected complete log-likelihood for every piece. To avoid overcounting, we redistribute the factor values that appear in more than one piece. In the E-step, we merge the pieces back to the original MRF and estimate the posterior distribution q with fixed factor values using the mean field inference method.
These are high order factors since they involve all input features, which make direct factor parametrization intractable. To solve this issue, we use a single graph neural network (GNN) backbone to parametrize all these factors so their values can be obtained via feedforward inference: given an input x v , the GNN backbone should produce a prediction of φ i (y i , x v ) for each output node i ∈ V and possible output label y i .
• The output-output factors φ j,k (Y j , Y k ) represent the influence between connected node labels. They are pairwise factors and model the direct dependency between labels for every connected node pair. To avoid overfitting, we parametrize these factors with a single shared symmetric compatibility matrix K of size c × c, where c is the output dimension.
Thus our EPFGNN model is parametrized by parameters θ of the GNN backbone and a compatibility matrix K. Our learning objective is to find the parameters θ * and K * that maximize the observed data log-likelihood of labeled output y L given the input featuresx V :

PIECEWISE EM TRAINING FRAMEWORK
Direct MRF learning under semi-supervised setting is intractable because of the following two challenges: Partial observation Since the output subset Y U has no observation, we are in the partial observation case where Y U are unobserved variables. There are two approaches [Koller and Friedman, 2009] to tackle this problem in general: We can either perform gradient ascent to maximize the observed data likelihood directly or use the expectation-maximization (EM) algorithm. In our case, computing the observed loglikelihood directly is computationally infeasible, since we need to marginalize the unobserved random variables Y U , and complex graph structure makes the marginalization computation grows exponentially. Therefore, we apply the EM algorithm, which maximizes instead the expected complete data likelihood w.r.t. estimated posterior distribution. We will discuss the details in Section 3.2.1.
Intractable inference It is well known that the inference process on a general MRF is intractable [Koller and Friedman, 2009] because of the complex graph structure. This makes the learning process impractical beyond simplistic settings. One approach to tackle this problem is to use approximate probabilistic inference methods. However, they are commonly iterative procedures, which are unfriendly for auto-differentiation and hard to ensure convergence. We apply an alternative approach to replace the log-likelihood objective with a more manageable surrogate objective, which makes it easy to do inference and learning. The surrogate objective we use is the piecewise training objective [Sutton and McCallum, 2009]. We will elaborate the details in Section 3.2.2.

EM framework
In the semi-supervised node classification setting, many nodes are unlabeled, which means factor values of the complete data likelihood (Equation (5)) are undetermined. As the direct maximization over the observed log-likelihood log P (y L |x V ) involves intractable marginalization of unobserved output nodes Y U , we apply the EM framework to leverage the information from unlabeled nodes. EM algorithm maximizes a lower bound of the observed loglikelihood: it finds a variational distribution denoted as q(Y U |x V ) to approximate the posterior distribution of unlabeled nodes p(Y U |y L , x V ; θ, K), and maximizes the expected complete log-likelihood over all nodes w.r.t. the distribution of q(Y U |x V ). This lower bound comes from our wish to fill in the missing values y U with a proposal distribution q(Y U |x V ) and employ the (expected) complete log-likelihood for optimization instead. So the objective function is changed as follows, which is referred to as the evidence of lower bound (ELBO): where the first term is the expected complete log-likelihood and the second term is the entropy of the proposal distribution q. It is guaranteed to be a lower bound of the observed log-likelihood log P (y L |x V ) since their difference is The EM algorithm is none other than an alternating maximization of ELBO with E-step and M-step. During E-steps, we fix the learned parameters (θ, K) of posterior distribution p(Y U |y L , x V ; θ, K) and update variational distribution q(Y U |x V ). During M-steps, we fix the proposal variational distribution q(Y U |x V ) and learn parameters (θ, K) that maximize the expected complete log-likelihood over all nodes w.r.t. the distribution of q(Y U |x V ).

E-Step
In an E-step we fix parameters (θ, K) and update q to maximize the ELBO L(q; θ, K), which according to Equation (8) is equivalent to minimizing the KL-divergence The proposal distribution q has two desiderata: it should closely approximate the true likelihood distribution of missing values p(Y U |y L , x V ), and it should have a simple form such that the ELBO can easily be maximized. Here we restrict the proposal distribution q to have a fully factorized form so that the proposal distribution q(Y U |x V ) is a mean field approximation [Koller and Friedman, 2009] With the mean field approximation, there is a closed-form expression for updating the proposal distribution q when fixing the parameters θ and K: ∀i ∈ U , we have Since the mean field update is essentially a message-passing procedure, we could easily design a message passing layer using the above function to update the proposal distribution q.

M-Step
In an M-step we fix the proposal distribution q and update parameters (θ, K) to maximize the ELBO L(q; θ, K), which is equivalent to maximizing the expected complete log-likelihood E q [log P (Y U , y L |x V ; θ, K)] because the entropy term (second part in Equation (7)) only depends on q. So the objective function during M-Step is Computing the (expected) complete log-likelihood is also infeasible since the random variable grows exponentially. To make the learning procedure tractable, we apply the piecewise learning method, which we will discuss in the next section.

Piecewise surrogate objective for M-Step
The inference on MRF is intractable, and the computation of partition function Z(x V ) in Equation (5) is infeasible for graph data in practice. This hinders the learning process of our model. To overcome this, we utilize a tractable surrogate objective function to approximate the original likelihood.
Star-shaped piecewise surrogate objective The piecewise training method provides an alternative local training approach [Sutton and McCallum, 2009]. It breaks the whole graphical model down into tractable subgraphs and performs inference separately on each piece. The subgraphs can have overlaps among them and should have tractable structures for inference, e.g., trees. The factors contained in each subgraph are used to define its distribution. In our case, we want to model the interdependency between the central node and its neighbors. Thus, we star-wisely split the entire pairwise factor graph of the MRF: As shown in Figure 2, for every node i in the graph, we create a piece which groups this node and its neighbors as a subgraph. So the objective function approximates the original log-likelihood as where N (i) represents the neighbor nodes of central node i. This star-shaped piece is a tree structure rooted at the central node, and this piece is parametrized by the factors from the original MRF and pairwise factorized following Equation (5). Thus, the partition functions of the subgraphs can be easily computed using belief propagation [Koller and Friedman, 2009]. With this approximation, we can design a message passing layer to estimate the surrogate objective function.
Factor redistribution For every node, we group this node and its connected neighborhood as a piece, which generates overlaps among different pieces as shown in Figure 2. This means the factors that are contained in intersecting regions of different pieces will be overcounted. To avoid this issue, we redistribute the overlapping factor values in every subgraph. An even redistribution of factors is formulated as follows: With this redistribution, the distribution of each piecē so that the redistributed piecewise log likelihood¯ pw (Y V |x V ) of the whole model has the following form: Here we see that the factor overcounting issue is fixed. This piecewise likelihood reasonably approximates the original distribution P (Y V |x V ) since the only difference between Equation 5 is the partition function.
Edgewise scalar coefficient For our discussion so far, we only considered a single c × c compatibility matrix K to parametrize pairwise factors φ j,k (y j , y k ) of every connected node pair, meaning that all connected node pairs share a common parametrization (denote K(l, m) = K l,m ): log φ j,k (y j , y k ) = K(y j , y k ).
This representation can be restricting since it does not differentiate the edges in the graph. It is thus necessary to relax this constraint in order to equip our model with more representational power. However, if we parametrize every edge with a different c × c matrix, the model will easily suffer from overfitting. In order to balance these two aspects, we introduce an additional scalar parameter α j,k for each edge (j, k) that scales the shared compatibility matrix. Thus, the parametrization becomes log φ j,k (y j , y k ) = α j,k K(y j , y k ) and the star-shaped piecewise log-likelihood becomes

EXPERIMENT AND RESULT
In this section, we compare our model with state-of-theart methods such as GCN [Kipf and Welling, 2017], GAT [Veličković et al., 2018], and GMNN [Qu et al., 2019] for semi-supervised node classification problems. We evaluate our model on a wide variety of datasets, including both assortative and disassortative graphs. We also conduct an ablation study to analyze different components of our model. We report average accuracy on 50 runs of experiments for analysis.

DATASET
In this section, we introduce the characteristics of graph datasets including both assortative and disassortative graphs.

Citation networks
The citation network is a graph where nodes represent papers, edges depict the citation relationship between two papers, and node features are the bag of words of that paper. The node label is the topic of the corresponding paper. Cora, Citeseer and PubMed are common benchmark datasets [Namata et al., 2012] [Sen et al., 2008] of this type. We employ the same configuration as in Yang et al. [2016], which randomly picks 20 samples out of every class as training nodes, and randomly selects 500 and 1000 samples for validation and test, respectively.
Wikipedia networks Wikipedia networks are graphs where nodes stand for websites, and edges represent the mutual links of two pages. Node features are representative nouns of that page, and nodes are classified according to their average monthly traffic. Chameleon and Squirrel [Rozemberczki et al., 2021] are both examples of such networks. We split the graph to the train, validation, and test according to the following ratio: 20%, 20%, and 60%.
Actor co-occurrence networks Actor co-occurrence network is a graph extracted from film-director-actor-writer network [Tang et al., 2009]. The Actor dataset is one of the graph where nodes represent actors and edges indicate co-occurrence relationship in the same website between two actors. The node features are representative keywords of an actor. We split the graph in the same manner as for Wikipedia networks.

CLASSIFICATION ON GRAPHS
To evaluate the effectiveness of our method, we compare our model with several baseline methods on semi-supervised node classification tasks. We use the Cora, Citeseer, and Pubmed datasets for comparison. For our EPFGNN model, we utilize GCN as the graph neural network backbone to learn the representation of input-output factors given input features. We use the same hyperparameter setting as described in [Kipf and Welling, 2017]. We employ a compatibility matrix to model the interdependency among node labels and extend the pairwise factors with a scalar coefficient for every edge. The test accuracies of different models on different datasets are collected in Table 2. As shown in Table 2, our method outperforms other state-ofthe-art baselines, especially on the Citeseer dataset, where we observe a performance improvement for over 2%. These results support our analysis that modeling the direct interdependency among node labels will improve performance. Also, a more significant performance increase is observed on the Citeseer dataset, which has the lowest graph homophily β among three datasets. This shows the advantage of the EPFGNN representation: contrary to other baselines methods, it goes beyond feature smoothing.

ANALYSIS OF GRAPH HOMOPHILY
The citation networks are assortative graphs since the connected nodes tend to have the same label. In contrast, the Wikipedia networks and actor co-occurrence networks are disassortative graphs where the assumption of graph homophily no longer holds. To quantify the degree of graph homophily, we use the measure β from Pei et al. [2020] defined as follows: The measure β ranges between 0 and 1, where assortative graphs like Cora have high β values above 0.5 while disassortative ones like Chameleon have low β values below 0.5. β value for various graph datasets are provided in Table 1.
We further experiment with disassortative graph datasets Chameleon, Squirrel, and Actor. We report the test accuracy results in Table 3.
As shown in Table 3, to a certain degree, our model managed to adapt to disassortative graphs. Since we have a shared compatibility matrix and every edge has one additional degree of freedom from the edgewise scalar coefficient, the explicit pairwise modeling in EPFGNN enables the model to flexibly aggregate the neighbor node label information when the neighboring nodes tend to disagree.

ABLATION STUDY
The proposed EPFGNN model learns the node representation and aggregates estimated label information from connected neighbor nodes. The key components of this model are the GNN backbone and the parametrization of pairwise factors. In this section, we compare different model variants to examine the contribution of each component.

GNN-Backbone
The role of the GNN backbone in the EPFGNN model is to model the influence of input features on output labeling. It parametrizes the input-output factors in the MRF. To find an appropriate choice, we consider two commonly used GNN models, GCN and GAT, as backbones for node representation learning, and evaluate their effectiveness by conducting experiments on three standard datasets Cora, Citeseer, and Pubmed. In Table 4, we observe that GCN outperforms GAT on all three datasets. These results indicate that GAT, which has more parameters compared to GCN, is likely to suffer from overfitting as GNN backbone for EPFGNN.
Redistribution The star-shaped split of the whole graph will cause overlaps among pieces and result in the overcounting of factors when estimating the piecewise likelihood. To address this problem, we redistribute the factor values as described in Equation (14). We refer to this distribution method as average redistribution. To verify whether this redistribution is reasonable, we compare it with a different redistribution method referred to as center redistribution. For center redistribution, we assign each input-output factor φ i (Y i , x V ) entirely to the subgraph where i is the central node. This yields a different estimation of the piecewise likelihood. We compare these two redistribution methods on the three standard datasets Cora, Citeseer, and Pubmed and collect the classification accuracies in Table 5. The results in Table 5 show that average redistribution tends to yield better results, possibly owing to the fact that the input-output factors provided by the GNN backbone is accessible in all related subgraphs. It remains an interesting future work to analyze other possible redistribution schemes.
Edgewise scaling coefficient To understand the effect of introducing the edgewise scaling coefficient, we compare it with two alternative settings. We name the setting that only has shared parametrization for all output-output factors as EPFGNN w/o coefficient and name the setting with both shared compatibility matrix and shared scalar coefficient for output-output factors on every edge as EPFGNN using layer coefficient. We refer to the original setting, which has a shared compatibility matrix and edgewise scalar coefficients, as EPFGNN using edge coefficient. Their comparison is summarized in Table 6. The results in Table 6 show that the edgewise coefficient setting outperforms other alternative settings. Thus we can conclude that the additional flexibility provided by the edgewise scaling coefficient is beneficial and can effectively improve the representational power of the EPFGNN model.

CONCLUSION
This paper proposes the novel EPFGNN framework in which explicit pairwise factors are defined to model direct dependency between connected node pairs. In this way, the model can simultaneously aggregate node input features and label information from neighbor nodes. By introducing a shared compatibility matrix and edgewise scaling coefficients, we are able to effectively provide a flexible representation while avoiding overfitting. With the application of the EM algorithm and the surrogate piecewise objective in the M-step, we manage to leverage information from unobserved nodes and make the learning procedure tractable. We validate our analysis and model design with a series of experiments, which shows that the EPFGNN framework can effectively handle semi-supervised node classification problems for various graph datasets.