SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Haonan Yuan $^{1,2}$ , Qingyun Sun $^{1,2*}$ , Xingcheng Fu $^{3}$ , Ziwei Zhang $^{4}$ , Cheng Ji $^{1,2}$ , Hao Peng $^{1}$ , Jianxin Li $^{1,2}$
<sup>1</sup>Beijing Advanced Innovation Center for Big Data and Brain Computing, Beihang University
$^{2}$ School of Computer Science and Engineering, Beihang University
<sup>3</sup>Key Lab of Education Blockchain and Intelligent Technology, Guangxi Normal University
$^{4}$ Department of Computer Science and Technology, Tsinghua University
{yuanhn,sunqy,jicheng,penghao,lijx}@buaa.edu.cn
fuxc@gxnu.edu.cn, zwzhang@tsinghua.edu.cn
Dynamic graph neural networks (DGNNs) are increasingly pervasive in exploiting spatio-temporal patterns on dynamic graphs. However, existing works fail to generalize under distribution shifts, which are common in real-world scenarios. As the generation of dynamic graphs is heavily influenced by latent environments, investigating their impacts on the out-of-distribution (OOD) generalization is critical. However, it remains unexplored with the following two major challenges: (1) How to properly model and infer the complex environments on dynamic graphs with distribution shifts? (2) How to discover invariant patterns given inferred spatio-temporal environments? To solve these challenges, we propose a novel Environment-Aware dynamic Graph LEarning (EAGLE) framework for OOD generalization by modeling complex coupled environments and exploiting spatiotemporal invariant patterns. Specifically, we first design the environment-aware EA-DGNN to model environments by multi-channel environments disentangling. Then, we propose an environment instantiation mechanism for environment diversification with inferred distributions. Finally, we discriminate spatio-temporal invariant patterns for out-of-distribution prediction by the invariant pattern recognition mechanism and perform fine-grained causal interventions node-wisely with a mixture of instantiated environment samples. Experiments on real-world and synthetic dynamic graph datasets demonstrate the superiority of our method against state-of-the-art baselines under distribution shifts. To the best of our knowledge, we are the first to study OOD generalization on dynamic graphs from the environment learning perspective.
Dynamic graphs are ubiquitous in the real world, like social networks [6, 25], financial transaction networks [61, 93], traffic networks [47, 97, 96], etc., where the graph topology evolves as time passes. Due to their complexity in both spatial and temporal correlation patterns, wide-ranging applications such as relation prediction [39, 68], anomaly detection [10, 69], etc. are rather challenging. With excellent expressive power, dynamic graph neural networks (DGNNs) achieve outstanding performance in dynamic graph representation learning by combining the merits of graph neural network (GNN) based models and sequential-based models.
(a) A toy example of distribution shifts on dynamic graphs.
(b) The SCM model on dynamic graphs.
Figure 1: (a) shows the "user-item" interactions with heavy distribution shifts when the underlying environments change (e.g., seasons). A model could mistakenly predict that users would purchase an Iced Americano instead of a Hot Latte if it fails to capture spatio-temporal invariant patterns among spurious correlations. (b) analyzes the underlying cause of distribution shifts on dynamic graphs. It is broadly convinced [64, 67] that the spurious correlations of  $C$  (coffee)  $\leftrightarrow S$  (cold drink) within and between graph snapshots lead to poor OOD generalization under distribution shifts, which need to be filtered out via carefully investigating the impact of latent e. (Detailed discussions in Appendix F.1)
Despite the popularity, most existing works are based on the widely accepted I.I.D. hypothesis, i.e., the training and testing data both follow the independent and identical distribution, which fails to generalize well [77] under the out-of-distribution (OOD) shifts in dynamic scenarios. Figure 1(a) illustrates a toy example demonstrating the OOD shifts on a dynamic graph. The failure lies in: (1) the exploited predictive patterns have changed for in-the-wild extrapolations, causing spurious correlations to be captured [94] and even strengthened with spatio-temporal convolutions. (2) performing causal intervention and inference without considering the impact of environments, introducing external bias of label shifting [91]. These can be explained by SCM model [64, 65, 66] in Figure 1(b).
As the generation of dynamic graphs is influenced by complicated interactions of multiple varying latent environment factors [86, 71, 8, 24, 3, 79, 78, 53], like heterogeneous neighbor relations, multi-community affiliations, etc., investigating the roles environments play in OOD generalization is of paramount importance. To tackle the issues above, we study the problem of generalized representation learning under OOD shifts on dynamic graphs in an environment view by carefully exploiting spatio-temporal invariant patterns. However, this problem is highly challenging in:
- How to understand and model the way latent environments behave on dynamic graphs over time?
- How to infer the distribution of underlying environments with the observed instances?
- How to recognize the spatio-temporal invariant patterns over changing surrounding environments?
To address these challenges, we propose a novel Environment-Aware dynamic Graph LEarning (EAGLE) framework for OOD generalization, which handles OOD generalization problem by exploiting spatio-temporal invariant patterns, thus filtering out spurious correlations via causal interventions over time. Our EAGLE solves the aforementioned challenges and achieves the OOD generalization target as follows. Firstly, to shed light on environments, we design the environment-aware EA-DGNN to model environments by multi-channel environments disentangling. It can be considered as learning the disentangled representations under multiple spatio-temporal correlated environments, which makes it possible to infer environment distributions and exploit invariant patterns. Then, we propose an environment instantiation mechanism for environment diversification with inferred environment distributions by applying the multi-label variational inference. This endows our EAGLE with higher generalizing power of potential environments. Lastly, we propose a novel invariant pattern recognition mechanism for out-of-distribution prediction that satisfies the Invariance Property and Sufficient Condition with theoretical guarantees. We then perform fine-grained causal interventions with a mixture of observed and generated environment instances to minimize the empirical and invariant risks. We optimize the whole framework by training with the adapted min-max strategy, encouraging EAGLE to generalize to diverse environments while learning on the spatio-temporal invariant patterns. Contributions of this paper are summarized as follows:
Figure 2: The framework of EAGLE. Our proposed method jointly optimizes the following modules: (1) For a given dynamic graph generated under latent environments, the EA-DGNN first models environment by multi-channel environments disentangling. (2) The environment instantiation mechanism then infers the latent environments, followed by environment diversification with inferred distributions. (3) The invariant pattern recognition mechanism discriminates the spatio-temporal invariant patterns for OOD prediction. (4) Finally, EAGLE generalizes to diverse environments by performing fine-grained causal interventions node-wisely with a mixture of environment instances. The Environment "Modeling-Inferring-Discriminating-Generalizing" paradigm endows EAGLE with higher generalizing power for future potential environments.
- We propose a novel framework named EAGLE for OOD generalization by exploiting spatiotemporal invariant patterns with respect to environments. To the best of our knowledge, this is the first trial to explore the impact of environments on dynamic graphs under OOD shifts.
- We design the Environment "Modeling-Inferring-Discriminating-Generalizing" paradigm to endow EAGLE with higher extrapolation power for future potential environments. EAGLE can carefully model and infer underlying environments, thus recognizing the spatio-temporal invariant patterns and performing fine-grained causal intervention node-wisely with a mixture of observed and generated environment instances, which generalize well to diverse OOD environments.
- Extensive experiments on both real-world and synthetic datasets demonstrate the superiority of our method against state-of-the-art baselines for the future link prediction task.
In this section, we formulate the OOD generalization problem on dynamic graphs. Random variables are denoted as bold symbols while their realizations are denoted as italic letters. Notation with its description can be found in Appendix A.
Dynamic Graph Learning. Denote a dynamic graph as a set of discrete graphs snapshots  $\mathbf{DG} = \{\mathcal{G}\}_{t=1}^{T}$ , where  $T$  is the time length [94, 57],  $\mathcal{G}^t = (\mathcal{V}^t, \mathcal{E}^t)$  is the graph snapshot at time  $t$ ,  $\mathcal{V}^t$  is the node set and  $\mathcal{E}^t$  is the edge set. Let  $\mathbf{A}^t \in \{0,1\}^{N \times N}$  be the adjacency matrix and  $\mathbf{X}^t \in \mathbb{R}^{N \times d}$  be the matrix of node features, where  $N = |\mathcal{V}^t|$  denotes the number of nodes and  $d$  denotes the dimensionality. As the most challenging task on dynamic graphs, future link prediction task aims to train a predictor  $f_\theta : \mathcal{V} \times \mathcal{V} \mapsto \{0,1\}^{N \times N}$  that predicts the existence of edges at time  $T + 1$  given historical graphs  $\mathcal{G}^{1:T}$ . Concretely,  $f_\theta = w \circ g$  is a compound of a DGNN  $w(\cdot)$  for learning node representations and a link predictor  $g(\cdot)$  for predicting links, i.e.,  $\mathbf{Z}^{1:T} = w(\mathcal{G}^{1:T})$  and  $\hat{Y}^T = g(\mathbf{Z}^{1:T})$ .
The widely adopted Empirical Risk Minimization (ERM) [82] learns the optimal  $f_{\theta}^{\star}$  as follows:
$$
\min  _ {\boldsymbol {\theta}} \mathbb {E} _ {(\mathcal {G} ^ {1: T}, Y ^ {T}) \sim p (\mathbf {G} ^ {1: T}, \mathbf {Y} ^ {T})} \left[ \ell \left(f _ {\boldsymbol {\theta}} \left(\mathcal {G} ^ {1: T}\right), Y ^ {T}\right) \right]. \tag {1}
$$
OD Generalization with Environments. The predictor  $f_{\theta}^{\star}$  learned in Eq. (1) may not generalize well to the testing set when there exist distribution shifts, i.e.,  $p_{\mathrm{test}}(\mathbf{G}^{1:T}, \mathbf{Y}^T) \neq p_{\mathrm{train}}(\mathbf{G}^{1:T}, \mathbf{Y}^T)$ . A broadly accepted assumption is that the distribution shifts on graphs are caused by multiple latent environments e [86, 71, 8, 24, 3], which influence the generation of graph data, i.e.,  $p(\mathbf{G}^{1:T}, \mathbf{Y}^T \mid \mathbf{e}) = p(\mathbf{G}^{1:T} \mid \mathbf{e})p(\mathbf{Y}^T \mid \mathbf{G}^{1:T}, \mathbf{e})$ . Denoting  $\mathbf{E}$  as the support of environments across  $T$  time slices, the optimization objective of OOD generalization can be reformulated as:
$$
\min  _ {\boldsymbol {\theta}} \max  _ {\mathbf {e} \in \mathbf {E}} \mathbb {E} _ {(\mathcal {G} ^ {1: T}, Y ^ {T}) \sim p (\mathbf {G} ^ {1: T}, \mathbf {Y} ^ {T} | \mathbf {e})} \left[ \ell \left(f _ {\boldsymbol {\theta}} \left(\mathcal {G} ^ {1: T}\right), Y ^ {T}\right) | \mathbf {e} \right], \tag {2}
$$
where the min-max strategy minimizes ERM under the worst possible environment. However, directly optimizing Eq. (2) is infeasible as the environment  $\mathbf{e}$  cannot be observed in the data. In addition, the training environments may not cover all the potential environments in practice, i.e.,  $\mathbf{E}_{\mathrm{train}} \subseteq \mathbf{E}_{\mathrm{test}}$ .
In this section, we introduce EAGLE, an Environment-Aware dynamic Graph LEarning framework, to solve the OOD generalization problem. The overall architecture of EAGLE is shown in Figure 2, following the Environment "Modeling-Inferring-Discriminating-Generalizing" paradigm.
3.1 Environments Modeling with Environment-aware DGNN
To optimize the objectives of OOD generalization, we first need to infer the environments of dynamic graphs. In practice, the formation of real-world dynamic graphs typically follows a complex process under the impact of underlying environments [56, 51]. For example, the relationships in social networks are usually multi-attribute (e.g., colleagues, classmates, etc.) and are changing over time (e.g., past classmates, current classmates). Consequently, the patterns of message passing and aggregation in both spatial and temporal dimensions should be diversified in different environments, while the existing holistic approaches [94, 52] fail to distinguish them. To model spatio-temporal environments, we propose an Environment-Aware Dynamic Graph Neural Network (EA-DGNN) to exploit environment patterns by multi-channel environments disentangling.
Environment-aware Convolution Layer (EACnv). We perform convolutions following the "spatial first, temporal second" paradigm as most DGNNs do [54]. We consider that the occurrence of links is decided by  $K$  underlying environments  $\mathbf{e}_v = \{\mathbf{e}_k\}_{k=1}^K$  of the central node  $v$ , which can be revealed by the features and structures of local neighbors. To obtain representations under multiple underlying environments, EACnv firstly projects the node features  $\mathbf{x}_v^t$  into  $K$  subspaces corresponding to different environments. Specifically, the environment-aware representation of node  $v$  with respect to the  $k$ -th environment  $\mathbf{e}_k$  at time  $t$  is calculated as:
$$
\mathbf {z} _ {v, k} ^ {t} = \sigma \left(\mathbf {W} _ {k} ^ {\top} \left(\mathbf {x} _ {v} ^ {t} \oplus \operatorname {R T E} (t)\right) + \mathbf {b} _ {k}\right), \tag {3}
$$
where  $\mathbf{W}_k\in \mathbb{R}^{d\times d'}$  and  $\mathbf{b}_k\in \mathbb{R}^{d'}$  are learnable parameters,  $\mathrm{RTE}(\cdot)$  is the relative time encoding function,  $d^{\prime}$  is the dimension of  $\mathbf{z}_{v,k}^{t}$ ,  $\sigma (\cdot)$  is the activation function (e.g., the Sigmoid function), and  $\oplus$  is the element-wise addition.
To reflect the varying importance of environment patterns under  $K$  embedding spaces, we perform multi-channel convolutions with spatio-temporal aggregation reweighting for each  $\mathbf{e}_k$ . Let  $\mathbf{A}_{(u,v),k}^t$  be the weight of edge  $(u,v)$  under  $\mathbf{e}_k$  at time  $t$ . The spatial convolutions of one EACnv layer are formulated as (note that we omit the layer superscript for brevity):
$$
\hat {\mathbf {z}} _ {v, k} ^ {t} = \mathbf {z} _ {v, k} ^ {t} + \sum_ {u \in \mathcal {N} ^ {t} (v)} \mathbf {A} _ {(u, v), k} ^ {t} \mathbf {z} _ {u, k} ^ {t}, \tag {4}
$$
$$
\mathbf {A} _ {(u, v), k} ^ {t} = \frac {\exp \left(\left(\mathbf {z} _ {u , k} ^ {t}\right) ^ {\top} \mathbf {z} _ {v , k} ^ {t}\right)}{\sum_ {k ^ {\prime} = 1} ^ {K} \exp \left(\left(\mathbf {z} _ {u , k ^ {\prime}} ^ {t}\right) ^ {\top} \mathbf {z} _ {v , k ^ {\prime}} ^ {t}\right)}, \tag {5}
$$
where  $\mathcal{N}^t (v)$  is the neighbors of node  $v$  at time  $t$  and  $\hat{\mathbf{z}}$  denotes the updated node embedding. We then concatenate  $K$  embeddings from different environments as the final node representation  $\hat{\mathbf{z}}_v^{\mathrm{e},t} = \left\|_{k = 1}^{K}\hat{\mathbf{z}}_{v,k}^{t}\in \mathbb{R}^{K\times d^{\prime}}\right.$ , where  $\|\cdot\|$  means concatenation. After that, we conduct temporal convolutions holistically here for graph snapshots at time  $t$  and before:
$$
\mathbf {z} _ {v} ^ {\mathrm {e}, t} = \frac {1}{t} \sum_ {\tau = 1} ^ {t} \hat {\mathbf {z}} _ {v} ^ {\mathrm {e}, \tau} \in \mathbb {R} ^ {K \times d ^ {\prime}}, \quad \text {w h e r e} \quad \hat {\mathbf {z}} _ {v} ^ {\mathrm {e}, \tau} = \left[ \hat {\mathbf {z}} _ {v, 1} ^ {\tau} \| \hat {\mathbf {z}} _ {v, 2} ^ {\tau} \| \dots \| \hat {\mathbf {z}} _ {v, K} ^ {\tau} \right]. \tag {6}
$$
Note that, the temporal convolutions can be easily extended to other sequential convolution models or compounded with any attention/reweighting mechanisms.
EA-DGNN Architecture. The overall architecture of EA-DGNN is similar to general GNNs by stacking  $L$  layers of EACnv. In a global view, we exploit the patterns of environments by reweighting the multi-attribute link features with  $K$  channels. In the view of an individual node, multiple attributes in the link with neighbors can be disentangled to different attention when carrying out convolutions on both spatial and temporal dimensions. We further model the environment-aware representations by combining node representations at each time snapshot  $\mathbf{z}_v^{\mathrm{e}} = \bigcup_{t=1}^{T} \{\mathbf{z}_v^{\mathrm{e},t}\} \in \mathbb{R}^{T \times (K \times d')}$ .
3.2 Environments Inferring with Environment Instantiation Mechanism
To infer environments with the environmental patterns, we propose an environment instantiation mechanism with multi-label variational inference, which can generate environment instances given multi-labels of time  $t$  and environment index  $k$ .
Environment Instantiation Mechanism is a type of data augmentation to help OOD generalization. We regard the learned node embeddings  $\mathbf{z}_{v,k}^{t}$  as environment samples drawn from the ground-truth distribution of latent environment e. Particularly, we optimize a multi-label Environment-aware Conditional Variational AutoEncoder (ECVAE) to infer the distribution of  $\mathbf{e} \sim q_{\phi}(\mathbf{e} \mid \mathbf{z}, \mathbf{y})$  across  $T$ . We have the following proposition. Proof for Proposition 1 can be found in Appendix C.1.
Proposition 1. Given observed environment samples from the dynamic graph  $\mathcal{G}^{1:T}$  denoted as
$$
\mathbf {z} = \bigcup_ {v \in \mathcal {V}} \bigcup_ {k = 1} ^ {K} \bigcup_ {t = 1} ^ {T} \left\{\mathbf {z} _ {v, k} ^ {t} \right\} \in \mathbb {R} ^ {\left(| \mathcal {V} | \times K \times T\right) \times d ^ {\prime}} \stackrel {\text {d e f}} {=} S _ {\mathrm {o b}} \tag {7}
$$
with their corresponding one-hot multi-labels  $\mathbf{y}$ , the environment variable  $\mathbf{e}$  is drawn from the prior distribution  $p_{\omega}(\mathbf{e} \mid \mathbf{y})$  across  $T$  time slices, and  $\mathbf{z}$  is generated from the distribution  $p_{\omega}(\mathbf{z} \mid \mathbf{y}, \mathbf{e})$ . Maximizing the conditional log-likelihood  $\log p_{\omega}(\mathbf{z} \mid \mathbf{y})$  leads to an optimal ECVAE by minimizing:
$$
\mathcal {L} _ {\mathrm {E C V A E}} = \mathrm {K L} \left[ q _ {\phi} (\mathbf {e} \mid \mathbf {z}, \mathbf {y}) \| p _ {\omega} (\mathbf {e} \mid \mathbf {y}) \right] - \frac {1}{| \mathbf {z} |} \sum_ {i = 1} ^ {| \mathbf {z} |} \log p _ {\omega} (\mathbf {z} \mid \mathbf {y}, \mathbf {e} ^ {(i)}), \tag {8}
$$
where  $\mathrm{KL}[\cdot \| \cdot ]$  is the Kullback-Leibler (KL) divergence [37],  $|\mathbf{z}|$  is the number of observed environment samples,  $\mathbf{e}^{(i)}$  is the  $i$ -th sampling by the reparameterization trick.
Sampling and Generating. Proposition 1 demonstrates the training objectives of the proposed ECVAE. We realize ECVAE using fully connected layers, including an environment recognition network  $q_{\phi}(\mathbf{e} \mid \mathbf{z}, \mathbf{y})$  as the encoder, a conditional prior network  $p_{\omega}(\mathbf{e} \mid \mathbf{y})$  as observed environment instantiations, and an environment sample generation network  $p_{\omega}(\mathbf{z} \mid \mathbf{y}, \mathbf{e})$  as the decoder. By explicitly sampling latent  $\mathbf{e}_i$  from  $p_{\omega}(\mathbf{e})$ , we can instantiate environments by generating samples  $\mathbf{z}_{k_i}^{t_i}$  from the inferred distribution  $p_{\omega}(\mathbf{z} \mid \mathbf{y}_i, \mathbf{e}_i)$  with any given one-hot multi-label  $\mathbf{y}_i$  mixed up with the environment index  $k_i$  and time index  $t_i$ . We denote the generated samples as  $S_{\mathrm{ge}}$ , which can greatly expand the diversity of the observed environments  $S_{\mathrm{ob}}$  in Eq. (7).
3.3 Environments Discriminating with Invariant Pattern Recognition
Inspired by the Independent Causal Mechanism (ICM) assumption [64, 65, 67], we next propose to learn the spatio-temporal invariant patterns utilizing our inferred and instantiated environments.
Invariant Pattern Recognition Mechanism. To encourage the model to rely on the invariant correlation that can generalize under distribution shifts, we propose an invariant pattern recognition mechanism to exploit spatio-temporal invariant patterns. We make the following assumption.
Assumption 1 (Invariant and Sufficient). Given the dynamic graph  $\mathcal{G}^{1:T}$ , each node is associated with  $K$  surrounding environments. There exist spatio-temporal invariant patterns that can lead to generalized out-of-distribution prediction across all time slices. The function  $\mathbb{I}^{\star}(\cdot)$  can recognize the spatio-temporal invariant patterns  $\mathcal{P}_{\mathrm{e}}^{I}$  and variant patterns  $\mathcal{P}_{\mathrm{e}}^{V}$  node-wisely, satisfying:
(a) Invariance Property:  $\forall \mathbf{e} \in \mathbf{E}, \mathbb{I}^{\star}(\mathbf{Z}^{1:T}) \models \mathcal{P}_{\mathbf{e}}^{I}$ , s.t.  $p(\mathbf{Y}^T \mid \mathcal{P}_{\mathbf{e}}^{I}, \mathbf{e}) = p(\mathbf{Y}^T \mid \mathcal{P}_{\mathbf{e}}^{I})$ ;
(b) Sufficient Condition:  $\mathbf{Y}^T = g(\mathbf{Z}_I^{1:T}) + \epsilon$ , i.e.,  $\mathbf{Y}^T \perp \mathcal{P}_{\mathbf{e}}^V \mid \mathcal{P}_{\mathbf{e}}^I$ , where  $\mathbf{Z}_I^{1:T}$  denotes representations under  $\mathcal{P}_{\mathbf{e}}^I$  over time,  $g(\cdot)$  is the link predictor,  $\epsilon$  is an independent noise.
Assumption 1 indicates that the modeled environment-aware representations of nodes under  $\mathcal{P}_{\mathrm{e}}^{I}$  contain a portion of spatio-temporal invariant causal features that contribute to generalized OOD prediction over time. Invariance Property guarantees for any environment e, function  $\mathbb{I}^{\star}(\cdot)$  can always recognize the invariant patterns  $\mathcal{P}_{\mathrm{e}}^{I}$  with the observation of  $\mathbf{Z}^{1:T}$ , and Sufficient Condition ensures the information contained in  $\mathbf{Z}_I^{1:T}$  is adequate for the link predictor to make correct predictions.
Next, we show that  $\mathbb{I}^{\star}(\cdot)$  in Proposition 2 can be instantiated with the following proposition.
Proposition 2 (A Solution for  $\mathbb{I}^{\star}(\cdot)$ ). Denote  $\mathbf{z}_v^{\mathbf{e}'} = [\mathbf{z}_{v,1}',\mathbf{z}_{v,2}',\dots ,\mathbf{z}_{v,K}']$ , where  $\mathbf{z}_{v,k}' = \bigcup_{t=1}^{T}\mathbf{z}_{v,k}^{t}$ . Let  $\operatorname{Var}(\mathbf{z}_v^{\mathbf{e}'}) \in \mathbb{R}^K$  represents the variance of  $K$  environment-aware representations. The Boolean function  $\mathbb{I}(\cdot)$  is a solution for  $\mathbb{I}^{\star}(\cdot)$  with the following state update equation:
$$
\mathbb {I} (i, j) = \left\{ \begin{array}{l l} \mathbb {I} (i - 1, j) \vee \mathbb {I} (i - 1, j - \operatorname {V a r} \left(\mathbf {z} _ {v} ^ {\mathbf {e} ^ {\prime}}\right) [ i - 1 ]), & j \geq \operatorname {V a r} \left(\mathbf {z} _ {v} ^ {\mathbf {e} ^ {\prime}}\right) [ i - 1 ] \\ \mathbb {I} (i - 1, j), & \text {o t h e r w i s e} \end{array} , \right. \tag {9}
$$
$\mathbb{I}(i,j)$  indicates whether it is feasible to select from the first  $i$  elements in  $\operatorname{Var}(\mathbf{z}_v^{\mathbf{e}'})$  so that their sum is  $j$ . Traversing  $j$  in reverse order from  $\left\lfloor \sum \operatorname{Var}(\mathbf{z}_v^{\mathbf{e}'}) / 2 \right\rfloor$  until satisfying  $\mathbb{I}(K,j)$  is True, we reach:
$$
\delta_ {v} = \sum \operatorname {V a r} \left(\mathbf {z} _ {v} ^ {\mathrm {e} /}\right) - 2 j, \tag {10}
$$
$$
\mathcal {P} _ {\mathbf {e}} ^ {I} (v) = \left\{\mathbf {e} _ {k} \mid \operatorname {V a r} \left(\mathbf {z} _ {v} ^ {\mathbf {e} /}\right) [ k ] \leq \frac {1}{K} \sum \operatorname {V a r} \left(\mathbf {z} _ {v} ^ {\mathbf {e} /}\right) - \frac {\delta_ {v}}{2} \right\}, \quad \mathcal {P} _ {\mathbf {e}} ^ {V} (v) = \overline {{\mathcal {P} _ {\mathbf {e}} ^ {I} (v)}}, \tag {11}
$$