Few-Shot Class-Incremental Learning for Named Entity Recognition

Rui Wang, Tong Yu, Handong Zhao, Sungchul Kim, Subrata Mitra, Ruiyi Zhang, Ricardo Henao

Abstract

This paper addresses the challenge of Few-Shot Class-Incremental Learning (FSCIL) in Named Entity Recognition (NER). Traditional NER models suffer from catastrophic forgetting when updated with new entity types, especially when training data for previous classes is unavailable and new data is scarce. We propose a novel framework that utilizes synthetic replay data generated via model inversion and adversarial feature matching to bridge the gap between synthetic and real-world data. Our approach enables models to learn new classes from as few as 5 or 10 examples while maintaining high performance on previously learned entities. Evaluations on CoNLL2003 and Ontonotes 5.0 benchmarks demonstrate that our method significantly outperforms existing baselines in long-term incremental scenarios.

Introduction

Named Entity Recognition (NER) is a fundamental task in information extraction. However, the static nature of traditional NER models—trained on a fixed set of labels—limits their utility in dynamic environments where new entity types emerge. Updating these models is non-trivial due to catastrophic forgetting, where fine-tuning on new classes leads to the loss of knowledge regarding old ones. This problem is exacerbated in few-shot scenarios where only a handful of annotated examples are available for new classes, and privacy or storage constraints prevent access to original training data for old classes.

While previous class-incremental methods relied on large amounts of new data to act as an unlabeled proxy for old data, this research tackles the scenario where new data is extremely scarce, rendering standard distillation techniques insufficient.

Methodology

The proposed framework is built upon a BERT-CRF architecture and introduces three core strategies to mitigate forgetting and handle data scarcity.

1. Synthetic Replay via Model Inversion

To compensate for the lack of old training data, the framework generates synthetic samples by inverting the previous model version ($M^{t-1}$). By sampling label sequences (e.g., "O, O, LOC, O") and optimizing token embeddings through gradient descent until the model predicts that specific sequence, the system creates a synthetic dataset ($D^t_r$) that encapsulates its internal representation of old classes.

2. Adversarial Feature Matching

Synthetic embeddings generated by inversion can be mathematically correct for the model but unlike real human language. To address this "domain gap," an adversarial loss is employed. A discriminator is trained to distinguish between the hidden states of real text (from the new few-shot samples) and the synthetic text. By forcing synthetic data to mimic the distribution of real features in the hidden layers, the model develops more robust and generalizable representations.

3. Knowledge Distillation

The final training objective integrates distillation from both real few-shot samples and synthetic replay data. This ensures consistency with the teacher model's predictions on non-entity tokens and reinforces the memory of old entity types by training on the generated synthetic samples.

Overview of the synthetic replay and distillation framework.

Experimental Evaluation

The researchers evaluated their approach on two gold-standard NER benchmarks:

  • CoNLL2003: A classic dataset containing four entity types (PER, LOC, ORG, MISC), tested in 5-shot and 10-shot scenarios.
  • Ontonotes 5.0: A complex dataset with 18 entity types, used to test the model's ability to handle up to 9 incremental steps.

Key Results

The proposed method significantly outperformed existing baselines across the board. In the CoNLL2003 5-shot scenario, it achieved an average F1 score of 64.18, compared to 51.20 for standard Continual NER and 59.85 for EWC++. On the Ontonotes 5.0 dataset, the model maintained much higher performance curves than competitors over long-term incremental setups, showing superior resistance to the "downward spiral" of forgetting.

F1 score performance across incremental steps on the Ontonotes 5.0 dataset.

Discussion and Insights

A key finding is that standard "unlabeled proxy" methods fail in few-shot settings because small datasets (5-10 sentences) do not provide enough variety to act as a distillation medium for old classes. Synthetic data serves a dual purpose: it preserves memory of old classes and acts as negative samples for new ones, preventing the model from mislabeling old entity types as new ones. Adversarial alignment is critical to this success, as it bridges the gap between synthetic noise and real text features.

Conclusion

This paper demonstrates that synthetic replay, when combined with adversarial feature matching, is a powerful tool for few-shot incremental learning in NER. While effective, the current approach freezes BERT token embeddings to prevent overfitting, which may limit adaptation to drastically different domains. Future work will explore more sophisticated label sampling techniques and methods to reduce the computational overhead of the model inversion process.

Summary updated

BibTeX
@inproceedings{wang2022few,
  author = {Rui Wang and Tong Yu and Handong Zhao and Sungchul Kim and Subrata Mitra and Ruiyi Zhang and Ricardo Henao},
  title = {{Few-Shot Class-Incremental Learning for Named Entity Recognition}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.43},
}
Figure