Abstract
Commonsense Knowledge Graph Completion (CKGC) aims to predict missing links in graphs like ConceptNet and ATOMIC. Traditional methods often struggle with "long-tail" entities or rely on sub-optimal manual text prompts. We present ATAP (Automatic Template-Augmented Completion), a framework that transforms link prediction into a masked language modeling task using automatically learned continuous vector templates. By optimizing "pseudo-tokens" in a continuous space, ATAP achieves state-of-the-art performance, demonstrates superior handling of rare entities, and exhibits faster convergence than existing graph-based approaches.
Introduction
Commonsense Knowledge Graphs (CKGs) are vital for enabling AI systems to reason about everyday scenarios. However, these graphs are frequently incomplete. Existing completion methods generally fall into two categories: triple-based methods, which rely on graph structure and struggle with infrequent "long-tail" entities, and text-based methods, which leverage Pre-trained Language Models (PLMs). While text-based methods handle rare concepts better, they often depend on manual or discrete prompts that are labor-intensive and mathematically sub-optimal for neural network optimization.
ATAP addresses these limitations by replacing discrete word prompts with trainable "continuous" vector templates. This approach allows the model to learn more expressive representations of relations, leading to significant improvements in link prediction accuracy and efficiency.
Methodology
The ATAP framework consists of two primary components: Continuous Prompt Automatic Generation (CPAG) and Prediction via Masked Language Modeling (MLM).
Continuous Prompt Automatic Generation (CPAG)
Instead of using natural language words, ATAP utilizes "pseudo-tokens"—trainable vectors ($v_1, v_2, \dots, v_k$) that do not correspond to a fixed vocabulary.
- Triple Classification: Triples are first categorized by their relation type (e.g., AtLocation, UsedFor). This ensures that the learned templates are relation-specific, which is crucial for performance.
- Prompt Encoder: A bidirectional RNN (Bi-RNN) coupled with a Multi-Layer Perceptron (MLP) learns the dependencies between pseudo-tokens. This process generates a mathematically optimized template for each specific relation.
Prediction via MLM
The link prediction task is reformulated as an MLM task. The system splices the head entity embedding, the relation-specific continuous prompt, and a [MASK] token. A PLM (such as BERT-large) is then used to predict the most likely tail entity at the masked position. By training the prompt vectors directly, the model learns a flexible way to query the PLM's internal knowledge.
Experiments and Results
The framework was evaluated on two major benchmarks: CN-100K (general commonsense) and ATOMIC (social reasoning).
As shown in the table above, ATAP achieved state-of-the-art (SOTA) results across nearly all metrics. On CN-100K, it reached an MRR of 59.13, significantly outperforming traditional triple-based and previous text-based models. On the more challenging ATOMIC dataset, it established a new benchmark with an MRR of 15.53. Furthermore, ATAP demonstrated strong generalization capabilities on traditional KGC datasets like WN18RR and showed compatibility with larger models like Llama-3.1 and Qwen2.
Discussion
Several key insights emerged from this study:
- Continuous vs. Discrete: Learned vector "pseudo-tokens" outperform human-written words by capturing high-dimensional nuances of relations that simple text cannot.
- Relation Specificity: Using a single prompt for all relations leads to a significant performance drop, highlighting the necessity of relation-specific templates.
- Structural Optimization: Placing the head entity in the middle of the pseudo-tokens provides better context for the PLM than placing it at the boundaries.
- Efficiency: ATAP converges faster than competing graph-based models, reaching peak performance in fewer training epochs.
Despite its success, ATAP is currently limited by PLM "noise," which can affect top-1 ranking accuracy. Future work will explore scaling with larger LLMs, handling temporal knowledge, and extending the framework to multi-modal knowledge graphs.
Conclusion
ATAP represents a significant advancement in commonsense knowledge graph completion. By bridging the gap between graph structures and language models through continuous prompt optimization, it provides a robust, efficient, and high-performing solution for the missing link problem in AI reasoning.
Summary updated