TL;DR
This paper investigates the robustness of Named Entity Recognition (NER) models to small, adversarial perturbations in input text, extending previous English-centric research to German and Hindi. They find that current NER models are surprisingly brittle across languages and demonstrate that both adversarial data augmentation and fine-tuning can significantly improve robustness without requiring additional manually labeled data.
What Problem Does This Paper Address?
Named Entity Recognition (NER) is a fundamental task in Natural Language Processing (NLP), crucial for extracting structured information from text. While NER models have achieved impressive performance on standard benchmarks, recent research has revealed a significant vulnerability: even minor, seemingly innocuous changes to input text can cause a drastic drop in performance. This issue has largely been confined to English-language research. This paper addresses this gap by performing a multilingual evaluation of NER robustness to adversarial inputs, specifically focusing on English, German, and Hindi. Furthermore, it explores practical strategies for improving model robustness, moving beyond mere evaluation to investigate how adversarial data can be used for model enhancement.
Methods
The authors employ a two-pronged approach to generate adversarial test sets:
- Replacing Entities: This involves substituting existing named entities with others of the same category. Two methods are used:
- Random Sampling (RS): Entity occurrences are shuffled within the test set.
- Gazetteers (Faker): A Python library is used to replace entities with synthetically generated ones of the same type.
- Changing the Context: This method modifies the surrounding text without altering the named entities themselves.
- Masking (Mask): Transformer-based language models are used to mask and then re-generate non-entity tokens, altering the context.
- Paraphrasing (Para): An online paraphrasing tool is used to rephrase sentences, changing their structure while aiming to preserve entities.
- Masking + Random Sampling (M+R): A combination of the masking and random sampling techniques.
For improving model robustness, they investigate two strategies:
- Adversarial Data Augmentation (Re-training): Using a portion of the generated adversarial data to train a new NER model from scratch.
- Adversarial Fine-tuning: Using the adversarial data to fine-tune an already trained NER model.
Datasets
The study utilizes several widely-used NER datasets:
- English:
conll03-en,mconer21-en, andwnut17. - German:
conll03-deandmconer21-de. - Hindi:
mconer21-hi.
The authors generated adversarial test sets for each of these datasets, resulting in a total of 27 adversarial test sets across the three languages.
Key Insights and Ideas
- Multilingual Brittleness: The most striking finding is that NER models are not just brittle in English, but also exhibit significant performance degradation in German and Hindi when faced with small adversarial perturbations. This highlights a universal vulnerability in current NER systems.
- Contextual Changes are More Disruptive: Adversarial methods that alter the context of entities (like masking and paraphrasing) tend to cause larger performance drops than those that simply replace entities. This suggests that models rely heavily on contextual cues, which are easily disrupted.
- Adversarial Data as a Training Tool: The research strongly supports the idea that adversarial data is not just for evaluation but can be effectively used to improve NER models. Both re-training and fine-tuning with adversarial data lead to performance gains on adversarial test sets.
- Fine-tuning is a Practical Solution: Adversarial fine-tuning offers a compelling approach, especially in real-world scenarios where access to original training data is limited. It provides a significant robustness boost without the need for extensive re-training.
- Language-Agnostic Methods Work: The adversarial data generation techniques employed are largely language-agnostic, demonstrating their potential for broad applicability across different languages.
Key Results
- Performance Drop: Across all three languages, NER models showed a noticeable drop in performance on adversarial test sets compared to original test sets. For instance, in English, performance on
conll03-endropped from 0.91 to 0.82 (Micro-F1) with the M+R adversarial set. Similar drops were observed for German and Hindi. - Re-training vs. Fine-tuning: For English, both adversarial fine-tuning and re-training yielded similar performance boosts (around 5%) on adversarial test sets without compromising performance on the original test set. However, for German and Hindi, re-training was significantly more effective than fine-tuning.
- Fine-tuning Still Beneficial: Even without re-training, adversarial fine-tuning alone improved performance on adversarial test sets by over 5% for all languages.
- Qualitative Analysis: The fine-grained evaluation revealed that 'organization' entities in English were particularly susceptible to errors. Qualitative examples showed how minor changes could lead to misclassifications (e.g., ORG to LOC, or missed entities).
Limitations and Future Work
- Limited Model Scope: The study focused on a select set of publicly available NER models. Future work could extend this to a wider range of models, including larger language models.
- Paraphrasing Tool Limitations: The paraphrasing approach was limited by the availability of a single online tool and its API constraints, and was only applicable to English. Exploring multilingual paraphrasers or other generative models for creating adversarial data is a promising direction.
- Grammatical Correctness of Masked Data: Adversarial test sets generated using masked language models might introduce grammatical noise, though the authors argue this is inherent to adversarial testing and doesn't significantly impact findings. Exploring human-in-the-loop approaches for selecting adversarial examples could address this.
- Broader Language Coverage: While extending to German and Hindi is a significant step, future research should aim for even broader multilingual coverage.
- Beyond F1 Score: The authors suggest that future research should explore additional metrics beyond the standard F1 score for evaluating NER robustness, especially for noisy datasets.
Summary updated