[Paper Review] Shielding Google's language toxicity model against adversarial attacks
This paper proposes a two-stage defense to shield Google's Perspective toxicity model from adversarial attacks that exploit typographic obfuscation and grammatical negation. By applying a text deobfuscation method followed by toxicity scoring, the approach restores accurate toxicity predictions with a ~2x processing time increase, effectively countering both character-level and polarity-based evasion techniques.
Lack of moderation in online communities enables participants to incur in personal aggression, harassment or cyberbullying, issues that have been accentuated by extremist radicalisation in the contemporary post-truth politics scenario. This kind of hostility is usually expressed by means of toxic language, profanity or abusive statements. Recently Google has developed a machine-learning-based toxicity model in an attempt to assess the hostility of a comment; unfortunately, it has been suggested that said model can be deceived by adversarial attacks that manipulate the text sequence of the comment. In this paper we firstly characterise such adversarial attacks as using obfuscation and polarity transformations. The former deceives by corrupting toxic trigger content with typographic edits, whereas the latter deceives by grammatical negation of the toxic content. Then, we propose a two--stage approach to counter--attack these anomalies, bulding upon a recently proposed text deobfuscation method and the toxicity scoring model. Lastly, we conducted an experiment with approximately 24000 distorted comments, showing how in this way it is feasible to restore toxicity of the adversarial variants, while incurring roughly on a twofold increase in processing time. Even though novel adversary challenges would keep coming up derived from the versatile nature of written language, we anticipate that techniques combining machine learning and text pattern recognition methods, each one targeting different layers of linguistic features, would be needed to achieve robust detection of toxic language, thus fostering aggression--free digital interaction.
Motivation & Objective
- To address the vulnerability of Google's Perspective toxicity model to adversarial attacks that manipulate text through typographic obfuscation and grammatical negation.
- To develop a preprocessing pipeline that restores corrupted or negated toxic content to its original form before toxicity scoring.
- To evaluate the effectiveness of this defense strategy on a large-scale set of adversarially modified comments.
- To demonstrate that robust toxicity detection requires multi-layered linguistic analysis combining machine learning and pattern recognition.
Proposed method
- The method employs a recently proposed text deobfuscation technique to reverse typographic manipulations such as letter substitutions, symbol insertions, and spacing anomalies.
- For polarity-based attacks, the approach removes or replaces negated toxic predicates (e.g., 'not stupid') to restore the original toxic intent.
- The preprocessed text is then fed into the original Google Perspective toxicity model for scoring.
- The pipeline is evaluated on approximately 24,000 adversarially distorted comments to assess accuracy restoration and computational overhead.
- The system preserves original content as much as possible, avoiding content alteration or addition to maintain authenticity.
- The approach is designed to be extensible to other languages by adapting n-gram models and custom obfuscation filters.
Experimental results
Research questions
- RQ1Can adversarial attacks that use typographic obfuscation successfully evade the Google Perspective toxicity model?
- RQ2To what extent can a deobfuscation preprocessor restore accurate toxicity scores for obfuscated comments?
- RQ3How effective is the removal or replacement of negated toxic predicates in countering polarity-based adversarial attacks?
- RQ4What is the computational cost of applying such a defense pipeline in practice?
- RQ5Can this two-stage approach be generalized to other languages with similar adversarial patterns?
Key findings
- The proposed defense restored toxicity scores for adversarially obfuscated comments with high accuracy, effectively countering character-level obfuscation attacks.
- For polarity-based attacks involving negation, removing or replacing negated toxic predicates restored the original toxicity level, reducing false negatives.
- The method incurred approximately a twofold increase in processing time compared to direct scoring, indicating a trade-off between robustness and efficiency.
- The defense remains effective even when up to half the toxic sequence is obfuscated, though effectiveness decreases with higher corruption rates.
- The approach demonstrates feasibility in restoring intended toxicity scores across diverse adversarial patterns, supporting the need for layered detection systems.
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.