TL;DR
Named Entity Recognition (NER) models often cheat by memorizing entity names instead of understanding the surrounding context—a flaw known as Name Regularity Bias. This paper introduces a new diagnostic benchmark (NRB) of natural, ambiguous sentences to expose this bias, and proposes a novel adversarial training method that injects learnable noise into entity representations. This forces the model to rely on contextual clues, significantly improving robustness without sacrificing standard performance.
What Problem Does This Paper Address?
Modern NLP models are notorious for exploiting surface-level patterns (dataset biases) rather than learning the actual task. In Named Entity Recognition (NER), this manifests as Name Regularity Bias. If a model sees the word "Washington," it might blindly predict Location or Person based on which was more frequent in its training data, completely ignoring contextual clues like "Washington vetoed the bill."
Previous attempts to diagnose this bias involved artificially swapping entities in test sets (e.g., replacing "Paris" with "John"). However, this creates unnatural sentences that can confuse the model for the wrong reasons. The authors needed a way to test this bias using genuine, natural language and, more importantly, a way to train models to overcome it without requiring massive amounts of new, specialized training data.
Methods
To diagnose the issue, the authors created a new testbed. To fix it, they introduced three training strategies designed to force the model to look at the context:
- Entity Masking: Inspired by BERT's pre-training, this data augmentation technique replaces some entities in the training data with a
[MASK]token. If the entity is missing, the model must use the surrounding words to guess its type. - Parameter Freezing: The authors freeze the bottom half of BERT (including embeddings) during fine-tuning. The intuition is that BERT already learned how to predict words from context during its pre-training phase; freezing these layers prevents the model from unlearning this "contextual superpower" when it fine-tunes on a specific NER dataset.
- Adversarial Noise (adv): This is the core algorithmic novelty. During training, the model randomly assigns a "noisy" (incorrect) entity type to a token and adds a learnable noise vector to that token's input representation. For example, if the entity is "New York" (
Location), the system might generate a noise vector forLocation -> Person. This scrambles the surface-level pattern of the word, making the entity's name an unreliable signal. To minimize its loss, the network is forced to look outward at the surrounding context.
Datasets
- Standard Benchmarks: CoNLL-2003 and OntoNotes 5.0 (English).
- Multilingual Benchmarks: CoNLL-2002 (German, Spanish, Dutch), plus datasets for Finnish, Danish, Croatian, and Afrikaans.
- NRB (Name Regularity Bias): A newly introduced diagnostic dataset of 5,275 natural English sentences mined from Wikipedia disambiguation pages. These sentences contain entities that are highly ambiguous (e.g., "Gonzales" used as a city rather than a person).
- WTS (Witness): A control set of 5,192 sentences containing the exact same entities as NRB, but used in their most common, easy-to-guess context.
Key Insights and Ideas
- It's not just a domain shift: Models perform terribly on the NRB dataset but excellently on the WTS control set. Because both datasets use the exact same entities from the exact same domain (Wikipedia), the failure on NRB definitively proves the models are suffering from name regularity bias, not just struggling with new vocabulary.
- BERT's pre-training is its saving grace: Feature-based models (like LSTM-CRFs) fail miserably on ambiguous entities. Fine-tuned BERT models do much better, primarily because BERT's Masked Language Modeling (MLM) pre-training inherently taught it to look at context.
- Adversarial noise shifts attention: By analyzing BERT's attention heads, the authors found that their adversarial training method physically changes how the model processes data. In the upper layers of the network, significantly fewer attention heads point to the entity itself, proving the model is actively looking at the surrounding context tokens to make its decision.
Key Results
- Baseline Failures: Standard feature-based models (LSTM-CRF) scored a dismal 27-38% F1 on the NRB dataset, despite scoring >90% on standard test sets. Standard fine-tuned BERT-large scored 75.6% F1.
- Massive Robustness Gains: Combining all three mitigation strategies (Masking + Freezing + Adversarial Noise) pushed BERT-large's NRB score to 89.7% F1 (a ~14 point jump) while maintaining a stellar 92.8% on the standard CoNLL test set.
- Low-Resource Efficiency: The adversarial noise method proved incredibly effective even when training data was scarce. When fine-tuning BERT on just 500 sentences, the adversarial method still yielded massive improvements on the NRB benchmark.
- Multilingual Success: The bias exists across languages. Applying these training methods to 7 other languages yielded consistent, drastic improvements on translated NRB datasets (e.g., +28% in German, +26% in Croatian).
Limitations and Future Work
- Multilingual Translation: To test other languages, the authors simply machine-translated the English NRB dataset. This was a blunt instrument that resulted in discarding up to 53% of the sentences for some languages due to poor translation quality. Building native NRB corpora for other languages is a necessary next step.
- Single-Word Entities: The current NRB benchmark only evaluates single-word entities. Expanding this to multi-word entities would create a more challenging and realistic testbed.
- Future Applications: The authors plan to apply this adversarial training method to non-sequential NER architectures (like MRC-based flat and nested NER models) to see if it yields similar robustness gains.
Summary updated