Wuhan University's ContiGuard Beats Commercial AI Moderators at 86% Accuracy
A new framework called ContiGuard teaches toxicity detectors to keep up with attackers who constantly invent new ways to disguise slurs and hateful text.
ProTakeaways
- ContiGuard is the first continual learning framework built specifically for evolving toxicity evasion tactics.
- Combines LLM-based semantic enrichment, discriminability-driven feature learning, and memory replay on a BERT-base detector.
- Reaches 86.47% average accuracy across nine perturbation types, beating even joint training on all data.
- Existing detectors like PerspectiveAPI and Detoxify drop 14 to 36 percent on perturbed text.
- Ships with DynEscape, a new perturbation-wise dataset built by attacking a safety-aligned LLaMA-3.
- Code, dataset, and lightweight LLM-free variant available at github.com/khk-abc/ContiGuard.
Content moderation has a moving-target problem. As soon as a classifier learns to flag a slur, someone writes it as id10t, iiiddioot, or wraps it in a paragraph pretending to be a scientist. A team from Wuhan University and Qilu University of Technology is proposing a framework called ContiGuard that treats each new evasion trick as a fresh domain the detector has to learn on the fly, without forgetting the old ones.
The paper, accepted at the ACM Web Conference 2026, argues that continual learning is the right lens for toxicity detection because attackers do not stand still. Existing detectors degrade significantly under perturbations, with relative drops ranging from 35.8% to 14.4% compared to ordinary text, meaning even production APIs collapse on text that any human would still read as hateful.
Why static detectors keep failing
The authors test popular systems including PerspectiveAPI, OpenAI Moderation, ToxicBERT, and several Detoxify variants on nine perturbation styles. Every one of them drops sharply. The obvious fix, fine-tuning on perturbed text, does not generalize either: statically fine-tuned detectors perform well on the types of perturbed text used for fine-tuning, but perform poorly on other types of perturbed text, and even perform randomly on many types.

Two deeper problems make this hard. First, character-level noise scrambles the semantics enough that BERT-style encoders lose the toxic signal. Second, the model starts latching onto surface artifacts of the perturbation itself (the specific way characters were repeated or replaced) rather than the underlying insult. When a new perturbation shows up, those artifacts are useless.
Three moving parts
ContiGuard bolts three strategies onto a standard BERT-base classifier to address this:
- LLM-powered semantic enriching. A frozen LLM (
gpt-4o-miniin the experiments) is prompted with a How-Why-What chain to recover the likely original meaning and toxicity clues of the perturbed text. Those features are then mixed into the detector's encoder with a learned per-sample weight. - Discriminability-driven feature learning. The team uses integrated gradients to score each feature dimension's contribution to the toxic vs non-toxic decision. Dimensions that push both classes the same way are treated as noise and unlearned toward a uniform distribution; discriminative dimensions are strengthened by flipping the features and forcing the classifier to still get the label right.
- Historical capability replay. A small memory buffer of past examples is kept, and the current encoder is aligned to the old encoder's features on those samples via cosine similarity, so previously learned perturbation types are not overwritten.

The intuition behind the LLM piece is worth pausing on. The auxiliary information from the LLM adds possible meaning and toxicity-related clues into the perturbed text to enhance comprehension, but it also acts as a smoother gradient signal during training, pulling the optimizer away from the jagged local minima that noisy perturbed text tends to create.
A new dataset built by attacking a detector
To evaluate this properly, the authors built DynEscape, a perturbation-wise dataset derived from Jigsaw. It covers nine perturbation families: character insert, repeat, swap, remove, homoglyph, mask, abbreviation/slang, authority framing, and distractor prefixes. Each family is kept as a separate split so continual learning can be tested one domain at a time. To keep the samples genuinely hard, the pipeline uses the perturbation tool as an attacker against a safety-aligned LLaMA-3 and only keeps the perturbed samples that successfully evade detection.
The numbers
On DynEscape, ContiGuard reaches 86.47% average accuracy across all nine perturbation types, compared to roughly 55 to 64% for commercial APIs and fine-tuned baselines. It also beats every continual learning baseline the authors tested, including EWC, LWF, GEM, EPI, CEAR, DUCT, and SOYO. Notably, ContiGuard performs the best and outperforms Joint, despite Joint utilizing all data at every moment, which is the training regime where the model sees everything at once and is usually treated as the upper bound.

A cross-dataset check on NoisyHate, a collection of real human-written perturbations from the wild, shows the same pattern. And when the LLM is dropped at inference time (ContiGuard_Eco), the detector still outperforms the previous best on NoisyHate while running at about 220 items per second, which makes it plausible for actual moderation pipelines.
What it is good for, and where it will struggle
The obvious fit is any moderation stack where adversaries keep inventing new evasions: comment sections, chat platforms, and multiplayer game lobbies. The design also fits organizations that already run BERT-scale classifiers and want a way to keep patching them without full retraining.
The limits are worth naming:
- It is English-only. The dataset is built from Jigsaw and evaluated against English perturbation styles.
- It leans on a proprietary LLM for the semantic enriching step during training, which raises cost and reproducibility questions even though the Eco variant drops it at test time.
- The nine perturbation types are broad but predefined; genuinely novel attack categories (say, image-text hybrids) are out of scope.
- Toxicity itself is binary in this setup, so nuanced categories like harassment vs hate vs threat are not distinguished.
The code and the DynEscape dataset are on GitHub, which is what makes this useful beyond a benchmark result. The bigger contribution is arguably the framing: treating adversarial perturbations as a sequence of domains and formally testing whether continual learning methods designed for vision benchmarks actually transfer to a task where the input distribution is being adversarially shaped by humans. The answer, based on their results, is that generic continual learning methods do not transfer well, and something task-specific is needed.