MTTM: Metamorphic Testing for Textual Content Moderation Software
Wenxuan Wang, Jen-tse Huang, Weibin Wu, Jianping Zhang, Yizhan Huang, Shuqing Li, Pinjia He, Michael R. Lyu
Abstract
The exponential growth of social media platforms such as Twitter and Facebook has revolutionized textual communication and textual content publication in human society. However, they have been increasingly exploited to propagate toxic content, such as hate speech, malicious advertisement, and pornography, which can lead to highly negative impacts (e.g., harmful effects on teen mental health). Researchers and practitioners have been enthusiastically developing and extensively deploying textual content moderation software to address this problem. However, we find that malicious users can evade moderation by changing only a few words in the toxic content. Moreover, modern content moderation software's performance against malicious inputs remains underexplored. To this end, we propose MTTM, a Metamorphic Testing framework for Textual content Moderation software. Specifically, we conduct a pilot study on 2, 000 text messages collected from real users and summarize eleven metamorphic relations across three perturbation levels: character, word, and sentence. MTTM employs these metamorphic relations on toxic textual contents to generate test cases, which are still toxic yet likely to evade moderation. In our evaluation, we employ MTTM to test three commercial textual content moderation software and two state-of-the-art moderation algorithms against three kinds of toxic content. The results show that MTTM achieves up to 83.9%, 51%, and 82.5% error finding rates (EFR) when testing commercial moderation software provided by Google, Baidu, and Huawei, respectively, and it obtains up to 91.2% EFR when testing the state-of-the-art algorithms from the academy. In addition, we leverage the test cases generated by MTTM to retrain the model we explored, which largely improves model robustness 0% 5.9% EFR) while maintaining the accuracy on the original test set. A demo can be found in this link <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">1</sup> .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
8 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Glitch Tokens in Large Language Models: Categorization Taxonomy and Effective Detection cites BiasAsker: Measuring the Bias in Conversational AI System
- Glitch Tokens in Large Language Models: Categorization Taxonomy and Effective Detection cites An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software
- Glitch Tokens in Large Language Models: Categorization Taxonomy and Effective Detection cites Validating Multimedia Content Moderation Software via Semantic Fusion
- BiasAsker: Measuring the Bias in Conversational AI System cites Hidden Voice Commands
- Coverage-Based Harmfulness Testing for LLM Code Transformation cites BiasAsker: Measuring the Bias in Conversational AI System
- Coverage-Based Harmfulness Testing for LLM Code Transformation cites An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software
- BERT-ATTACK: Adversarial Attack Against BERT Using BERT cites TextBugger: Generating Adversarial Text Against Real-world Applications
- BERT-ATTACK: Adversarial Attack Against BERT Using BERT cites Word-level Textual Adversarial Attacking as Combinatorial Optimization
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites TextBugger: Generating Adversarial Text Against Real-world Applications
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites BiasAsker: Measuring the Bias in Conversational AI System
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites BERT-ATTACK: Adversarial Attack Against BERT Using BERT
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites Hidden Voice Commands
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation Software cites Validating Multimedia Content Moderation Software via Semantic Fusion
- Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment cites TextBugger: Generating Adversarial Text Against Real-world Applications
- Validating Multimedia Content Moderation Software via Semantic Fusion cites BERT-ATTACK: Adversarial Attack Against BERT Using BERT
- Validating Multimedia Content Moderation Software via Semantic Fusion cites Hidden Voice Commands
Cited by top-tier papers8
- BiasAsker: Measuring the Bias in Conversational AI SystemYuxuan Wan, Wenxuan Wang, Pinjia He, Jiazhen Gu et al.FSE 2023 · 50 citations
- Glitch Tokens in Large Language Models: Categorization Taxonomy and Effective DetectionYuxi Li, Yi Liu, Gelei Deng, Ying Zhang et al.FSE 2024 · 12 citations
- Validating Multimedia Content Moderation Software via Semantic FusionWenxuan Wang, Jingyuan Huang, Chang Chen, Jiazhen Gu et al.ISSTA 2023 · 11 citations
- An Image is Worth a Thousand Toxic Words: A Metamorphic Testing Framework for Content Moderation SoftwareWenxuan Wang, Jingyuan Huang, Jen-tse Huang, Chang Chen et al.ASE 2023 · 7 citations
- Coverage-Based Harmfulness Testing for LLM Code TransformationHonghao Tan, Haibo Wang, Diany Pressato, Yisen Xu et al.ASE 2025 · 2 citations
Builds on21
- Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and EntailmentDi Jin, Zhijing Jin, Joey Tianyi Zhou, Peter SzolovitsAAAI 2020 · 1,333 citations
- TextBugger: Generating Adversarial Text Against Real-world ApplicationsJinfeng Li, Shouling Ji, Tianyu Du, Bo Li et al.NDSS 2019 · 876 citations
- Hidden Voice CommandsNicholas Carlini, Pratyush Mishra, Tavish Vaidya, Yuankai Zhang et al.USENIX Security 2016 · 672 citations
- BERT-ATTACK: Adversarial Attack Against BERT Using BERTLinyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue et al.EMNLP 2020 · 529 citations
- Word-level Textual Adversarial Attacking as Combinatorial OptimizationYuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu et al.ACL 2020 · 188 citations
Related papers
- Metamorphic Testing for Audio Content Moderation SoftwareWenxuan Wang, Yongjiang Wu, Junyuan Zhang, Shuqing Li et al.ASE 2025
- MemeDetoxNet: Balancing Toxicity Reduction and Context PreservationGitanjali Kumari, Jitendra Solanki, Asif EkbalACL Findings 2025
- Enhancing LLM-based Hatred and Toxicity Detection with Meta-Toxic Knowledge GraphYibo Zhao, Jiapeng Zhu, Can Xu, Yao Liu et al.ACL Findings 2025 · 8 citations
- ContiGuard: A Framework for Continual Toxicity Detection Against Evolving Evasive PerturbationsHankun Kang, Xin Miao, Jianhao Chen, Jintao Wen et al.WWW 2026
- DiffuDetox: A Mixed Diffusion Model for Text DetoxificationGriffin Floto, Mohammad Mahdi Abdollah Pour, Parsa Farinneya, Zhenwei Tang et al.ACL Findings 2023 · 5 citations
