NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Knowledge Graph Embedding Compression

Mrinmaya SachanACL 2020

Abstract

Large-scale Knowledge Graphs (KGs) often require massive embedding tables that grow linearly with the number of entities, hindering deployment on resource-constrained devices. This paper presents a novel compression framework that represents entities as sequences of discrete "KD codes." By utilizing an autoencoder-style architecture with non-linear reconstruction and a "guidance" training strategy, the proposed method achieves 50x to 1000x compression with minimal performance loss, and in some cases, improved generalization.

Introduction

Knowledge Graphs like Freebase and WordNet are foundational to modern AI applications, including search engines and dialogue systems. However, traditional embedding methods (e.g., TransE, RotatE) assign a unique continuous vector to every entity, leading to a memory footprint that scales linearly with the graph's size. This scaling problem results in astronomical parameter counts for KGs with millions of entities, causing overfitting on sparse data and preventing deployment on mobile hardware.

This research addresses the inherent redundancy in KG embeddings. Many entities share semantic similarities and do not require entirely unique, high-dimensional parameter sets. By discretizing the embedding space, the authors demonstrate that the semantic structure of KGs can be preserved at a fraction of the original memory cost.

Methodology

The proposed framework replaces standard embedding lookup tables with a two-stage system involving discretization and reconstruction.

Discretization and Reconstruction

Entities are mapped into a $K$-way $D$-dimensional code (KD code), representing each entity as a discrete sequence. The paper evaluates two primary discretization methods: Vector Quantization (VQ) and Tempering Softmax (TS), the latter of which allows for end-to-end gradient-based learning.

To reconstruct continuous embeddings from these codes, the authors compare a linear Codebook Lookup (CL) against a Non-linear Reconstruction (NL) approach. The NL method utilizes a Bi-LSTM to capture complex dependencies within the code sequence, consistently outperforming linear alternatives by better capturing the compositional nature of the discrete representations.

The Guidance Strategy

To stabilize training and ensure convergence, the authors introduce a "guidance" mechanism. This involves a form of knowledge distillation where the discrete model is initially trained to mimic pre-trained continuous embeddings. As training progresses, the model is gradually annealed to rely solely on its internal discrete representations.

Figure 1: Impact of the guidance strategy on model convergence. The guided approach reaches higher MRR significantly faster than training from scratch.

Experimental Results

The approach was evaluated on standard benchmarks, including FB15k, FB15k-237, WN18, and WN18RR. The results demonstrate that the model can achieve massive compression ratios—ranging from 42x to over 950x—while maintaining performance parity with uncompressed baselines.

Performance and Sensitivity

On the FB15k dataset, the compressed TransE model achieved a Mean Reciprocal Rank (MRR) of 0.477, surpassing the original continuous baseline of 0.463. This improvement is likely due to the regularizing effect of the discrete bottleneck, which prevents overfitting on rare entities. Sensitivity analysis shows that performance scales predictably with the codebook size ($K$) and sequence length ($D$).

Figure 2: MRR sensitivity to hyperparameters K (codebook size) and D (sequence length). Performance improves as the capacity of the discrete representation increases.

Conclusion

By representing entities as discrete sequences, this framework enables the deployment of large-scale Knowledge Graphs on mobile devices with negligible performance trade-offs. The learned codes are not only efficient but also semantically interpretable, clustering similar entities automatically. Future work may extend these techniques to relation compression and explore more complex reconstruction architectures like Transformers to further push the limits of KG embedding efficiency.

Summary updated

BibTeX
@inproceedings{sachan2020knowledge,
  author = {Mrinmaya Sachan},
  title = {{Knowledge Graph Embedding Compression}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.238},
}
Figure