# Representation Learning on Graphs: Methods and Applications

Learned graph embeddings replace hand-built features for machine learning on graphs

William L. Hamilton, Rex Ying, Jure Leskovec · arXiv · 2017-9-17

- **Problem** Hand-built graph features like degrees and kernel values are rigid and slow to design. They can't adapt while the model learns, so models miss the structure they need.
- **Method** The authors train an encoder to map each node to a low-dimensional vector, so that a decoder's pairwise score matches graph similarity.
- **Results** Cited studies found neighborhood aggregation encoders gave consistent gains over shallow encoders on node classification and link prediction.

## Why graph structure is hard to feed into models

Graphs capture relational knowledge, and many prediction tasks use graph structure as their input signal. Traditional pipelines feed in degrees, clustering coefficients or kernel values that someone designed by hand. Such features can't adapt while the model learns, and designing them takes time and money.

The core difficulty is that graph structure is high-dimensional and non-Euclidean, so it has no direct feature vector. Representation learning gets around this by mapping nodes or subgraphs into a low-dimensional space and tuning that mapping so distances reflect the graph. The learned vectors then serve as features for downstream tasks such as node classification.

## One encoder-decoder view for node embeddings

The key idea is to split every node embedding method into an encoder that produces vectors and a decoder that tries to recover graph similarity from them. The encoder maps each node to a vector z\_i in R^d, and d is far smaller than \|V\|. The decoder takes a pair of embeddings and returns a similarity score, so that \\(DEC(z\_i, z\_j) \\approx s\_G(v\_i, v\_j)\\) for a graph-based similarity \\(s\_G\\).

Training minimizes a loss \\(L=\\sum\_{(v\_i,v\_j)\\in D} \\ell(DEC(z\_i,z\_j), s\_G(v\_i,v\_j))\\) over a set of training node pairs D. Four choices then separate the methods: the similarity function, the encoder, the decoder and the loss. Most decoders have no trainable parameters, so the learning sits almost entirely in the encoder.

Once trained, the encoder alone produces the features, for example for a logistic regression classifier that predicts communities. A few methods also train decoder parameters, which the authors treat as a side variant of the same scheme.

## Shallow embeddings and random-walk objectives

In a shallow encoder each node simply gets its own column of a matrix Z, selected by a one-hot indicator vector. The only trainable parameters are the entries of Z, so the embedding matrix is optimized directly. Laplacian eigenmaps uses squared Euclidean distance as its decoder and weights each pair by graph similarity.

Factorization methods such as Graph Factorization, GraRep and HOPE switch to an inner-product decoder with a mean-squared-error loss. They differ only in the similarity they use: the adjacency matrix, its powers, or other neighborhood overlap measures. Graph Factorization is scalable, with O(\|E\|) time complexity for generating node embeddings.

DeepWalk and node2vec replace the deterministic similarity with co-occurrence on random walks, and they decode with a softmax over all nodes. The walk length T usually falls in the range 2,...,10. Computing that softmax naively costs O(\|D\|\|V\|), so DeepWalk uses hierarchical softmax and node2vec uses negative sampling.

node2vec adds two parameters, p and q, that bias the walk: p controls revisiting the same node and q controls revisiting a node's one-hop neighborhood. LINE takes a different route: a sigmoid decoder for first-order similarity and a two-hop objective for second-order similarity.

## Neighborhood aggregation encoders

Shallow lookups share no parameters, ignore node attributes and can't embed nodes that were absent during training. Aggregation encoders instead build each node's vector from its neighbors' attributes, so the same weights serve every node. Where no attributes exist, degrees or one-hot vectors can stand in as inputs.

Algorithm 1 starts from the input attributes and runs K rounds of aggregation over neighbor vectors. Each round combines a node's own vector with the aggregated neighbor vector, applies a weight matrix and a non-linearity, then normalizes. The vectors after the final round serve as the output embeddings, so information from farther nodes reaches each node after more rounds.

GraphSAGE concatenates the two vectors and accepts general aggregators such as the element-wise mean, max-pooling networks and LSTMs. GCNs and column networks use a weighted sum and a weighted element-wise mean instead, and column networks add an interpolation with the previous vector. The more complex aggregators, especially max-pooling, gave significant gains in the GraphSAGE study.

Across node classification and link prediction benchmarks, these encoders gave consistent gains over their shallow counterparts. That support comes from results gathered across cited works, so it isn't one controlled comparison run by the authors. The shared parameter count doesn't grow with the size of the graph, which is why these encoders scale better than lookup tables.

## Limits of shallow and autoencoder methods

