Natural language adversarial defense based on synonym encodingNatural Language Adversarial Defense through Synonym Encoding
AI summary
The Synonym Encoding Method (SEM) is a defense method against synonym-substitution adversarial attacks on natural language processing models. SEM inserts an encoder before the input layer of the target model, maps each group of synonyms to a unique code and trains the model accordingly, without modifying the network structure or adding extra data. Experiments show that SEM can effectively defend against existing synonym-substitution attacks, block the transferability of adversarial examples, and is easy to scale to large models and large datasets.