TL;DR
LightGCN is a recommender that gives every user and every item a vector of numbers, then sharpens those vectors by repeatedly averaging each user's vector with the vectors of the items they interacted with, and each item's vector with the users who touched it. It has no weight matrices and no nonlinearity, so the only numbers it learns are the starting vectors. It was built to show that the extra parts of a graph convolution network are not needed for recommendation, and it beats the heavier model it was compared with by about 16.5 percent on average across three datasets.
Builds on: Graph Convolutional Network, Node Embedding, Implicit Feedback · Leads to: LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation
Where it's used
Recommendation is the task. A shop wants to show a shopper the products they are most likely to buy next, and the only data it has is a long list of who bought, clicked or viewed what. Think of that list as a bipartite graph: users on one side, items on the other, an edge for each interaction. LightGCN was designed for exactly this graph and was tested on three public datasets built from real platforms: Gowalla (check-ins at places), Yelp2018 (business reviews) and Amazon-Book (book purchases and reviews). On those three benchmarks it outperformed every other method the paper compared it against.
The same graph shape appears wherever two kinds of things meet through actions: listeners and songs, readers and articles, patients and drugs in a licensed database, students and courses. Any time you can draw "this one touched that one" as an edge, a LightGCN-style model can learn from it. The three benchmarks have between about 30,000 and 52,000 users and between about 38,000 and 92,000 items, so the model was tested on graphs with tens of thousands of nodes on each side.
How it works
Take the smallest possible graph: one user u and one item i, joined by one edge. We will give each of them a single number instead of a vector, so every step is plain arithmetic. We will run two layers of propagation.
- Start with ID embeddings. Each node gets a learned starting value, a ID embedding. Say the user starts at 2 and the item starts at 4. These two numbers are the only trainable parameters in the whole model.
- Propagate to the other side. The user's new value is a weighted average of the values of the items it touched. Here the user touched one item, so it takes that item's value, scaled by a factor that is 1 for a node with one neighbour. The item does the same with the user. After one layer: the user is 4 and the item is 2. The two values have swapped. Check: the user took the item's 4, and the item took the user's 2.
- Propagate again. Do the same swap from the layer-1 values. The user takes the item's layer-1 value of 2, and the item takes the user's layer-1 value of 4. After two layers the values are back where they started: the user is 2 and the item is 4. A 2-layer model on a single edge does nothing new, which is a good sanity check to keep in mind.
- Combine the layers. LightGCN does not use the last layer alone. It averages all layers, including layer 0, with equal weight of one third each for two layers. The user's final value is (2 + 4 + 2) divided by 3, which is 8 over 3. The item's final value is (4 + 2 + 4) divided by 3, which is 10 over 3.
- Score the pair. The score is the product of the two final vectors. Here that is 8 over 3 times 10 over 3, which is 80 over 9, about 8.9. A higher score means the model thinks the user is more likely to interact with the item.
The key feature is what is absent. There is no matrix multiplying the vectors, no bend like a ReLU between layers, and no self-loop that says "keep your own value". The graph does all the work, and the learning happens only on the starting values in step 1. Stacking more layers spreads information further across the graph, and the final average keeps a node from drifting too far from its own starting value.
flowchart LR A["ID embeddings e(0) for all users and items"] --> B["Layer 1: average over neighbours, no weights, no bend"] B --> C["Layer 2: average again"] C --> D["Weighted sum of layers 0 to K"] D --> E["Score = dot product of user and item vectors"] E --> F["Train e(0) with BPR loss on observed vs unobserved pairs"]
The math
We have a user set of size M and an item set of size N. Let R be the M by N matrix with entry 1 where a user interacted with an item and 0 otherwise. Let be the set of items user u interacted with, and the set of users who interacted with item i. Their sizes and are the degrees of the nodes.
Let and be the learned ID embeddings. For layers , each line computing the next layer from the current one:
The final embedding is the weighted sum , with the same form for items, and the prediction is .
Step 2 in symbols
The swap in step 2 is the rule with one neighbour on each side. With , the factor is , and the sum has one term, so . In words: the new user value is the old item value.
Step 4 in symbols
The layer weights are . With that is each. The paper's own choice is this uniform weight, and it is the setting the experiments used. The matrix form is compact: write , where is the adjacency matrix of the user-item graph, with users and items as one set of nodes, and is the diagonal matrix of degrees. Then the final embedding matrix is . Each power of is one more hop across the graph.
The training loss
The only parameters are . Training uses the Bayesian Personalized Ranking loss (BPR), which pushes the score of an observed pair above the score of an unobserved pair:
Here is the sigmoid and sets the strength of the L2 penalty. The only regulariser is this penalty on the starting embeddings, since there are no weight matrices to regularise and no dropout.
Worked examples
Use the single-edge graph from "How it works", with starting values and , and so .
- Layer 1 for the user: take the item's starting value, 4. So .
- Layer 1 for the item: take the user's starting value, 2. So .
- Final user: .
- Final item: .
- Score: .
Interpretation: the two nodes end with the same final value, which is what happens when a single edge links them and the layers are weighted equally. The score is large because both nodes ended up with values of 3.
Users and , items and . Interactions: with and ; with only. So the degrees are , , , . Starting values: , , , . Use , .
- Layer 1 for : the neighbours are and . The factor for is , times , giving 0. The factor for is , times 1, giving 0.5. Total: .
- Layer 1 for : the only neighbour is , factor , times 1. So .
- Layer 1 for : the only neighbour is , factor , times 1. So .
- Layer 1 for : neighbours and . From : factor 0.5, times 1, giving 0.5. From : factor , times 0, giving 0. Total: .
- Final vectors: , , , .
- Scores: with gives . with gives . with gives . with gives .
Interpretation: ranks first, which it already interacted with. Every user-item pair gets a score, including pairs with no edge, which is how the model ranks items the user has not yet touched. The lowest score is with , a pair with no direct edge between them; the only route between them runs through three hops, so the signal reaches it weakly. In practice the recommender would recommend the highest-scoring items the user has not already seen.
The paper's main table reports recall at 20 on the Gowalla dataset: NGCF reaches 0.1570, LightGCN reaches 0.1830. Compute the relative improvement.
- Difference: .
- Divide by the baseline: .
- Convert to percent: about 16.6 percent, which matches the paper's 16.56 percent.
Now the Amazon-Book dataset, where NGCF's recall is 0.0344 and LightGCN's is 0.0411.
- Difference: .
- Divide by the baseline: .
- Convert to percent: about 19.5 percent.
Interpretation: a relative gain of this size on a metric that is already small (0.04 recall means 4 percent of held-out items are found in the top 20) is a large practical improvement. The two numbers are the paper's own best-setting scores, not a comparison at matched layer counts.
Try it: a single user and a single item, one edge, starting values and , but now with and . Find the final score .
Answer: layer 1 gives user 4 and item 2. Layer 2 swaps again: user gets item's layer-1 value 2, item gets user's layer-1 value 4. Final user is . Final item is . Score .
Common mistakes and tradeoffs
It is tempting to think that a graph network needs nonlinear layers and weight matrices to learn anything useful. In fact, for collaborative filtering the nodes have only an ID and no features, so there is nothing for a weight matrix to transform. The paper's ablation on NGCF shows that removing both the weight matrices and the nonlinearity improves recall on its benchmarks, so the extra parts were not helping this task.
It is tempting to think that the last layer is the best representation, because a deeper network should be more refined. In fact, averaging over all layers works better, because each layer captures a different scale of neighbourhood. The paper finds that a model that uses only the last layer peaks around layer 2 and then gets worse as higher-order neighbours dominate, while the averaged LightGCN keeps improving as layers are added.
It is tempting to think that more layers always help. In fact the gain from the first layer is the largest, and it shrinks after that. The paper's satisfactory setting is 3 layers in most cases, and the trend across 1 to 4 layers is a slow rise rather than a steady climb.
It is tempting to think that the graph convolution needs a self-loop, a term that keeps a node's own value. In fact the layer-weighted sum already includes the layer-0 value, which plays the same role, so LightGCN omits self-loops altogether.
When to use it: when your data is a bipartite interaction graph with only IDs for nodes, as in implicit feedback from clicks or purchases, and you want a model that is as easy to train as matrix factorization but can use multi-hop neighbours. When not to use it: when nodes carry rich features such as text, images or demographic attributes. Then a feature-transforming graph network can earn its extra parts, because a weight matrix has real input to work on. Alternatives include plain matrix factorization for a fast baseline, and the neural model in Neural Collaborative Filtering when you believe the dot product is too restrictive.
History
Matrix factorization was the dominant recommender approach for years: give each user and item a vector and predict with a dot product. Papers such as the one by Koren, Bell and Volinsky in 2009 set this out. Researchers then noticed that a user's history is a graph, and that neighbours in the graph carry signal. Graph convolution networks, introduced by Kipf and Welling at ICLR 2017 for classifying nodes in graphs with rich features, gave a clean way to aggregate neighbours.
In 2019, Wang and colleagues proposed Neural Graph Collaborative Filtering (NGCF), which applied a full graph convolution with weight matrices and nonlinearities to the user-item graph and reached state-of-the-art results at the time. The LightGCN authors ran controlled ablations on NGCF, removing its feature transformations and nonlinearity, and found that the simpler variants recommended better. That work led to LightGCN, published at SIGIR in 2020. Related work the authors cite, such as the simplified GCN of Wu and colleagues in 2019 and the APPNP model of Klicpera and colleagues in 2019, had shown that a linear propagation can work for node classification, and LightGCN carried the same idea into recommendation with no weights at all.
Recap
- A user-item interaction table is a bipartite graph, and each user and item can be given a learned ID vector.
- A LightGCN layer replaces each node's vector with a degree-normalised sum of its neighbours' vectors, with no weights and no nonlinearity.
- The final vector is a weighted average of all layers, with uniform weights of 1 over (K + 1) in the paper, which avoids over-smoothing.
- The score is a dot product, and training uses BPR loss with an L2 penalty on the starting embeddings only.
- Removing the feature transformations and nonlinearities from NGCF improved recommendation accuracy on the paper's benchmarks.
Read next: the paper walkthrough in LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation, and the earlier graph model it simplifies, Graph Convolutional Network.
Check yourself
QuestionRecall: in LightGCN what are the only trainable parameters, and why is that enough?Show answer
The only trainable parameters are the layer-0 ID embeddings, one vector for each user and each item. The propagation has no weights, so these vectors are the whole model, and the L2 penalty on them is enough to prevent overfitting. It has the same number of parameters as matrix factorization with the same embedding size.
QuestionCompute: one user and one item joined by one edge, starting values 6 for the user and 2 for the item, K = 1, uniform layer weights. What score does the model give?Show answer
Layer 1: the user takes 2 and the item takes 6. Final user is (6 + 2)/2 = 4. Final item is (2 + 6)/2 = 4. Score is 4 times 4, which is 16.
QuestionWhy does LightGCN average over all layers instead of using only the last one?Show answer
Using only the last layer over-smooths the embeddings when there are many layers, because repeated averaging pulls neighbouring nodes toward the same value. Averaging over all layers keeps the layer-0 value, which holds each node's own identity, and mixes in layers that capture different neighbourhood sizes. The paper finds the averaged model keeps improving with depth while a last-layer-only model degrades.
QuestionScenario: a team has user-item clicks plus product descriptions and images for every item. Would you expect LightGCN's no-weights design to be the best choice? Explain.Show answer
Probably not as the whole answer. The no-weights design is justified because ID nodes have no content to transform. Here each item has rich features, so a model with feature transformations (and a nonlinearity) has real input to learn from. LightGCN could still serve as a strong collaborative-filtering signal, or a baseline to beat, but the paper's argument does not carry over to feature-rich nodes.
Sources
- He, Deng, Wang, Li, Zhang and Wang, LightGCN, SIGIR 2020: https://arxiv.org/abs/2002.02126
- Kipf and Welling, Semi-Supervised Classification with Graph Convolutional Networks, ICLR 2017: https://arxiv.org/abs/1609.02907