---
title: 'Disentangled HAN: GNN Recommender for HIN'
url: https://www.emergentmind.com/topics/disentangled-han-disenhan
type: topic
---

# Disentangled HAN: GNN Recommender for HIN

Disentangled HAN (DisenHAN) is a graph neural recommendation architecture for heterogeneous information networks (HINs) that explicitly disentangles node representations into semantically independent aspect subspaces, learning aspect-wise propagation weights for each meta-relation. Compared to conventional heterogeneous graph neural networks, DisenHAN enables both higher accuracy and greater interpretability by identifying the main aspect to which each meta-relation contributes in the user/item embedding, thus isolating collaborative signals specific to popularity, category-preference, brand-loyalty, social influence, and related latent factors [2106.10879].

## 1. Problem Formulation and Notation

DisenHAN operates on an HIN represented as $\mathcal{G} = (\mathcal{V}, \mathcal{E})$, where $\mathcal{V}$ is a set of nodes and $\mathcal{E}$ is a set of edges. Each node $v \in \mathcal{V}$ is assigned a type via $\phi: \mathcal{V} \to \mathcal{A}$ ($\mathcal{A}$ is the set of node types, e.g., User, Item, Brand, Category), and each edge $e \in \mathcal{E}$ is assigned a meta-relation via $\psi: \mathcal{E} \to \mathcal{R}$ ($\mathcal{R}$ is the set of edge types, e.g., interacts, belongs_to, friend_of). 

The main entities of interest are sets of users $\mathcal{U} = \{u_1, \ldots, u_M\} \subset \mathcal{V}$ and items $\mathcal{I} = \{v_1, \ldots, v_N\} \subset \mathcal{V}$; the observed user-item implicit feedback is denoted $Y \in \{0,1\}^{M \times N}$. The central goal is to learn a scoring function
\[
\hat y_{uv} = \mathcal{F}(u, v \mid \Theta, \mathcal{G})
\]
that ranks items $v$ for each user $u$ using disentangled (aspect-wise) representations.

## 2. Disentangled Embedding Representation

Each node $v$ embeds into $K$ latent “channels” (aspects), separating sources of collaborative signal into independent subspaces. Given node features $x_v \in \mathbb{R}^{d_{\text{in}}}$, the projection for channel $k$ at layer $l$ is
\[
c_{v,k}^{(l)} = \frac{\sigma(W^{(l)}_{\phi(v),\,k} x_v)}{\| \sigma(W^{(l)}_{\phi(v),\,k} x_v) \|_2}
\]
where $W^{(l)}_{\phi(v),k} \in \mathbb{R}^{d_{\text{in}} \times d_{\text{out}}}$ is type- and channel-specific, and $\sigma$ is an activation (e.g., ReLU). This normalization confines each channel’s embedding to a unit hypersphere, supporting intra- and inter-node compatibility learning.

Disentangling these embeddings is critical for robustness and for interpretability, as it isolates how much each meta-relation contributes to particular aspects (e.g., distinguishing social and category influences).

## 3. Meta-Relation Decomposition

DisenHAN leverages meta-relations at the edge level, not extended meta-paths. Each edge $(s,t)$ is labeled as $\langle\phi(s), \psi(e), \phi(t)\rangle$. For target node $t$, the set $\mathcal{N}_\psi(t)$ contains all $s$ such that $(s,t)$ is of meta-relation $\psi$. 

Rather than building an explicit adjacency tensor $\mathbf{A} \in \{0,1\}^{|\mathcal{R}| \times |\mathcal{V}| \times |\mathcal{V}|}$, DisenHAN handles edges grouped by relation type. This design supports multi-layer composition of meta-relational evidence, enabling automatic construction of higher-order semantic signals through propagation, avoiding hand-crafted meta-path enumeration.

## 4. Disentangled Embedding Propagation Layer

Each layer propagates aspect-specific signals in two phases: intra-relation (within one meta-relation) and inter-relation (across meta-relations), using learnable attention and an EM-style clustering approach for aspect assignment.

### Intra-Relation Aggregation

Attention weights are computed for channel $k$ from $t$ to neighbor $s \in \mathcal{N}_\psi(t)$, per meta-relation $\psi$:
\[
e_{t,s}^{k,\psi} = \mathrm{ReLU}\left( \alpha_{\psi}^\top [z_{t,k}^{(l-1)} \Vert c_{s,k}^{(l)} ] \right)
\]
where $\alpha_\psi$ is a relation-specific vector, and $\Vert$ denotes concatenation.

