Graph Representation Learning
January 31st, 2026
CS60078
Features from Graphs
Traditional ML for Graphs
Graph Representation Learning
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Graph Representation Learning
Goal: Efficient task-independent feature learning for machine learning with graphs!
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Why Embedding?
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Example Node Embedding
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Setup
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Embedding Nodes
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Connection with Language Modeling
Connection with Language Modeling
Let’s look at representation learning for words
One-hot-encoding
In traditional NLP / IR, words are treated as discrete symbols.
Vector dimension = number of words in vocabulary (e.g., 500,000)
Problems with words as discrete symbols
Example: In web search, if user searches for “Baltimore motel”, we would like
to match documents containing “Baltimore hotel”. But
The vectors are orthogonal, and there is no natural notion of similarity between
one-hot vectors!
Solution: Can we learn to encode similarity in the vectors themselves?
Word Vectors - One-hot Encoding
Suppose our vocabulary has only five words: King, Queen, Man, Woman, and Child.
We could encode the word ‘Queen’ as:
Word2Vec – A distributed representation
Distributional Representation
elements.
and a word, the representation of a word is spread across all of the
elements in the vector, and
Distributional Representation: Illustration
If we label the dimensions in a hypothetical word vector (there are no such
pre-assigned labels in the algorithm of course), it might look a bit like this:
Such a vector comes to represent in some abstract way the ‘meaning’ of a word
Learning Word Vectors: Overview
Two Variations: CBOW and Skip-grams
Word2Vec (Skip-gram) Overview
Example windows and process for computing P(wt+j |wt )
Word2Vec (Skip-gram) Overview
Example windows and process for computing P(wt+j |wt )
Word2Vec: objective function
Understanding P(o|c) further
Try this problem
Issues with word2Vec
e.g., negative sampling
Node Embeddings: Shallow Encoding
Slide Courtesy: Jure Leskovec, Stanford CS224W
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Node Embeddings: Two Key Components
Slide Courtesy: Jure Leskovec, Stanford CS224W
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
“Shallow” Encoding
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
“Shallow” Encoding
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Shallow Encoding
Simplest encoding approach: Encoder is just an embedding-lookup
Each node is assigned a unique
embedding vector
(i.e., we directly optimize
the embedding of each node)
Many methods: DeepWalk, node2vec
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Node Embeddings: Random Walk-Based
Slide Courtesy: Jure Leskovec, Stanford CS224W
Given a graph and a starting
point, we select a neighbor of it at random, and move to this neighbor; then we select a neighbor of this point at
random, and move to it, etc.
The (random) sequence of
points visited this way is a
random walk on the graph.
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Random Walk Embeddings
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Unsupervised Feature Learning
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Feature Learning as Optimization
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Random Walk Optimization
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Random Walk Optimization
Lecture 4: Complex Networks, IIT KGP, Somak Aditya
Node Embeddings: Random Walk-Based
Slide Courtesy: Jure Leskovec, Stanford CS224W
Lecture 4: Complex Networks, IIT KGP, Somak Aditya