HTG13503/PCR-ToxiCN

Jupyter Notebook

6

5 commits

updated Jul 11, 2025

See the code

README

Lost in Pronunciation: PCR-ToxiCN

๐Ÿ“ Overview

Phonetic Cloaking Replacement (PCR) leverages homophonic or near-homophonic variants to bypass Chinese content moderation, presenting unique challenges for safe deployment of LLMs in moderation tasks.

This project proposes a four-way taxonomy (Hanzi, Alphabet, Numerical, Mixed) for Chinese PCR and introduces PCR-ToxiCN, the first real-world dataset containing naturally occurring, phonetically cloaked offensive language collected from RedNote (Xiaohongshu). Benchmarking leading LLMs on PCR-ToxiCN reveals significant weaknesses under realistic attacks and demonstrates that a lightweight Pinyin-based prompting strategy can effectively recover lost accuracy.


๐Ÿš€ Features

โœ… Four-way surface-form taxonomy of PCR (HR/AR/NR/MR)
โœ… 500 real user comments (250 offensive, 250 non-offensive)
โœ… Benchmark SOTA LLMs (4o, Qwen2.5, LLaMA3.3, o3-mini, QWQ) under realistic PCR attacks
โœ… Comparative analysis of standard prompting, Chain-of-Thought (CoT), and Pinyin-based prompting


๐Ÿ“Š Dataset Statistics

ClassOffensiveNon-OffensiveTotal
Hanzi (HR)169183352
Alphabet (AR)503787
Numerical (NR)131932
Mixed (MR)181129
Total250250500

Data were manually collected and annotated by native speakers with Fleiss' kappa = 81.5% for label consistency.


๐Ÿ› ๏ธ Getting Started

Clone the Repository

git clone https://github.com/HTG13503/PCR-ToxiCN.git
cd PCR-ToxiCN

๐Ÿ“ˆ Key Results

5981752043387_ pic

5971752043355_ pic

Findings:

  • COT prompting does not improve detection under realistic PCR attacks.
  • Pinyin-based Prompting effectively restores detection accuracy, approaching performance of reasoning-capable models.

๐Ÿ‘ฅ Contributors

Haotan Guo, Jianfei He, Jiayuan Ma, Hongbin Na, Zimu Wang, Haiyang Zhang, Qi Chen, Wei Wang, Zijing Shi, Tao Shen, Ling Chen


๐Ÿ“„ Citation

If you want to use the resources, please consider citing:

@article{guo2025lost,
  title={Lost in Pronunciation: Detecting Chinese Offensive Language Disguised by Phonetic Cloaking Replacement},
  author={Guo, Haotan and He, Jianfei and Ma, Jiayuan and Na, Hongbin and Wang, Zimu and Zhang, Haiyang and Chen, Qi and Wang, Wei and Shi, Zijing and Shen, Tao and Chen, Ling},
  journal={arXiv preprint arXiv:2507.07640},
  year={2025},
  url={https://arxiv.org/abs/2507.07640}
}

โœ‰๏ธ Contact

For questions, collaborations, or dataset access:

Contributors

HTG13503

5 commits

HTG13503/PCR-ToxiCN

Jupyter Notebook

6

5 commits

updated Jul 11, 2025

See the code

README

Lost in Pronunciation: PCR-ToxiCN

๐Ÿ“ Overview

Phonetic Cloaking Replacement (PCR) leverages homophonic or near-homophonic variants to bypass Chinese content moderation, presenting unique challenges for safe deployment of LLMs in moderation tasks.

This project proposes a four-way taxonomy (Hanzi, Alphabet, Numerical, Mixed) for Chinese PCR and introduces PCR-ToxiCN, the first real-world dataset containing naturally occurring, phonetically cloaked offensive language collected from RedNote (Xiaohongshu). Benchmarking leading LLMs on PCR-ToxiCN reveals significant weaknesses under realistic attacks and demonstrates that a lightweight Pinyin-based prompting strategy can effectively recover lost accuracy.


๐Ÿš€ Features

โœ… Four-way surface-form taxonomy of PCR (HR/AR/NR/MR)
โœ… 500 real user comments (250 offensive, 250 non-offensive)
โœ… Benchmark SOTA LLMs (4o, Qwen2.5, LLaMA3.3, o3-mini, QWQ) under realistic PCR attacks
โœ… Comparative analysis of standard prompting, Chain-of-Thought (CoT), and Pinyin-based prompting


๐Ÿ“Š Dataset Statistics

ClassOffensiveNon-OffensiveTotal
Hanzi (HR)169183352
Alphabet (AR)503787
Numerical (NR)131932
Mixed (MR)181129
Total250250500

Data were manually collected and annotated by native speakers with Fleiss' kappa = 81.5% for label consistency.


๐Ÿ› ๏ธ Getting Started

Clone the Repository

git clone https://github.com/HTG13503/PCR-ToxiCN.git
cd PCR-ToxiCN

๐Ÿ“ˆ Key Results

5981752043387_ pic

5971752043355_ pic

Findings:

  • COT prompting does not improve detection under realistic PCR attacks.
  • Pinyin-based Prompting effectively restores detection accuracy, approaching performance of reasoning-capable models.

๐Ÿ‘ฅ Contributors

Haotan Guo, Jianfei He, Jiayuan Ma, Hongbin Na, Zimu Wang, Haiyang Zhang, Qi Chen, Wei Wang, Zijing Shi, Tao Shen, Ling Chen


๐Ÿ“„ Citation

If you want to use the resources, please consider citing:

@article{guo2025lost,
  title={Lost in Pronunciation: Detecting Chinese Offensive Language Disguised by Phonetic Cloaking Replacement},
  author={Guo, Haotan and He, Jianfei and Ma, Jiayuan and Na, Hongbin and Wang, Zimu and Zhang, Haiyang and Chen, Qi and Wang, Wei and Shi, Zijing and Shen, Tao and Chen, Ling},
  journal={arXiv preprint arXiv:2507.07640},
  year={2025},
  url={https://arxiv.org/abs/2507.07640}
}

โœ‰๏ธ Contact

For questions, collaborations, or dataset access:

Contributors

HTG13503

5 commits

Languages

Jupyter Notebook

100.0%