Abstract
In this paper, we introduce the problem of knowledge graph contextualization -- that is, given a specific NLP task, the problem of extracting meaningful and relevant sub-graphs from a given knowledge graph. The task in the case of this paper is the textual entailment problem, and the context is a relevant sub-graph for an instance of the textual entailment problem -- where given two sentences p and h, the entailment relationship between them has to be predicted automatically. We base our methodology on finding paths in a cost-customized external knowledge graph, and building the most relevant sub-graph that connects p and h. We show that our path selection mechanism to generate sub-graphs not only reduces noise, but also retrieves meaningful information from large knowledge graphs. Our evaluation shows that using information on entities as well as the relationships between them improves on the performance of purely text-based systems.
Introduction
Natural Language Inference (NLI)—determining if a premise entails, contradicts, or is neutral toward a hypothesis—often requires "commonsense" knowledge that isn't explicitly stated in the text. While external Knowledge Graphs (KGs) like ConceptNet contain this information, they present significant challenges due to their scale and noise. Most existing approaches either limit themselves to immediate "one-hop" neighbors or ignore the specific types of relationships (edge labels) between concepts.
This paper introduces a method to "contextualize" large KGs for NLI by finding multi-hop paths that are semantically meaningful. By using customized cost functions to identify the most informative shortest paths between premise and hypothesis concepts, we show that incorporating both entities and their specific relationships significantly boosts model performance over text-only baselines.
Methodology: Graph Recurrent Networks (GRN)
The proposed framework operates in three main stages to extract and represent knowledge from a KG:
1. Path Extraction and Cost Heuristics
Instead of treating every edge in the KG as equal, the authors assign "costs" to edges using three heuristics to prioritize informative paths:
- Default Cost (DC): Every edge costs 1.0 (standard shortest path).
- Relation Frequency (RF): Weights edges based on how often a specific relation appears for a given node.
- Global Relation Frequency (GRF): An adaptation of TF-IDF that penalizes generic relations (like
RelatedTo) and rewards rarer, more specific relations that likely carry more "entailment signal."
2. Hierarchical Modeling
The extracted paths are encoded using a Graph Recurrent Network (GRN). A token-level bidirectional GRU encodes the sequence of entities and relations within a single path, while a pair-level GRU processes these path representations to create a final "knowledge-aware" vector. This vector is then integrated with a standard text-based model (match-LSTM) for prediction.
Results and Discussion
The model was evaluated on three distinct NLI benchmarks: SNLI (general-purpose), SciTail (science-domain), and BreakingNLI (adversarial lexical inference).
Key Insights
- Relations as First-Class Citizens: Most prior work focused solely on entities. This paper demonstrates that relationships (edges) are just as important. Including edge labels in the path encoding provided the highest performance gains.
- The "TF-IDF" of Graphs: The GRF heuristic proved highly effective. By treating rare relations as more informative, the model naturally filters out the noise of generic connections that plague large KGs.
- Beyond One-Hop: By using shortest paths rather than immediate neighborhoods, the model can discover deeper semantic links (e.g., connecting "Waves" to "Ocean" via intermediate concepts like "Surf" and "Sea") that one-hop models miss.
Performance Gains
The GRN + mLSTM model outperformed the text-only baseline across all datasets. On SciTail, accuracy jumped from 82.54% (text-only) to 85.37%. Using both entities and relations resulted in an average improvement of 2.6% over the baseline, compared to only 1.7% when using entities alone. Furthermore, the path-based approach significantly reduced noise; on SNLI, it brought in an average of 6.79 entities compared to 16.15 in neighborhood-based methods, yet achieved better results.
Conclusion
By treating relationships as essential components and using cost-based heuristics to navigate large knowledge graphs, this work provides a robust method for contextualizing external knowledge for NLI. While computational complexity and performance on specific adversarial datasets remain areas for future work, the results highlight the clear synergy between entities and their specific semantic relations in improving natural language understanding.
Summary updated