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

Random Entity Quantization for Parameter-Efficient Compositional Knowledge Graph Representation

Jiaang Li, Quan Wang, Yi Liu, Licheng Zhang, Zhendong Mao

Abstract

Traditional Knowledge Graph Embedding (KGE) models face significant scalability challenges as the number of entities grows into the millions, leading to parameter-heavy architectures. Compositional models like NodePiece and EARL address this by representing entities as combinations of codewords from a fixed codebook. However, these models typically rely on complex, hand-crafted quantization strategies to map entities to codewords. This paper investigates the necessity of these strategies and proposes Random Entity Quantization (RQ). We demonstrate that replacing sophisticated connectivity-based rules with simple random assignments maintains or improves performance while increasing parameter efficiency. Our analysis suggests that the primary driver of success in compositional models is entity distinguishability—facilitated by high entropy—rather than the semantic structure of the quantization strategy itself.

Introduction

Knowledge Graphs (KGs) are essential for representing structured world knowledge, yet their scale poses a fundamental problem for machine learning. Standard KGE models assign a unique, high-dimensional vector to every entity, resulting in a linear growth of parameters relative to the graph size. For massive KGs, this makes deployment on standard hardware nearly impossible.

To mitigate this, "compositional" models were developed. These frameworks represent entities as a set of "codewords" (such as nearby anchor entities or specific relation types) drawn from a small, fixed codebook. By doing so, they decouple the number of parameters from the number of entities. However, these models have historically relied on intricate "quantization" strategies—using metrics like PageRank or graph distance—to determine which codewords should represent which entity. This research questions whether this complexity is justified or if a simpler, stochastic approach could suffice.

Methods: Random Entity Quantization (RQ)

The researchers propose Random Entity Quantization (RQ) as a "lazy" alternative to structured mapping. Instead of calculating connectivity-based weights or selecting anchors based on graph topology, they experiment with several randomized variants:

  • Random Matching: Entities are assigned to random relations (+RSR) or random anchor entities (+RSA) regardless of their actual neighborhood in the graph.
  • Random Weights: Instead of weighting codewords based on graph distance, the model uses random (+RW) or equal (+EW) weights.
  • Fully Random (+RQ): A codebook of arbitrary vectors is created, and entities are assigned to these vectors randomly, effectively treating the code as a unique but non-semantic identifier.

To evaluate why these methods work, the study focuses on distinguishability—the ability of the model to tell two entities apart based on their codes. This is measured via Entropy (the diversity of the resulting codes) and Jaccard Distance (the degree of overlap between codeword sets for different entities).

Experimental Setup

The study evaluates RQ across several standard benchmarks to ensure robustness:

  • Transductive Benchmarks: FB15k-237 (world facts), WN18RR (lexical relations), and CoDEx-L (a large-scale, challenging dataset).
  • Inductive Benchmarks: An inductive version of FB15k-237 was used to test the model's ability to generalize to previously unseen entities.

Key Insights and Results

The Distinguishability Paradox

The core finding of the paper is that sophisticated quantization strategies often lead to "over-clustering." When two entities share similar graph neighborhoods, connectivity-based strategies assign them nearly identical codes. This makes it difficult for the downstream encoder to distinguish between them. Randomness, conversely, spreads entities more uniformly across the available "code space," maximizing entropy and ensuring that each entity has a more unique signature.

Performance and Efficiency

The experimental results show that the "lazy" random approach frequently outperforms expert-designed strategies:

  • Competitive Accuracy: On FB15k-237, the fully random EARL+RQ achieved a Mean Reciprocal Rank (MRR) of 0.311, slightly exceeding the original EARL's 0.310.
  • Parameter Efficiency: EARL+RQ reduced the parameter count from 1.8 million to 1.4 million, improving the efficiency score (MRR per parameter) from 0.172 to 0.222.
  • Scalability: On the large-scale CoDEx-L dataset, random variants consistently matched or outperformed hand-crafted versions, proving that the approach scales effectively to complex graphs.
  • Inductive Generalization: Even in settings where the model must represent entities not seen during training, random quantization performed on par with structured methods like NodePiece.

The Role of the Encoder

These results suggest a shift in how we view compositional models. The heavy lifting is not performed by the quantization strategy, but by the encoder (the neural network, such as an MLP or CompGCN, that processes the codes). As long as the encoder receives a sufficiently unique and high-entropy "ID" for an entity, it can learn an effective representation, regardless of whether that ID carries inherent semantic meaning from the graph structure.

Conclusion and Future Work

This research demonstrates that current entity quantization strategies in compositional KGE models are largely over-engineered. By embracing randomness, practitioners can build models that are simpler to implement, more parameter-efficient, and more effective at distinguishing between entities.

However, the authors note that while random is better than current heuristics, it is likely not the theoretical optimum. Future research should focus on developing quantization methods that explicitly maximize entity distinguishability and information entropy. Additionally, as more advanced encoders are developed, it remains to be seen if they might eventually benefit from more structured, non-random input information.

Summary updated

BibTeX
@inproceedings{li2023random,
  author = {Jiaang Li and Quan Wang and Yi Liu and Licheng Zhang and Zhendong Mao},
  title = {{Random Entity Quantization for Parameter-Efficient Compositional Knowledge Graph Representation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.177},
}
Figure