[Paper Review] Generating Adversarial Examples in Chinese Texts Using Sentence-Pieces
This paper proposes a piece-level adversarial example generation method for Chinese text using sentence-piece tokenization and a pre-trained masked language model as a substitution generator. By generating natural, fluent adversarial samples at the subword level, the approach achieves high attack success rates while preserving semantics and fluency, outperforming character- and word-level methods in quality and human evaluation.
Adversarial attacks in texts are mostly substitution-based methods that replace words or characters in the original texts to achieve success attacks. Recent methods use pre-trained language models as the substitutes generator. While in Chinese, such methods are not applicable since words in Chinese require segmentations first. In this paper, we propose a pre-train language model as the substitutes generator using sentence-pieces to craft adversarial examples in Chinese. The substitutions in the generated adversarial examples are not characters or words but extit{'pieces'}, which are more natural to Chinese readers. Experiments results show that the generated adversarial samples can mislead strong target models and remain fluent and semantically preserved.
Motivation & Objective
- To address the challenge of generating high-quality adversarial examples in Chinese text, where word boundaries are ambiguous and character-level replacements often break fluency.
- To overcome the limitations of existing word- or character-level substitution methods in Chinese NLP by introducing a subword-level (piece-level) substitution strategy.
- To develop a pre-trained masked language model using sentence-piece tokenization that generates semantically coherent and fluent adversarial examples.
- To evaluate the effectiveness of piece-level adversarial examples in attacking strong BERT-based models while maintaining semantic integrity and human readability.
Proposed method
- Training a masked language model on large-scale Chinese text using sentence-piece tokenization to create a piece-level vocabulary that captures subword units.
- Using the pre-trained model as a substitution generator to produce candidate replacements at the piece level, rather than at the character or word level.
- Applying the substitution generator to craft adversarial examples by replacing specific pieces in input texts to mislead target models while preserving fluency and semantics.
- Employing a black-box attack setting where the target model's architecture is unknown, and only its prediction scores are used to guide the attack.
- Using cosine similarity with pre-trained embeddings to filter high-quality candidate substitutions during the attack process.
- Conducting human evaluation to assess fluency and label preservation, ensuring the adversarial examples remain natural and semantically consistent.
Experimental results
Research questions
- RQ1Can piece-level substitutions generated via sentence-piece tokenization produce more fluent and semantically preserved adversarial examples in Chinese text than character- or word-level methods?
- RQ2How effective is a pre-trained masked language model trained on sentence-piece tokens in generating high-quality adversarial substitutions for Chinese text classification models?
- RQ3What is the trade-off between the size of the candidate substitution list and the quality (fluency, semantic preservation) of the generated adversarial examples?
- RQ4To what extent do piece-level adversarial examples successfully attack strong, fine-tuned BERT-based models on diverse Chinese NLP tasks?
Key findings
- The proposed piece-level adversarial attack achieved attack success rates of 11.0% on IflyTek, 35.0% on Weibo, 18.5% on Sogou, and 12.0% on Law34, outperforming character- and word-level baselines in fluency and semantic quality.
- Human evaluators correctly identified the label of 94% of adversarial examples on IflyTek, 90% on Weibo, 93% on Sogou, and 97% on Law34, indicating strong label preservation.
- The average fluency score for generated adversarial examples was 4.5 on IflyTek, 4.2 on Weibo, 4.2 on Sogou, and 4.8 on Law34, significantly higher than character-level methods.
- The piece-level method achieved higher fluency and better semantic preservation than character-level and word-level baselines, despite slightly lower attack success rates, indicating superior quality of adversarial examples.
- A trade-off curve showed that increasing the candidate list size improved attack success rate, but the piece-level method maintained high fluency and semantic quality even with moderate-sized lists.
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.