Shallow methods grow their parameter count as O(\|V\|) and are transductive. They can't produce embeddings for unseen nodes without additional optimization, which hurts evolving graphs.

Their structure is also fixed, so they stay strictly transductive and can't generalize across graphs.

Naive spectral graph convolutions need the eigenvectors of the graph Laplacian, so their cost is O(\|V\|^3). Approximations with Chebyshev polynomials avoid this, but they are a separate set of methods.

## Multi-layer graphs and structural roles

Multi-layer graphs repeat the same node across layers, so a node's embeddings in different layers should stay close. OhmNet combines node2vec with a penalty \\(\\lambda\\\|z^{G1}\_i - z^{G2}\_i\\\|\\) that ties a node's embeddings across two layers. For layers in a hierarchy, that penalty applies only between parent and child layers.

For several edge types, a bilinear decoder with a learned matrix per type replaces the plain inner product. Regularizing that matrix, for example by making it diagonal, helps when there are many edge types.

HARP coarsens the graph, embeds the coarse version and uses those vectors to initialize the finer embeddings. The authors report consistent improvements for DeepWalk, node2vec and LINE with this pre-processing.

struc2vec targets structural roles by building auxiliary graphs whose edge weights accumulate degree-sequence distances between k-hop neighborhoods. The recursion is \\(w\_k(v\_i,v\_j)=w\_{k-1}(v\_i,v\_j)+d(R\_k(v\_i),R\_k(v\_j))\\), and biased random walks then run on these auxiliary graphs.

## Subgraph embeddings and graph neural networks

For subgraphs the target is one vector z\_S for an induced subgraph, usually used for classification. Most subgraph methods are fully supervised, so they are trained with a cross-entropy loss.

Convolutional molecular fingerprints sum the node embeddings in the subgraph, giving \\(z\_S=\\sum\_{v\_i\\in S} z\_i\\). Dai et al. add edge embeddings before summing, and their encoder takes inspiration from loopy belief propagation. Graph coarsening layers instead cluster nodes and combine them with element-wise max-pooling.

The original graph neural network iterates message passing until the embeddings converge, which requires the update function to be a contraction map. Gated Graph Neural Networks replace that iteration with gated recurrent units and use node attributes to initialize the embeddings. Message Passing Neural Networks generalize these models with a message function q and an update function U.

Subgraph embeddings are mostly used to classify molecules, for example to predict the therapeutic effect of candidate drugs. They have also been applied to classifying images converted to graphs and to logical reasoning tasks.

## Open problems

The field still lacks a consistent theoretical framework that precisely states the goals of graph representation learning. Most work aims at strong scores on classification and link prediction benchmarks, and sometimes at pleasing visualizations. The authors warn that the spread of disparate benchmarks and conceptual models is a real risk to progress.

## Paper info

