Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

node2vec: Scalable Feature Learning for Networks

node2vec learns node features by sampling neighborhoods with biased random walks

  • Problem Earlier unsupervised node embedding methods fix one rigid notion of neighborhood. That misses the mix of community and structural role patterns that real networks show.
  • Method node2vec steers a biased random walk with p and q to sample neighborhoods.
  • Results On BlogCatalog, node2vec scored 0.2581 Macro-F1, compared to 0.2110 for DeepWalk.

Why network features are hard to learn

Prediction over nodes and edges starts with a feature vector for every node and edge. Hand-engineered features are tailored to one task, so they rarely carry over to another. Learning the features instead is the alternative, and the hard part is choosing the objective.

A supervised objective fits the downstream task well, but it adds so many parameters that training becomes slow. A purely unsupervised objective is cheaper to optimize, which is the route the authors take. The classic unsupervised route, dimensionality reduction, needs eigendecomposition, which is expensive on large networks. Its latent representations also perform poorly on prediction tasks over networks.

Recent methods that preserve local neighborhoods are efficient, but each one fixes a single notion of neighborhood. Because that notion is rigid, these methods stay largely insensitive to connectivity patterns that are specific to networks. No single sampling strategy wins across all networks and all prediction tasks, so a fixed strategy is a real shortcoming.

Nodes can be grouped by community, which is homophily, or by structural role, which is structural equivalence. In Figure 1, u and s1 share a community, while u and s6 share the role of a hub. Real networks usually mix both principles, so a useful method has to capture both.

Biased walks as a flexible neighborhood

The key idea is to define a node's neighborhood by a random walk that can be steered. Two parameters tilt the walk toward staying local or moving outward, so one sampler can imitate either extreme. The walk, not a fixed rule, decides which nodes count as the neighborhood.

The two extremes are breadth-first sampling, which keeps only immediate neighbors, and depth-first sampling, which moves away from the source. For a neighborhood of three nodes around u in Figure 1, BFS takes s1, s2 and s3, while DFS takes s4, s5 and s6. BFS suits structural equivalence because a node's role can be read from its immediate surroundings, but it sees only a small part of the graph.

DFS covers more of the network and suits homophily, but its samples vary more and can be less representative.

The walk starts at a source node u and runs for a fixed length l, with each next node drawn from unnormalized transition weights. The weight of each step depends on the node visited just before the current one, which makes the walk second order. For an edge from v to x, the weight is \( \pi_{vx} = \alpha_{pq}(t,x) \cdot w_{vx} \), where t is the previous node and \( w_{vx} \) is the static edge weight.

The bias \( \alpha_{pq}(t,x) \) equals \( 1/p \) when x is t itself, 1 when x is a neighbor of t, and \( 1/q \) when x is two hops from t. The weights are divided by a normalizing constant Z to give the step probabilities.

The return parameter p controls how often the walk immediately returns to t, and a high p makes that less likely. The in-out parameter q decides whether the walk stays near t or leaves it, with q above 1 keeping it close and q below 1 pushing it outward. Setting p and q to 1 gives the uniform walk of DeepWalk, which is why DeepWalk is a special case of node2vec.

From walks to node features

Each node's feature vector is fit so that it predicts the nodes in its sampled neighborhood, following the Skip-gram idea. The objective maximizes the sum over nodes of the log-probability of each neighborhood given the node's features. \[ \max_f \sum_{u \in V} \log \Pr(N_S(u) \mid f(u)) \] Two simplifying assumptions make this tractable: neighbors are conditionally independent given the source, and each source-neighbor pair is scored by a softmax over dot products.

The per-node partition function \( Z_u = \sum_{v \in V} \exp(f(u)\cdot f(v)) \) is expensive for large graphs. Negative sampling approximates it, and the objective is optimized by stochastic gradient ascent over the feature parameters.

The pipeline has three phases: compute transition weights, simulate walks, and then optimize the features. From every node the method simulates r walks of length l, so each node starts r walks. Each step draws the next node by alias sampling, which takes constant time once the transition weights are precomputed. A single walk of length l > k yields k samples for each of l - k nodes, so the samples are reused.

The default settings in the experiments are d = 128, r = 10, l = 80 and k = 10, with one optimization epoch.

For link prediction the method needs a representation of a node pair, so it combines the two node feature vectors with a binary operator. Table 1 lists four operators: average, Hadamard (element-wise product), weighted-L1 and weighted-L2. Each operator keeps the dimension at d, and the authors define them for any pair of nodes, whether or not an edge exists.

Les Misérables case study

The authors use a character coappearance network from Les Misérables, with 77 nodes and 254 edges. They learn 16-dimensional features (d = 16), cluster them with k-means, and color the network by cluster. With p = 1 and q = 0.5, the colors follow communities of characters who interact in the same sub-plots.

