[Paper Review] Knowledge-Infused Self Attention Transformers
This paper proposes a systematic, modular framework for infusing external knowledge from knowledge graphs into different components of transformer models—specifically, input embeddings (latent representations) and self-attention matrices (inductive biases). The method classifies knowledge infusion into shallow, semi-deep, and deep categories, with deep infusion—applying knowledge across both representations and inductive biases across all layers—demonstrating superior performance on GLUE benchmarks using both traditional and novel evaluation metrics.
Transformer-based language models have achieved impressive success in various natural language processing tasks due to their ability to capture complex dependencies and contextual information using self-attention mechanisms. However, they are not without limitations. These limitations include hallucinations, where they produce incorrect outputs with high confidence, and alignment issues, where they generate unhelpful and unsafe outputs for human users. These limitations stem from the absence of implicit and missing context in the data alone. To address this, researchers have explored augmenting these models with external knowledge from knowledge graphs to provide the necessary additional context. However, the ad-hoc nature of existing methods makes it difficult to properly analyze the effects of knowledge infusion on the many moving parts or components of a transformer. This paper introduces a systematic method for infusing knowledge into different components of a transformer-based model. A modular framework is proposed to identify specific components within the transformer architecture, such as the self-attention mechanism, encoder layers, or the input embedding layer, where knowledge infusion can be applied. Additionally, extensive experiments are conducted on the General Language Understanding Evaluation (GLUE) benchmark tasks, and the findings are reported. This systematic approach aims to facilitate more principled approaches to incorporating knowledge into language model architectures.
Motivation & Objective
- Address hallucinations and alignment issues in large language models by integrating external knowledge to compensate for missing or implicit context in training data.
- Overcome the ad hoc nature of existing knowledge infusion methods that lack principled analysis of component-level effects in transformer architectures.
- Develop a modular, systematic approach to knowledge infusion that distinguishes between inductive biases (e.g., attention matrices) and latent representations (e.g., embeddings) in transformer blocks.
- Evaluate knowledge infusion using both standard metrics (accuracy, F1) and novel metrics (DE@K, link prediction) to assess data efficiency and factual consistency.
- Establish a foundation for principled, component-aware knowledge-augmented language modeling with potential for future hybrid and selective infusion strategies.
Proposed method
- Categorize transformer components into two types: inductive biases (e.g., self-attention matrices) and latent representations (e.g., input and intermediate layer embeddings).
- Propose three knowledge infusion strategies: (i) shallow (knowledge at first block’s latent representations), (ii) semi-deep (knowledge at first block’s attention matrices), and (iii) deep (knowledge interleaved across all blocks’ representations and attention matrices).
- Use knowledge graphs (ConceptNet and WordNet) to obtain node embeddings, which are summed per input token to form a unified graph representation for each token.
- Integrate graph embeddings into the transformer via injection into input embeddings and attention matrices using learnable projection layers.
- Apply the infusion techniques to five pre-trained models: BERT, RoBERTa, ELECTRA, XLNet, and Longformer, using their large variants for evaluation.
- Introduce new evaluation metrics: DE@K (data efficiency) and link prediction accuracy (factual consistency), measuring performance with reduced training data and factual alignment of embeddings.

Experimental results
Research questions
- RQ1How does systematic knowledge infusion into different components of a transformer (latent representations vs. inductive biases) affect downstream performance on NLP tasks?
- RQ2To what extent does knowledge infusion improve data efficiency, as measured by performance with reduced training data (e.g., 50%)?
- RQ3Can novel evaluation metrics—such as link prediction accuracy and DE@K—provide more reliable assessment of knowledge infusion than standard accuracy and F1 scores?
- RQ4Which knowledge infusion strategy (shallow, semi-deep, or deep) yields the most consistent and robust improvements across diverse transformer architectures and GLUE benchmark tasks?
- RQ5Does knowledge infusion reduce model reliance on statistical artifacts or spurious patterns by enhancing factual consistency and contextual understanding?
Key findings
- Deep knowledge infusion, which applies knowledge to both latent representations and inductive biases across all transformer blocks, achieves the highest performance across all GLUE tasks.
- With only 50% of the training data, deep-infused models achieved an average accuracy of 81–83 across GLUE tasks, indicating strong data efficiency.
- The DE@50 metric shows that deep infusion maintains high performance even with limited data, demonstrating improved data sufficiency through knowledge integration.
- Link prediction accuracy using summed ConceptNet and WordNet embeddings (via cosine similarity) showed consistent improvement with knowledge infusion, validating factual consistency gains.
- XLNet consistently outperformed other models across all settings, but deep infusion provided the most significant relative gains, especially on challenging tasks.
- The new evaluation metrics (DE@K and link prediction) revealed meaningful improvements in knowledge infusion effectiveness that were not fully captured by standard metrics alone.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.