Introduction
Knowledge Graphs (KGs) represent facts as triplets (subject, relation, object), such as Sunnyvale — state — California. The goal of Knowledge Graph Embedding (KGE) is to map these entities and relations into a continuous vector space. Traditional KGE methods, like TransE or RotatE, represent entities as static vectors, which often fails to capture the multifaceted nature of an entity's role within different contexts. HittER addresses this by using a hierarchical Transformer architecture to aggregate an entity's local neighborhood into a dynamic, contextualized representation.
Hierarchical Architecture
HittER employs a two-tier Transformer design to process an entity's neighborhood efficiently:
- Entity Transformer (Bottom Block): This layer extracts features from individual entity-relation pairs in the local neighborhood. It effectively "packs" the interaction between a neighbor and its connecting edge into a single vector.
- Context Transformer (Top Block): This layer aggregates the outputs from the bottom block. It treats the source entity and its various neighborhood vectors as a sequence, using self-attention to decide which neighbors are most relevant for a given prediction.
Masked Entity Prediction (MEP)
A core innovation in HittER is the Masked Entity Prediction task. Inspired by BERT’s Masked Language Modeling, MEP involves randomly masking or replacing the source entity during training. This forces the model to "recover" the identity of the source entity using only its neighbors, ensuring the model truly learns to utilize the relational context rather than overfitting to the source entity's static embedding.
Experimental Evaluation
The authors evaluated HittER on two primary tasks:
- Link Prediction: Using the dense FB15K-237 dataset and the sparser WN18RR dataset.
- Factoid Question Answering (QA): Using FreebaseQA and WebQuestionsSP to test how well HittER embeddings can ground a pre-trained language model like BERT.
Key Results and Discussion
HittER achieved state-of-the-art performance on both FB15K-237 and WN18RR. Notably, on WN18RR, it achieved a Mean Reciprocal Rank (MRR) of .503, a substantial jump over previous geometric-based methods.
Key Insights
- Efficiency through Hierarchy: A flat Transformer over a large neighborhood would be computationally expensive ($O(n^2)$). HittER’s hierarchy reduces sequence length for the top-level Transformer, making deep neighborhood aggregation feasible.
- Context for Disambiguation: The model showed significant gains on complex "one-to-many" relations, where the specific context of a neighbor is vital for accurate prediction.
- Downstream Utility: When integrated with BERT via cross-attention, HittER improved accuracy on the filtered FreebaseQA dataset from 30.8% to 37.1%, demonstrating that structured graph knowledge can directly enhance natural language understanding.
Conclusion and Future Work
HittER demonstrates the power of applying deep, expressive Transformers to structured graph neighborhoods. While currently limited to 1-hop neighborhoods, the model's success suggests that extending this to multi-hop paths could further improve performance. Future research will also focus on scaling these hierarchical methods to massive, industrial-scale knowledge graphs.
Summary updated