A prior aspect weight $r_{\psi,k}^{(l-1)}$ modulates the aggregation:
\[
e_{t,s}^\psi = \sum_{k=1}^K r_{\psi,k}^{(l-1)} \, e_{t,s}^{k,\psi}
\]
Softmax normalization yields attention $\alpha_{t,s}^\psi$, and neighbor feature aggregation per channel is
\[
z_{t,k}^{\psi,(l)} = \sigma\left( \sum_{s\in\mathcal{N}_\psi(t)} \alpha_{t,s}^\psi c_{s,k}^{(l)} \right)
\]

### Inter-Relation Aggregation

Relation-channel scores are computed per channel $k$:
\[
\hat r_{\psi,k}^{(l)} = q_{\psi}^\top \tanh(W z_{t,k}^{\psi,(l)})
\]
Aspect-assignments are normalized:
\[
r_{\psi,k}^{(l)} = \frac{\exp(\hat r_{\psi,k}^{(l)})}{\sum_{k'=1}^K \exp(\hat r_{\psi,k'}^{(l)})}
\]
The updated channel embedding (with self-loop) is
\[
z_{t,k}^{(l)} = \frac{
    c_{t,k}^{(l)} + \sum_{\psi \in \mathcal{R}_t} r_{\psi,k}^{(l)} W z_{t,k}^{\psi, (l)}
}{
    \Bigl\| c_{t,k}^{(l)} + \sum_{\psi} r_{\psi,k}^{(l)} W z_{t,k}^{\psi,(l)} \Bigr\|_2
}
\]
This EM-style process aligns each meta-relation with a dominant aspect assignment, promoting stable, semantically meaningful clustering of relational signal into the disentangled channels.

## 5. Multi-Layer Architecture and Aspect-wise Collaborative Filtering

By stacking $L$ such disentangled propagation layers, each node’s channels $z_{v,k}^{(L)}$ can integrate $L$-hop information with increasing semantic abstraction (often decreasing channel count by layer: $K^{(1)} \geq K^{(2)} \geq \cdots$). 

The final user-item (aspect-wise) matching is
\[
s_{uv} = \sum_{k=1}^K (z_{u,k}^{(L)})^\top z_{v,k}^{(L)}
\]
Each aspect channel thereby contributes additively to the total affinity score, enforcing explicit aspect attribution in the recommendation.

## 6. Training Objective

For top-$N$ recommendation, DisenHAN uses binary cross-entropy loss with negative sampling. Probabilities are computed as $\hat y_{uv} = \sigma(s_{uv}) = \frac{1}{1 + e^{-s_{uv}}}$. The training loss is
\[
\mathcal{L} = -\sum_{(u,v)\in\mathcal{Y}} \log \hat y_{uv}
      - \sum_{(u,v^-)\in\mathcal{Y}^-} \log(1 - \hat y_{uv^-})
      + \lambda \| \Theta \|_2^2
\]
where $\mathcal{Y}$ is the set of observed positives, $\mathcal{Y}^-$ are sampled negatives, and $\lambda$ regularizes all parameters $\Theta$. Mini-batch Adam is used for optimization.

## 7. Empirical Results and Interpretability

DisenHAN was benchmarked on Yelp, Amazon-Electronics, and MovieLens-HetRec datasets, compared to classical CF (BPR-MF, NeuMF), HIN models with fixed meta-paths (FMG\(_{\text{rank}}\), MCRec, NeuACF), and GNNs without disentanglement (GC-MC, NGCF) or with fixed meta-paths (HAN) [2106.10879]. DisenHAN achieved the highest Prec@10, Recall@10, and NDCG@10 on all datasets, exceeding the best prior methods by $2\%$–$10\%$ in relative improvement. 

Its advantage is most pronounced in sparse regimes (cold-start conditions with $20\%$–$60\%$ observed interactions), validating that aspect-wise disentanglement of propagation delivers more robust collaborative signals. Ablation studies reveal that failing to disentangle ($K=1$) significantly degrades performance, and an aspect count $K\approx5$ is optimal; excessive channels lead to overfitting. Only a small number ($I \approx 5$) of EM iterations per layer are necessary, with two propagation layers ($L=2$) typically optimal.

Aspect assignment weights $r_{\psi,k}$ provide direct interpretability: for example, in Amazon-Electronics, user-item relations cluster under one aspect

Source: https://www.emergentmind.com/topics/disentangled-han-disenhan