LightCAKE: A Lightweight Framework for Context-Aware Knowledge Graph Embedding

Zhiyuan Ning, Ziyue Qiao, Hao Dong, Yi Du, Yuanchun Zhou

Abstract

Knowledge Graph Embedding (KGE) models are essential for link prediction and knowledge discovery. However, traditional models often ignore the structural context surrounding entities and relations, while modern Graph Neural Network (GNN) approaches are computationally expensive. We present LightCAKE, a lightweight framework that introduces context-awareness to KGE models without adding heavy parameter sets. By utilizing iterative, parameter-free aggregation and specialized Context Star Graphs, LightCAKE significantly improves the performance of baseline models, outperforming many GNN-based alternatives.

The Problem: Context-Blind Embeddings

Knowledge Graphs (KGs) store information as triplets: (head entity, relation, tail entity). Standard KGE models like TransE or DistMult map these components into a continuous vector space. A major limitation of these models is their "isolationist" view; they evaluate each triplet independently, ignoring the surrounding graph structure.

Illustration of Entity and Relation Context in a Knowledge Graph.

As shown in the figure above, context is vital for disambiguation. An entity like "Joe Biden" is defined not just by a single fact, but by his relationship to the "USA," his predecessors like "Donald Trump," and his political party. Without this "Entity Context," models struggle to differentiate between similar entities. Similarly, "Relation Context" helps define a relation by the types of entity pairs it typically connects (e.g., "president_of" usually connects a person to a country).

While GNNs can capture this context, they are often too "heavy" for real-world applications, introducing massive amounts of new trainable parameters and complex calculations that hinder scalability.

Methodology: The LightCAKE Framework

LightCAKE addresses these issues through a lightweight, iterative framework. Instead of the $d^2$ weight matrices typical of GNNs, LightCAKE reuses the base model's scoring function to perform context aggregation, making it highly efficient.

  1. Context Star Graphs: The framework constructs two specialized structures. The Entity Context Star Graph captures the immediate neighborhood of an entity, while the Relation Context Star Graph captures the typical entity pairs associated with a specific relation.
  2. Iterative Aggregation: LightCAKE uses a parameter-free mechanism to update embeddings. It employs a softmax-based attention mechanism where the "attention" weights are derived directly from the base model's scoring function (e.g., subtraction for TransE or multiplication for DistMult).
  3. Refinement: The process runs for $L$ iterations (typically 4), allowing information to propagate through the graph and refine entity and relation representations simultaneously.
The LightCAKE framework: building Entity and Relation Context Star Graphs from a Knowledge Graph.

Key Results and Insights

The authors evaluated LightCAKE on four benchmark datasets: WN18RR, FB15K-237, NELL995, and DDB14. The primary task was relation prediction, where the model must predict the missing relation between two known entities.

  • Significant Performance Gains: Adding context-awareness via LightCAKE provides substantial boosts. For instance, when applied to DistMult on the WN18RR dataset, the Mean Reciprocal Rank (MRR) jumped from 0.865 to 0.955.
  • Efficiency Over Complexity: LightCAKE consistently outperformed R-GCN (a popular GNN-based model) while using far fewer parameters and less computation time. This proves that a "lightweight" approach can beat "heavyweight" specialized models.
  • Dual-Context Synergy: The research highlights that modeling both entity and relation context provides a significant performance boost compared to modeling entity context alone.

Limitations and Future Work

While effective, LightCAKE is sensitive to the number of iterations; performance peaks at around 4 iterations before "over-smoothing" occurs, where the model incorporates noise from distant, uncorrelated parts of the graph. Future work may explore more flexible encoding functions and broader generalization to even more complex scoring functions.

Conclusion

LightCAKE demonstrates that heavy architectures are not always necessary for capturing graph context. By elegantly reusing base model scoring functions for attention and focusing on local "star" neighborhoods, the framework provides a scalable and highly effective way to enhance Knowledge Graph Embeddings.

Summary updated

BibTeX
@inproceedings{ning2021lightcake,
  author = {Zhiyuan Ning and Ziyue Qiao and Hao Dong and Yi Du and Yuanchun Zhou},
  title = {{LightCAKE: A Lightweight Framework for Context-Aware Knowledge Graph Embedding}},
  booktitle = {PAKDD},
  year = {2021},
  doi = {10.1007/978-3-030-75768-7\_15},
}
Figure