# Dynamic Node Privacy Feature Decoupling Graph Autoencoder Based on Attention Mechanism
## 5 Method Details  
### Node Privacy Ranking by Attention  
The proposed method combines two variational graph autoencoders. The former is used to extract the feature representation of the graph, while the latter focuses on estimating privacy-related data. Specifically, the first autoencoder generates low-dimensional embeddings through the graph structure and node features to capture the overall features of the graph, while the second autoencoder estimates the distribution of privacy information through privacy loss. The objective function of privacy autoencoder can be formulated as:  
\[L_{p}=\mathbb{E}_{q_{p}(Z_{p}|A,X)}\Big{[}\log p_{\varphi_{p}}(P\mid Z_{p}) \Big{]}-\text{KL}\Big{[}q_{\theta_{p}}(Z_{p}\mid A,X)\mid p(Z_{p})\Big{]}, \tag{9}\]  
Figure 1: The architecture of proposed model. where \(\theta_{p}\) and \(\varphi_{p}\) represent the parameters of the privacy encoder and privacy decoder respectively. \(P\) is the observed partial private information. \(Z_{p}\) represents the privacy latent representation; \(q_{\varphi_{p}}(Z_{p}\mid A,X)\) represents the posterior distribution of the privacy information distribution; \(P(Z_{p})\)is the prior distribution of \(Z_{p}\). The objective function shown in (9) contains two parts. The first term is used to estimate the sensitive attribute distribution given the graph structure and non-sensitive attributes. By optimizing this objective, the privacy information can be mapped to a low-dimensional graph embedding representation, thereby enabling inference and prediction of privacy information. The second term is a regularization term, using KL divergence to force the privacy distribution to fit a prior distribution. To quantify the global importance of nodes for privacy protection, we propose an attention-driven node privacy importance measurement scheme. To begin with, an attention layer [22] is added between the privacy latent embedding representation and the privacy decoder. The attention fraction matrix is updated through the privacy-solving loss. Specifically, this fraction matrix reflects the relative importance of each node in the privacy protection process. We adjust these attention scores by minimizing the reconstruction loss of privacy information so that important nodes contribute more to privacy inference. By summing each column of the attention score matrix and then sorting it from large to small, the global importance score of each node for privacy protection can be obtained. In practice, for the obtained privacy latent representation, generate the corresponding query \(Q\), key \(K\), and value \(V\) through three linear transformations, which can be represented in matrix form as:  
\[Q =W_{q}Z_{p}, \tag{10}\] \[K =W_{k}Z_{p},\] (11) \[V =W_{v}Z_{p}, \tag{12}\]  
where \(W_{q}\), \(W_{k}\) and \(W_{v}\) represent the corresponding learnable weight parameters. \(Q\) reflects the node's demand to obtain or focus on other nodes in privacy protection; \(K\) is used to determine the overall weight of each node in privacy protection; \(V\) is a comprehensive measure of the importance of different nodes in privacy protection. Then, by aggregating the information of neighboring nodes through weighted aggregation, the weighted privacy latent representation \(\widetilde{Z_{p}}\) can be obtained as:  
\[\widetilde{Z_{p}}=attn_{p}\cdot V=softmax\left(\frac{QK^{T}}{\sqrt{d_{k}}} \right)\cdot V, \tag{13}\]  
where \(attn_{p}\in R^{n\times n}\) is attention score matrix, and \(attn_{p_{ij}}\) represents the importance of node \(j\) to node \(i\) in terms of privacy protection. Summing the columns of \(attn_{p}\) yields the global importance of nodes for privacy protection, which can be mathematically written as:  
\[\alpha_{p}\ =\sum_{i=1}^{n}attn_{p}[\cdot,j],\quad\forall j\in\{1,2,\ldots,n\}, \tag{14}\]  
where \(\alpha_{p}\) is the node privacy importance score.