Introduction
Large Language Models (LMs) excel at linguistic patterns but often falter in tasks requiring explicit, structured commonsense reasoning. To bridge this gap, researchers frequently augment LMs with external Knowledge Graphs (KGs) like ConceptNet. However, current LM+KG integration methods suffer from three primary bottlenecks: noisy subgraph retrieval that pulls in irrelevant facts, poor initial knowledge representation of graph entities, and shallow fusion where text and graph representations only interact at the final layers.
The DHLK Framework
To address these challenges, this paper introduces DHLK (Dynamic Heterogeneous-graph reasoning with Language models and Knowledge representation learning). DHLK employs a multi-stage pipeline designed to filter noise and deeply integrate structured knowledge with linguistic context.
Multi-Stage Pruning and HKG Construction
The process begins with Heterogeneous Knowledge Graph (HKG) Construction. Unlike naive retrievers that might decompose compound phrases into irrelevant subwords (e.g., splitting "side chair" into "side" and "chair"), DHLK uses KeyBERT and cross-references entities with WordNet and Wiktionary. This first-stage pruning ensures phrase integrity and filters out noisy nodes. Dictionary paraphrases are then added as nodes, creating a heterogeneous graph.
During the LM encoding phase, Dynamic Pruning (Stage 2) occurs. The model evaluates attention weights from the [CLS] token to graph entities; those with low scores are discarded as contextually irrelevant.
Deep Fusion and Knowledge Learning
DHLK achieves deep fusion using Visibility Matrices within the LM. By masking self-attention, the model ensures tokens only attend to logically related concepts, preventing semantic blurring. Simultaneously, the model optimizes entity and relation embeddings using Knowledge Representation Learning (KRL) via TransE. A Relation Mask Self-Attention (RMSA) layer then updates these embeddings based on the graph's structural topology. Finally, the KG2QA module selects the most relevant reasoning paths to inform the final answer prediction.
Experimental Results
The model was evaluated on two major benchmarks: CommonsenseQA (CSQA) and OpenBookQA (OBQA). On the CSQA in-house test set, DHLK achieved 74.68% accuracy, a nearly 6% improvement over the RoBERTa baseline. On the official hidden test set, it reached 77.6%.
As shown in the table above, DHLK consistently outperforms strong baselines like JointLK and GREASELM. Ablation studies underscored the importance of the visibility matrix; its removal led to a significant 3.53% drop in accuracy, confirming that structured attention boundaries are critical for deep fusion.
Conclusion and Future Work
DHLK demonstrates that combining dictionary-based noise filtering with dynamic, attention-based pruning significantly enhances commonsense reasoning. While the current implementation is resource-intensive and uses a relatively simple KRL algorithm (TransE), it sets a new competitive standard for graph-augmented language modeling. Future research will focus on more efficient encoding strategies and advanced KRL techniques to handle even larger, more complex subgraphs.
Summary updated