[Paper Review] On Adversarial Examples for Biomedical NLP Tasks
This paper proposes an adversarial evaluation framework for biomedical NLP tasks using BERT, introducing three attack types—spelling errors, keyboard typos, and synonym substitutions—demonstrating significant performance drops in NER and STS tasks. It further shows that adversarial training with these examples improves model robustness without sacrificing original task accuracy.
The success of pre-trained word embeddings has motivated its use in tasks in the biomedical domain. The BERT language model has shown remarkable results on standard performance metrics in tasks such as Named Entity Recognition (NER) and Semantic Textual Similarity (STS), which has brought significant progress in the field of NLP. However, it is unclear whether these systems work seemingly well in critical domains, such as legal or medical. For that reason, in this work, we propose an adversarial evaluation scheme on two well-known datasets for medical NER and STS. We propose two types of attacks inspired by natural spelling errors and typos made by humans. We also propose another type of attack that uses synonyms of medical terms. Under these adversarial settings, the accuracy of the models drops significantly, and we quantify the extent of this performance loss. We also show that we can significantly improve the robustness of the models by training them with adversarial examples. We hope our work will motivate the use of adversarial examples to evaluate and develop models with increased robustness for medical tasks.
Motivation & Objective
- To evaluate the robustness of pre-trained BERT models in critical biomedical NLP tasks such as Named Entity Recognition (NER) and Semantic Textual Similarity (STS).
- To identify vulnerabilities in BERT models when subjected to realistic, human-like perturbations such as spelling errors and typos in medical text.
- To investigate whether synonym substitution attacks can alter model predictions in STS tasks, potentially increasing similarity scores.
- To assess whether adversarial training with generated adversarial examples improves model robustness against such perturbations.
- To motivate broader adoption of adversarial evaluation and training in medical NLP to ensure patient safety and model reliability.
Proposed method
- Proposes three types of adversarial attacks: (1) swap noise (e.g., 'herat vavle'), (2) keyboard typo noise (e.g., 'hea5t valce'), and (3) synonym substitution (e.g., 'potassium warfarin' for 'warfarin').
- Applies these attacks to two benchmark datasets: BC5CDR for NER and BioSSES for STS, generating adversarial test sets.
- Fine-tunes BERT models on original training data augmented with adversarial examples to perform adversarial training.
- Measures model performance using standard metrics: F1-score for NER and Pearson/Spearman correlation for STS on both original and adversarial test sets.
- Compares model behavior across different pre-training data regimes (PubMed only vs. PubMed + MIMIC-III) to assess vocabulary impact on robustness.
- Uses a controlled evaluation protocol to isolate the effect of each attack type on model generalization and prediction stability.
Experimental results
Research questions
- RQ1How vulnerable are BERT-based models to adversarial perturbations such as spelling errors and typos in biomedical text?
- RQ2To what extent do synonym substitutions in medical terms affect semantic similarity predictions in STS tasks?
- RQ3Can adversarial training with human-like perturbations improve model robustness without degrading performance on standard benchmarks?
- RQ4Does the choice of pre-training data (e.g., PubMed vs. PubMed + MIMIC-III) influence model resilience to adversarial attacks?
- RQ5Why do synonym-based adversarial examples sometimes lead to higher STS correlation scores than the original test set?
Key findings
- BERT models experience significant performance degradation under adversarial attacks: F1-score drops to 63.8% on BC5CDR-Chemical NER and 52.8% on STS under swap noise.
- Synonym-based attacks in STS tasks yield higher Pearson correlation (0.869) than the original test set (0.829), suggesting adversarial examples can improve similarity scores in some cases.
- Adversarial training with synonym and typo attacks improves robustness: F1 increases from 63.8% to 65.6% on BC5CDR-Disease NER under swap noise after adversarial fine-tuning.
- Models pre-trained only on PubMed show better adversarial robustness than those pre-trained on PubMed + MIMIC-III, contrary to expectations of vocabulary expansion improving generalization.
- Adversarial training maintains high performance on original test sets—e.g., F1 remains above 0.88 on BC5CDR-Chemical NER—indicating no significant trade-off with standard performance.
- The STS task shows inconsistent behavior under synonym attacks, with some models achieving higher correlation on adversarial sets than on original sets, suggesting potential distributional shifts in adversarial examples.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.