Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild

Ting Wu, Jingyi Liu, Rui Zheng, Tao Gui, Qi Zhang, Xuanjing Huang

Introduction

Deploying machine learning models for natural language processing in real-world scenarios often encounters a significant hurdle: the inherent messiness of "in-the-wild" data. This paper, presented at ACL 2024, focuses on Continual Relation Extraction (CRE)—the challenge of learning new entity relationships over time without forgetting previously acquired knowledge.

While traditional CRE models assume perfectly labeled training data, real-world streams are frequently contaminated with labeling errors. This noise presents a dual challenge:

  1. Catastrophic Forgetting: Learning new tasks often overwrites weights essential for old tasks.
  2. Label Noise: Incorrect labels lead to the acquisition of "false" knowledge. In CRE, this noise can be closed-set (mislabeled as a known relation) or open-set (mislabeled as an unseen relation).

Even standard benchmarks like TACRED contain approximately 6.6% noisy labels. Current state-of-the-art (SOTA) models often experience performance collapses as noise levels increase because they cannot distinguish between novel patterns and labeling errors.

The NaCL Framework

To address these issues, the authors introduce NaCL (Noise-guided Attack in Contrastive Learning). The framework operates in three distinct stages for each new task.

The NaCL framework: New Relations Learning with an auxiliary model for selection and noise-guided attack, and Old Knowledge Replay via a purified memory buffer.

1. Rebooted Selection

To identify clean samples, NaCL employs an auxiliary model that is "rebooted" (re-initialized) for every new task. This prevents interference from previous tasks, allowing the model to exploit the "small loss" phenomenon—where models naturally learn clean, simple patterns before overfitting to noise. Samples with low loss are flagged as "clean," while high-loss samples are categorized as "noisy."

2. Noise-Guided Attack

Rather than discarding noisy samples, NaCL utilizes an adversarial attack to turn them into "hard negatives." By perturbing the feature embeddings of noisy samples to move them closer to their incorrect labels, the model sharpens the contrastive boundaries of the "true" relation clusters, making the resulting representations more robust.

3. Purified Memory Replay

To mitigate forgetting, NaCL maintains a memory buffer for replay. Crucially, it ensures this buffer only contains samples verified as clean during the selection phase, preventing "buffer poisoning" that typically degrades performance in noisy environments.

Experimental Results

NaCL was evaluated on modified versions of the FewRel and TACRED benchmarks, with synthetic noise levels ranging from 10% to 50%.

Performance of NaCL compared to baselines across 10 tasks on FewRel and TACRED datasets with 30% and 50% noise.

The results demonstrate that NaCL consistently outperforms SOTA baselines like CRL, RP-CRE, and ACA, particularly as noise levels escalate. For instance, on TACRED with 50% noise, NaCL achieved 71.6% accuracy, significantly higher than the 52.9% reached by the best baseline. Furthermore, NaCL showed much lower forgetting rates; on FewRel with 50% noise, its forgetting rate was only 16.8%, compared to 38.9% for ACA. NaCL also maintained high memory purity (80.3% on FewRel with 50% noise), which is vital for effective replay.

Conclusion

NaCL provides a robust solution for CRE in noisy environments by leveraging adversarial attacks as a tool for feature space correction rather than a threat. By maintaining a purified memory buffer and using a rebooted auxiliary model for noise detection, it effectively balances plasticity and stability. Future work may explore reducing the computational overhead of the selection and attack steps and extending this framework to other NLP tasks like named entity recognition.

Summary updated

BibTeX
@inproceedings{wu2024enhancing,
  author = {Ting Wu and Jingyi Liu and Rui Zheng and Tao Gui and Qi Zhang and Xuanjing Huang},
  title = {{Enhancing Contrastive Learning with Noise-Guided Attack: Towards Continual Relation Extraction in the Wild}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.121},
}
Figure