Introduction
In modern social media analysis, representing users through network embeddings is essential for tasks like link prediction and community detection. However, traditional methods often treat relationships as simple binary connections, ignoring the nuanced "signed" nature of social interactions—where links can represent trust (positive) or distrust (negative). Furthermore, as networks scale to millions of nodes, the computational cost of similarity searches in continuous vector spaces becomes prohibitive.
This paper introduces HSNE (Deep Hashing for Signed Social Network Embedding), the first deep hashing framework specifically designed for signed social networks. HSNE addresses the dual challenges of search efficiency and structural information preservation by learning compact binary hash codes that incorporate both positive and negative relationship signals.
Problem Statement
Existing network embedding techniques face two primary hurdles in large-scale signed environments:
- Search Efficiency: Finding similar nodes in a continuous high-dimensional space typically requires $O(n^2)$ complexity, making real-time retrieval impossible for massive datasets.
- Information Loss: Most hashing methods ignore negative links. In signed networks, structural balance theory (e.g., "the enemy of my friend is my enemy") provides critical context. Neglecting these signals leads to suboptimal embedding quality.
The HSNE Framework
The HSNE architecture consists of three integrated components designed to transform raw network triplets into discriminative binary codes.
1. Network Feature Learning
The model utilizes a deep neural network comprising an embedding layer followed by three fully connected layers ($L=3$). It processes node triplets $(v_i, v_j, v_k)$, where $v_i$ and $v_j$ share a positive link, and $v_i$ and $v_k$ share a negative link. Shared weights across the triplet paths ensure a consistent latent space. Deeper networks were found to be significantly harder to train without yielding better embeddings.
2. Hash Code Learning
A final layer employs a sign function ($sgn$) to map continuous features into binary hash codes $\{-1, +1\}^d$. This discrete representation enables extremely fast similarity searches using Hamming distance.
3. Custom Triplet Loss Function
To optimize the network, the authors propose a loss function that minimizes the distance between positively linked nodes while maximizing the distance between negatively linked ones. Because the sign function is non-differentiable, a "relaxation" trick is used, employing the inner product as a proxy for Hamming distance during backpropagation. Additionally, a quantization error penalty is included to minimize information loss during the continuous-to-binary conversion. For nodes lacking negative links, "virtual nodes" are introduced as synthetic negative anchors to ensure robust learning.
Experimental Evaluation
The framework was evaluated on two benchmark signed datasets:
- Epinions: A dense network of product reviewers (~131k users, 85.3% positive links).
- Slashdot: A sparser network of users tagging friends and foes (~77k users, 76.7% positive links).
Results and Discussion
HSNE demonstrates significant improvements over existing hashing baselines. In link prediction tasks on the Epinions dataset, HSNE achieved an AUC of 0.8145, substantially outperforming Node2Hash (0.7353). While continuous models like SNE maintain a raw accuracy lead, HSNE provides a highly competitive alternative with superior retrieval speed. Furthermore, the model's performance is influenced by the choice of link representation operator, with the Hadamard product and L1/L2 norms proving most effective for aligning with Hamming distance properties.
A key finding is the model's sensitivity to the hyperparameter $\eta$, which balances the triplet loss against quantization error. As shown in the figure above, performance on the Slashdot dataset peaks at specific $\eta$ values (around 0.55 to 1.0) before declining, particularly for higher bit-lengths. This highlights the importance of careful tuning to maintain the trade-off between discriminative power and binary fidelity.
Conclusion and Future Work
HSNE successfully bridges the gap between the rich structural information of signed networks and the efficiency of binary hashing. The inclusion of negative links was found to improve the prediction of both "friends" and "foes." Future research will focus on closing the remaining accuracy gap between binary and continuous embeddings, integrating node attributes (such as user profiles), and automating hyperparameter optimization for varying network densities.
Summary updated