Abstract
Pre-trained language models (PLMs) often struggle when applied to specialized domains due to a lack of domain-specific knowledge. Traditional adaptation methods like Domain-Adaptive Pre-training (DAPT) are computationally expensive and prone to catastrophic forgetting. We present KALA (Knowledge-Augmented Language model Adaptation), a framework that adapts PLMs by modulating their internal representations with structured knowledge from graphs. KALA is significantly more efficient than DAPT and demonstrates superior performance, particularly on entities not seen during training.
Introduction
While models like BERT excel in general-purpose tasks, their performance often degrades in specialized fields such as medicine or law. The standard solution, Domain-Adaptive Pre-training (DAPT), involves continued training on massive domain-specific corpora. However, DAPT faces three primary challenges: high computational cost, the risk of forgetting general knowledge, and difficulty representing rare "long-tail" entities. KALA addresses these issues by introducing a "plug-and-play" knowledge-augmentation strategy during the fine-tuning stage, rather than requiring expensive retraining.
Methodology
KALA's architecture avoids retraining the entire model by leveraging external knowledge to "nudge" internal features.
The framework consists of three core pillars:
- Entity Memory: A standalone storage for entity embeddings that exists independently of the PLM’s internal parameters.
- Relational Retrieval: Instead of simple lookups, KALA uses a Graph Neural Network (GNN) to aggregate information from an entity's neighbors in a Knowledge Graph (KG). This allows the model to infer the meaning of rare terms (e.g., restenosis) based on related, better-known concepts (e.g., myocardial infarction).
- Knowledge-conditioned Feature Modulation (KFM): KALA interleaves KFM layers within existing Transformer blocks. These layers apply affine transformations—scaling and shifting hidden representations—based on the retrieved knowledge, effectively guiding the model's internal state with factual data.
Experimental Results
KALA was evaluated across two knowledge-intensive tasks: Question Answering (NewsQA, EMRQA) and Named Entity Recognition (CoNLL-2003, WNUT-17, NCBI-Disease).
Performance and Efficiency
KALA consistently outperformed heavy-duty baselines. On NewsQA, it achieved an F1 score of 68.27, surpassing DAPT (67.76) despite DAPT using significantly more training data. In the clinical domain (NCBI-Disease), it reached 85.77 F1. Crucially, KALA is approximately 17x more efficient in terms of total computation (FLOPs) and requires 112x less data for adaptation than DAPT.
Handling Unseen Entities
A key strength of KALA is its robustness to "unseen" data. Analysis showed that KALA provides significant performance gains in contexts containing entities absent from the training set. By leveraging structural context within the KG, KALA effectively bridges the gap for rare entities that traditional pre-training methods struggle to represent.
Conclusion
KALA offers a highly efficient alternative to traditional domain adaptation. By treating knowledge as a feature modulator rather than a raw input, it maintains architectural simplicity while achieving state-of-the-art results. Future work includes automating high-quality KG construction and exploring KALA's utility during initial pre-training phases to create more robust foundation models.
Summary updated