Paper commentary
LINE: Large-scale Information Network Embedding
LINE embeds million-node information networks by preserving local and global structure
- Problem Most graph embedding methods do not scale to real information networks with millions of nodes. Classical methods like MDS and Laplacian eigenmaps need at least quadratic time in the number of vertices.
- Method LINE optimizes an objective that preserves first-order and second-order proximity, using edge sampling. Instead of scaling gradients by edge weight, it samples edges in proportion to their weights and treats each draw as a binary edge.
- Results LINE learns embeddings for networks with millions of vertices and billions of edges in a few hours on a single machine. On word analogy it scored 66.10 overall, compared to 63.02 for SkipGram.
Why embedding large networks is hard
Classical methods such as MDS, IsoMap and Laplacian eigenmap need at least quadratic time in the number of vertices. They work by solving for leading eigenvectors of affinity matrices, which is why they stall on large graphs. Newer scalable options either take an indirect route or come without a clear objective for networks. What is missing is a model with a clear objective for network structure and an efficient optimizer.
Observed links cover only a small share of the real relationships between vertices. A method that relies only on those links therefore misses many similarities that are real but unrecorded.
Preserving direct ties and shared neighbors
The central move is to embed each vertex so that two kinds of closeness survive: direct ties and shared neighborhoods. The first kind is the weight of a direct edge, which the authors call first-order proximity. The second kind compares how similar two vertices' rows of first-order weights are, which the authors call second-order proximity.
Two vertices with no link between them can still be close if they share many neighbors. In the toy example, vertices 5 and 6 are unlinked but share many neighbors, so they should land near each other. The second-order proximity complements the first-order one, because it fills in the gaps that sparse links leave.
From proximities to two loss functions
For an undirected edge, the model defines a probability between two vertices from the dot product of their vectors: \(p_1(v_i,v_j)=\frac{1}{1+\exp(-\vec u_i^{T}\vec u_j)}\). The empirical probability is the edge weight divided by the total weight, \(\hat p_1(i,j)=\frac{w_{ij}}{W}\), and the model minimizes the KL-divergence between the two distributions.
After dropping constants, the first-order objective becomes \(O_1=-\sum_{(i,j)\in E} w_{ij}\log p_1(v_i,v_j)\), minimized over the vertex vectors. The leading minus sign means that minimizing this loss raises the probability of the observed edges, and the objective applies only to undirected graphs.
For the second-order proximity, each vertex has a vertex vector \(\vec u_i\) and a separate context vector \(\vec u'_i\). The probability of context \(v_j\) given \(v_i\) is a softmax over all vertices, \(p_2(v_j|v_i)=\frac{\exp(\vec u'^{T}_j\vec u_i)}{\sum_{k=1}^{|V|}\exp(\vec u'^{T}_k\vec u_i)}\). The empirical conditional is \(\hat p_2(v_j|v_i)=\frac{w_{ij}}{d_i}\), and the authors weight each vertex by its degree as a stand-in for prestige.
Dropping constants gives \(O_2=-\sum_{(i,j)\in E} w_{ij}\log p_2(v_j|v_i)\), and only the vertex vectors \(\vec u_i\) are kept as the final embedding.
The simple route used in practice is to train the first-order and second-order objectives separately and concatenate the two embeddings for each vertex. Training the two objectives jointly is left for future work.
Making the second-order objective trainable at scale
Computing the second-order probability needs a sum over every vertex, which is too costly at millions of nodes. Negative sampling replaces that sum: each observed edge is paired with K negative edges drawn from a noise distribution. The noise distribution is proportional to the out-degree raised to the power 3/4, written \(P_n(v)\propto d_v^{3/4}\).
For the first-order objective, the authors avoid a trivial solution by using the vertex vector in place of the context vector in the negative term.
Training uses asynchronous stochastic gradient descent, which updates the parameters from a mini-batch of sampled edges at each step. The gradient for a sampled edge is multiplied by its weight \(w_{ij}\). In a word co-occurrence network, weights can range from one to hundreds of thousands, so no single learning rate suits both small and large weights.
One fix is to unfold a weight-w edge into w binary edges, but that multiplies the memory needed. Edge sampling avoids that cost: draw edges with probability proportional to their weights and treat each draw as a binary edge. An alias table makes each draw constant-time after a one-time build, instead of costing time linear in the number of edges.
Each step costs O(dK) with K negative samples, and the number of steps is taken as proportional to |E|.
Low degree vertices and newly arrived vertices
Second-order embeddings need many contexts, so vertices with few neighbors are hard to place accurately. The fix is to add second-order neighbors, the neighbors of neighbors, with weight \(w_{ij}=\sum_{k\in N(i)}\frac{w_{ik}w_{kj}}{d_k}\). In practice only the neighbors with the largest proximity to the low-degree vertex are added.
A new vertex with known links gets its vector by minimizing the same objectives over its neighbors, while the existing vectors stay fixed. A vertex with no observed links can't be placed this way and needs other information, such as text, which the paper leaves for future work.
Datasets, baselines and settings
The language network is a word co-occurrence graph from English Wikipedia, where words within a 5-word sliding window co-occur. Words with frequency below 5 are filtered out, and Flickr, Youtube and two DBLP-based citation networks complete the set. The Wikipedia network has 1,985,098 vertices and 1,000,924,086 edges, while Youtube has 1,138,499 vertices, 2,990,443 edges and an average degree of 5.25.
The baselines are graph factorization, DeepWalk and LINE-SGD, the last of which optimizes the same objectives directly with SGD. On the word tasks the authors also compare SkipGram, a word embedding model trained on the Wikipedia pages. LINE(1st+2nd) is applied only to supervised tasks, because the dimension weights are fitted from training data.
The language embeddings have 200 dimensions and the other networks have 128, with K = 5 negative samples. The starting learning rate is 0.025 and decays linearly with the number of samples.
Word analogy and word-based classification
On word analogy, LINE(2nd) led every method in the table with 66.10 overall, compared to 63.02 for SkipGram. Graph factorization scored 51.93 and DeepWalk 43.65 in the same table. The authors attribute the gain to second-order proximity matching words that can replace each other in the same context.
Plain SGD breaks the same objective: LINE-SGD(1st) scored 8.50 overall, compared to 53.35 for LINE(1st).
Document vectors are simple averages of word vectors, a deliberate choice that isolates the quality of the word embeddings. On Wikipedia page classification at 10% training, LINE(1st+2nd) reached 81.04 Micro-F1, compared to 79.63 for graph factorization. At 90% training the gap is 83.74 against 81.78, and the authors read the gain as the two proximities being complementary.
Social network multi-label classification
On Flickr with 10% of vertices labeled, LINE(1st+2nd) reached 63.20 Micro-F1, compared to 60.38 for DeepWalk. At the same setting LINE(1st) scored 63.27 and LINE(2nd) 62.83, so first-order proximity is slightly ahead on this network. The authors attribute this to strong ties mattering more in social graphs, and to second-order estimates becoming inaccurate when neighbors are few.
Youtube averages 5.25 neighbors per vertex, which leaves second-order estimates thin. At 1% labeled, LINE(2nd) scored 32.98, compared to 39.68 for DeepWalk.
The authors expanded vertices with degree below 1,000 by adding neighbors of neighbors until each had 1,000 nodes. On this reconstructed network LINE(2nd) reached 36.78 at 1%, compared to 32.98 on the original network. After reconstruction LINE(2nd) beats DeepWalk in most cases, which the authors contrast with random walks that go depth-first and can add distant nodes.
Directed citation networks
First-order methods don't apply to directed graphs, so only DeepWalk and LINE(2nd) were compared on the citation networks. On DBLP paper citation at 10% training, LINE(2nd) reached 58.42 Micro-F1, compared to 52.83 for DeepWalk. The authors explain that random walks along citations reach only older papers, while LINE(2nd) represents each paper by its references.
On the DBLP author citation network, DeepWalk led LINE(2nd) at the original density. After expanding vertices with degree below 500, LINE(2nd) reached 64.69 at 10%, compared to 63.98 for DeepWalk. Plain SGD on this network reached 56.64 at 10%, compared to 62.49 for LINE(2nd) with edge sampling.
Co-author network layouts
The authors built a co-author network of 18,561 authors and 207,074 edges from papers at WWW, KDD, NIPS, ICML, CVPR and ICCV. They mapped the embeddings to two dimensions with t-SNE and judged the layouts by how well colors group together. Graph factorization gives a layout where communities don't cluster, and DeepWalk pulls many authors from different fields into the centre.
The authors attribute the central clump to noise from random walks around high-degree vertices, while LINE(2nd) gives a layout where same-colored nodes sit closer together.
Sparsity, degree and dimension effects
On Flickr, LINE(1st) leads while the network is very sparse, and LINE(2nd) overtakes it as more links are kept. The authors conclude that second-order proximity suffers when the network is extremely sparse.
Grouped by degree, LINE(2nd) beats LINE(1st) on the original Youtube network in every group except the lowest-degree one. On the reconstructed network LINE(2nd) beats DeepWalk in all degree groups.
Performance of LINE(1st) and LINE(2nd) drops when the dimension becomes too large. LINE(2nd) stays ahead of LINE(1st) and DeepWalk across sample counts, and both LINE variants converge faster than DeepWalk.
Running time and multi-thread speed-up
On Wikipedia, LINE(2nd) took 2.55h and LINE(1st) took 2.44h, compared to 16.64h for DeepWalk. Both LINE variants finished in under 3 hours on a single machine with 40 CPU cores at 2.0GHZ using 16 threads. The authors report that these runs are at least 10% faster than graph factorization and that DeepWalk is about five times slower.
The LINE-SGD variants were slightly slower, because a threshold-cutting step was needed to stop the gradients from exploding. On Youtube, the speed-up with threads is close to linear, and Micro-F1 stays stable as threads are added.
Open limits and future work
The first-order and second-order embeddings are combined by concatenation, and joint training of the two objectives is not tested. A new vertex with no observed connections can't yet be embedded, and the textual-information remedy is not explored.
Second-order accuracy drops on very sparse networks, as the Flickr subset results show. Without reconstruction, LINE(2nd) falls behind DeepWalk on the sparse Youtube network, reaching 32.98 at 1% against 39.68 for DeepWalk.
LINE(1st+2nd) is applied only to supervised tasks, and the dimension has to be chosen with care, since large dimensions reduce accuracy. Future work includes higher-order proximity and heterogeneous networks with multiple vertex types.
Paper info
- Authors
- Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, Qiaozhu Mei
- Venue
- arXiv · Preprint
- First published
- 2015-3-12
- Added
- 2026-11-11
- Updated
- 2015-3-12
- Version
- v1
- arXiv
- 1503.03578
- DOI
- 10.1145/2736277.2741093
- Category
- cs.LG
- Original paper terms
- Check in the original ↗
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, Qiaozhu Mei (2015). LINE: Large-scale Information Network Embedding. arXiv:1503.03578v1. https://doi.org/10.1145/2736277.2741093
BibTeX
@article{tang2015line,
title = {{LINE: Large-scale Information Network Embedding}},
author = {Jian Tang and Meng Qu and Mingzhe Wang and Ming Zhang and Jun Yan and Qiaozhu Mei},
year = {2015},
eprint = {1503.03578},
archivePrefix = {arXiv},
doi = {10.1145/2736277.2741093},
url = {https://arxiv.org/abs/1503.03578v1}
}