- **Authors**: William L. Hamilton, Rex Ying, Jure Leskovec
- **Venue**: arXiv · Preprint
- **First published**: 2017-9-17
- **Added**: 2026-11-12
- **Updated**: 2018-4-10
- **Version**: v3
- **arXiv**: 1709.05584
- **Category**: cs.SI · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1709.05584v3) · [PDF ↗](https://arxiv.org/pdf/1709.05584v3)

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

William L. Hamilton, Rex Ying, Jure Leskovec (2017). Representation Learning on Graphs: Methods and Applications. arXiv:1709.05584v3. https://arxiv.org/abs/1709.05584v3

**BibTeX**

```
@misc{hamilton2017representation,
  title = {{Representation Learning on Graphs: Methods and Applications}},
  author = {William L. Hamilton and Rex Ying and Jure Leskovec},
  year = {2017},
  eprint = {1709.05584},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.05584v3}
}
```

## Related papers

- [Graph Embedding Techniques, Applications, and Performance: A Survey](https://refivu.com/en/papers/eeed1384-bf87-452c-b3b1-9ecc6ce7d43b-graph-embedding-techniques-applications-and-performance-a.md)
- [node2vec: Scalable Feature Learning for Networks](https://refivu.com/en/papers/dc0725e4-ec21-4d60-9363-0eac2fc69a10-node2vec-scalable-feature-learning-for-networks.md)
- [LINE: Large-scale Information Network Embedding](https://refivu.com/en/papers/395ad92f-93c2-44fe-8480-bbf8df48c4cf-line-large-scale-information-network-embedding.md)
- [A Comprehensive Survey of Graph Embedding: Problems, Techniques and Applications](https://refivu.com/en/papers/ec23e11b-6984-4611-aa20-93a65865b536-a-comprehensive-survey-of-graph-embedding-problems.md)
- [Inductive Representation Learning on Large Graphs](https://refivu.com/en/papers/ff5e1161-efee-4eaf-8a5b-ca4227613b73-inductive-representation-learning-on-large-graphs.md)
- [Distributed Representations of Words and Phrases and their Compositionality](https://refivu.com/en/papers/3b76539e-2654-42d7-9073-06bc84af912a-distributed-representations-of-words-and-phrases-and-their.md)

## Other paper commentary

- [Deep Learning Face Representation by Joint Identification-Verification](https://refivu.com/en/papers/1824448e-2edd-4d03-a6b5-1fbd92b71da3-deep-learning-face-representation-by-joint-identification.md)
- [Curiosity-driven Exploration by Self-supervised Prediction](https://refivu.com/en/papers/93936438-d2c7-4a12-b814-3073185546ca-curiosity-driven-exploration-by-self-supervised-prediction.md)
- [ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders](https://refivu.com/en/papers/d6599a02-0aa8-4eec-a1c3-2bdc45716f23-convnext-v2-co-designing-and-scaling-convnets-with.md)
- [Person Re-identification by Local Maximal Occurrence Representation and Metric Learning](https://refivu.com/en/papers/ce1c4e84-0a27-40a3-8d69-3dc923b2cf52-person-re-identification-by-local-maximal-occurrence.md)
- [UNITER: UNiversal Image-TExt Representation Learning](https://refivu.com/en/papers/c2b71a61-22ad-48f9-af71-922539fd9eab-uniter-universal-image-text-representation-learning.md)
- [Learning Face Representation from Scratch](https://refivu.com/en/papers/c66cea99-ee67-42f0-85f5-a773fc796f34-learning-face-representation-from-scratch.md)
- [AutoML: A Survey of the State-of-the-Art](https://refivu.com/en/papers/c151a283-ee30-4b90-ae39-a522aa0cfc5f-automl-a-survey-of-the-state-of-the.md)
- [Pyramid Stereo Matching Network](https://refivu.com/en/papers/30a53566-121d-41b6-baca-53b0c10d01cc-pyramid-stereo-matching-network.md)
- [FEVER: a large-scale dataset for Fact Extraction and VERification](https://refivu.com/en/papers/59763d9c-0c11-477a-89ee-abea10ff28a0-fever-a-large-scale-dataset-for-fact-extraction.md)
- [Large Language Models: A Survey](https://refivu.com/en/papers/d8a3f692-1bfe-4a26-b530-c20397434b3c-large-language-models-a-survey.md)
- [Mastering Diverse Domains through World Models](https://refivu.com/en/papers/97c93a7e-84fd-435c-8ada-e4d14f8b7ef3-mastering-diverse-domains-through-world-models.md)
- [FAST-LIO2: Fast Direct LiDAR-inertial Odometry](https://refivu.com/en/papers/401ff61a-2475-494b-b01d-b01a805546db-fast-lio2-fast-direct-lidar-inertial-odometry.md)

## Terms in this paper

- [link prediction](https://refivu.com/en/terms/f029f4345f8f-link-prediction)
- [Graph Neural Networks](https://refivu.com/en/terms/0650d076a410-graph-neural-networks)
- [GraphSAGE](https://refivu.com/en/terms/c4baff75600a-graphsage)
- [DeepWalk](https://refivu.com/en/terms/6f5bcebcffef-deepwalk)
- [Graph Convolutional Networks](https://refivu.com/en/terms/44efaa9b9eb8-graph-convolutional-networks)
- [Node classification](https://refivu.com/en/terms/d5c2990db2b3-node-classification)
- [Laplacian eigenmaps](https://refivu.com/en/terms/de45f3ff5b8e-laplacian-eigenmaps)
- [LINE](https://refivu.com/en/terms/94e45777fb4b-line)
- [neighborhood aggregation](https://refivu.com/en/terms/27a0d5e536c4-neighborhood-aggregation)
- [node2vec](https://refivu.com/en/terms/56209922221d-node2vec)
- [DNGR](https://refivu.com/en/terms/22ec7ad609bd-dngr)
- [Gated Graph Neural Networks](https://refivu.com/en/terms/98e0a9100937-gated-graph-neural-networks)
- [HOPE](https://refivu.com/en/terms/9b30a3c9d49d-hope)
- [representation learning](https://refivu.com/en/terms/897b5b9d997e-representation-learning)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/3ca2c648-5d7e-46c2-be1e-357cc66ab085-representation-learning-on-graphs-methods-and-applications)
