Introduction
Large language models (LLMs) like BERT and RoBERTa are typically pre-trained on massive general-purpose corpora. To specialize these models for specific fields, researchers often perform "continued pre-training" on domain-specific data (e.g., biomedical or clinical text). However, this process often leads to catastrophic forgetting, where the model loses its general language understanding while acquiring new specialized knowledge.
Problem Definition: Catastrophic Forgetting
Standard approaches to avoid forgetting involve Multi-Task Learning (MTL), where the model is trained on a mixture of old and new data. However, for LLMs, the original pre-training data is often unavailable or too massive to re-process efficiently.
As shown in the figure above, CALM focuses on the sequential pipeline where the model learns new domains one after another. Without mitigation, this leads to significant performance drops. For instance, evidence shows that BioBERT suffers a 20.04 point drop in CoLA performance compared to BERT-base, illustrating the severity of the knowledge loss when shifting domains.
Proposed Methods
The authors adapt three key techniques to the Transformer architecture to mitigate forgetting:
- Elastic Weight Consolidation (EWC): Uses a Fisher information matrix to identify and protect weights critical to previous domains. It penalizes changes to parameters that were important for general language understanding.
- Learning Rate Control (LRC): Implements layer-wise decaying learning rates. Layers closer to the input receive a smaller learning rate, preserving foundational representations while allowing higher layers to adapt to new domains.
- Experience Replay (ER): Periodically reintroduces small batches of data from previous domains during new training to reinforce old knowledge.
Experimental Results
The techniques were evaluated by transitioning a RoBERTa-base model from a generic domain to a biomedical domain (PubMed), and subsequently to a clinical domain.
Generic to Biomedical Shift
The table below summarizes the performance of various mitigation strategies during the first domain shift.
As observed, unmitigated continued pre-training (PMC) causes the GLUE score to drop from 87.56 to 83.00. LRC proved exceptionally effective, nearly restoring the original GLUE performance (87.55) while still achieving strong biomedical results. EWC also maintained a high GLUE score (86.27) with competitive domain-specific performance.
Multi-Stage Domain Shift
In a more challenging scenario (Generic → Biomedical → Clinical), EWC emerged as the most robust method. While the unmitigated model's GLUE score fell to 80.08 after the second shift, EWC maintained a score of 85.06 and achieved the highest clinical NER score (85.26 on i2b2). This suggests that constraint-based methods like EWC scale better as the number of domains increases.
Conclusion
CALM demonstrates that catastrophic forgetting in LLMs can be significantly mitigated without the prohibitive costs of retraining from scratch. By intelligently controlling learning rates or constraining weight updates, models can become domain experts while remaining generalists. Future work will focus on refining these constraints to further bridge the gap between specialized and general-purpose performance.
Summary updated