Abstract
Domain-Adaptive Pre-Training (DAPT) is a standard approach for specializing Large Language Models (LLMs) for technical fields. However, this process often leads to "catastrophic forgetting," where the model overwrites foundational general-purpose linguistic knowledge. We present G-MAP (General Memory-Augmented Pre-trained Language Model), a framework that utilizes a frozen general-purpose model as a sidecar "memory cache." By fusing general representations into a domain-specialized model via gated memory-attention, G-MAP preserves essential reasoning capabilities while mastering domain-specific nuances. G-MAP achieves state-of-the-art results across biomedical, computer science, news, and review benchmarks.
Introduction: The Challenge of Domain Adaptation
To optimize models for specialized fields like medicine or computer science, researchers typically continue training a general model (e.g., RoBERTa) on domain-specific corpora. While this improves performance on technical jargon, it often degrades the model's underlying linguistic roots. This "catastrophic forgetting" is detrimental because general knowledge remains vital for reasoning and generalization, even in highly specialized contexts. G-MAP addresses this by maintaining a stable anchor of general knowledge that remains accessible throughout the domain adaptation process.
Methodology: The G-MAP Architecture
The G-MAP framework operates with two models in parallel:
- PLM-G (General): A frozen, general-purpose pre-trained model that serves as a permanent "Memory Cache."
- PLM-D (Domain): A model undergoing DAPT to acquire specialized knowledge.
The core component is the Memory-Augmented Layer. Unlike standard Transformer layers, this module incorporates Memory-Attention, which transforms representations from the frozen general model into additional "Keys" and "Values." These are appended to the domain model’s attention mechanism, allowing it to dynamically "look up" general knowledge as needed.
Memory Fusion Strategies
The authors explored several strategies for transferring knowledge from the memory cache to the domain model. These included single-layer, multiple-layer, and gated transfers. The most effective method was found to be Chunk-based Gated Memory Transfer, which partitions the general model into high-level and low-level chunks. A gating mechanism then weighs the importance of different layers before fusing them into specific target layers within the domain model.
Experimental Evaluation
G-MAP was evaluated across four distinct domains using a variety of tasks, including classification, Named Entity Recognition (NER), and Question Answering (QA):
- Biomedical: CHEMPROT, RCT, NCBI-Disease, and Medication QA.
- Computer Science: ACL-ARC and SciERC.
- News: HYPERPARTISAN, AGNEWS, CoNLL-2003, and NewsQA.
- Reviews: HELPFULNESS and IMDB.
Key Results and Insights
G-MAP established new state-of-the-art (SOTA) benchmarks across all evaluated datasets. Notable highlights include:
- Performance Gains: On the SciERC (Computer Science) dataset, G-MAP achieved an F1 score of 79.4, a significant improvement over standard DAPT (75.4).
- Robustness in QA: G-MAP outperformed previous knowledge-augmented baselines like KALA, particularly in the Medication QA task (F1 of 72.2 vs. 71.1).
- Knowledge Stability: By keeping the general model frozen, G-MAP maintains low Masked Language Model (MLM) loss on both general and domain corpora simultaneously, effectively mitigating the performance trade-off typically seen in DAPT.
Discussion and Future Work
While G-MAP offers superior performance and training efficiency due to its frozen memory component, it introduces computational overhead during inference by requiring two models to run in parallel. Future research will focus on scaling this architecture to larger decoder-only models (such as GPT) and exploring automated layer selection via AutoML to further optimize the memory-fusion process.
Summary updated