With p = 1 and q = 2, the clusters follow the roles the authors call bridges and periphery. The blue cluster holds characters who bridge sub-plots, and the yellow cluster holds peripheral characters with few interactions. This evidence is visual and qualitative, so it shows that the parameters move the clusters but gives no score for either assignment.

Multi-label classification results

The authors feed node features into one-vs-rest logistic regression with L2 regularization and split the data over 10 random instances. The p and q values are tuned on 10% labeled data over the grid {0.25, 0.5, 1, 2, 4}, and the authors report a p-value below 0.01 over 10 seeds. To keep the comparison fair, each method generates an equal number of samples, and DeepWalk is switched to negative sampling.

On BlogCatalog with 50% of nodes labeled, node2vec scored 0.2581 Macro-F1, compared to 0.2110 for DeepWalk. That is a gain of 22.3% over DeepWalk, and the gain over LINE on the same network is 229.2%. The authors attribute LINE's weak showing to its inability to reuse samples, which random walks allow.

Over LINE on PPI the gain is 23.8%.

Varying the labeled fraction from 10% to 90% shows node2vec ahead of DeepWalk and LINE on most networks. The largest gain over DeepWalk is 26.7% on BlogCatalog at 70% labeled data. Gains over LINE reach 41.1% on PPI when only 10% of the nodes are labeled.

Link prediction results

Positive examples are edges removed at random while the residual network stays connected, and negative examples are node pairs with no edge. The heuristics Common Neighbors, Jaccard's Coefficient, Adamic-Adar and Preferential Attachment score each pair from the neighbor sets of its two nodes. The authors test on Facebook with 4,039 nodes and 88,234 edges, along with PPI and arXiv ASTRO-PH.

On arXiv the AUC improvement of node2vec over the best baseline, Adamic-Adar, is 12.6%. With the Hadamard operator node2vec scores 0.9680 AUC on Facebook, which equals DeepWalk and is above Jaccard's Coefficient at 0.8880. With the average operator the heuristics stay ahead on Facebook, with node2vec at 0.7266, so the choice of operator matters.

Across the three networks, node2vec beats DeepWalk and LINE, with gains up to 3.8% and 6.5% at each algorithm's best operator. The exceptions are a couple of cases with the Weighted-L1 and Weighted-L2 operators, where LINE does better. The Hadamard operator is the most stable choice for node2vec and gives the best average across the networks.

Sensitivity, perturbation and scale

On BlogCatalog with a 50-50 split, one parameter is varied at a time while the others keep defaults, with p and q at 1 by default. Performance improves as p and q decrease, which the authors link to the homophily and structural equivalence they expect in BlogCatalog. Macro-F1 tends to saturate once the feature dimension reaches around 100.

More walks per node and longer walks help, which is expected from the larger sampling budget, and a larger context size k helps at the cost of longer optimization.

When edges are removed at random with the number of connected components held fixed, Macro-F1 falls roughly linearly with a small slope. When noisy edges are added between random node pairs, the score drops faster at first, and then the decline slows down. The authors frame both results as relevant to evolving networks and to networks built from noisy measurements.

On Erdos-Renyi graphs with constant average degree 10, runtime grows roughly linearly with the number of nodes. One million nodes take less than four hours, and preprocessing is negligibly small compared with the walks. Negative sampling and asynchronous SGD keep the optimization phase efficient.

Limitations and open questions

Reusing walk samples across source nodes can introduce some bias, although the authors observe that it greatly improves efficiency. BFS explores only a very small part of the graph for a given k, and DFS has high variance when the neighborhood is large. Tuning p and q needs labeled data, so the method is semi-supervised rather than fully unsupervised.

The experiments use three multi-label networks, BlogCatalog, PPI and Wikipedia, and three link prediction networks, Facebook, PPI and arXiv ASTRO-PH. The parameter search uses one grid and 10% labeled data, and the paper does not test other grids or label fractions for it. The authors leave open heterogeneous networks, networks with domain features, signed edges, and why the Hadamard operator works best.

Paper info

Authors
Aditya Grover, Jure Leskovec
Venue
arXiv · Preprint
First published
2016-7-3
Added
2026-11-11
Updated
2016-7-3
Version
v1
arXiv
1607.00653
Category
cs.SI · cs.LG · stat.ML
Original paper terms
arXiv non-exclusive 1.0
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

Aditya Grover, Jure Leskovec (2016). node2vec: Scalable Feature Learning for Networks. arXiv:1607.00653v1. https://arxiv.org/abs/1607.00653v1

BibTeX
@misc{grover2016node2vec,
  title = {{node2vec: Scalable Feature Learning for Networks}},
  author = {Aditya Grover and Jure Leskovec},
  year = {2016},
  eprint = {1607.00653},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1607.00653v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up