Skip to main content
Back

ToxiTrace Makes Chinese Toxic Content Detection 7x Faster With Readable Explanations

A new training method makes Chinese toxicity classifiers highlight the exact offensive phrases they flag, without needing span-level labels.

  • ToxiTrace trains BERT-style encoders to produce faithful, contiguous toxic span explanations for Chinese text.
  • Three components: CuSA span annotation, GCLoss gradient shaping, and ARCL contrastive reasoning.
  • BiCSE bidirectional scanning replaces top-k token selection, recovering coherent multi-character toxic phrases.
  • Matches or beats Qwen3-8B on CNTP span extraction while running roughly 7x faster.
  • Model released on Hugging Face under Apache 2.0 with training code on GitHub.
  • Doesn't handle homophone or Pinyin obfuscation, and LoRA-based transfer to decoder LLMs underperforms.

Chinese toxic content detection has a stubborn interpretability problem: a model can correctly flag a sentence as offensive without giving any usable signal about which characters actually caused the judgment. A new method called ToxiTrace tackles that gap by training BERT-style encoders so their gradients concentrate on real toxic evidence, producing contiguous, human-readable spans instead of scattered character highlights.

Why character-level attribution keeps breaking

Unlike English, where words serve as the basic semantic units, Chinese toxic expressions are typically realized as multi-character phrases, while individual characters are often semantically ambiguous. Mainstream Chinese pretrained language models adopt character-level tokenization, so attribution signals such as gradients or attention weights get fragmented across individual characters rather than coherent semantic spans, producing rationales that are difficult for humans to interpret.

The practical result is a familiar trade-off. Encoder models are fast and accurate at sentence-level classification but bad at pointing to the phrase that made them fire. Large language models can explain themselves and extract spans reasonably well, but they typically underperform on direct toxicity classification and incur substantially higher inference costs. ToxiTrace keeps the encoder side of that trade-off while borrowing the explanatory ability of the LLM side.