Many hostile messages in online conversations look harmless on their own. A reply like "A brick is more effective" means nothing until you see that the previous turn was "Refugees are arriving today." Today's best toxicity detectors read one sentence at a time. They were built by continuing to train language models on abusive text so that they learn its vocabulary and coded phrasing. This note proposes to leave those detectors untouched and train a separate small model in front of them. That model rewrites a context-dependent reply into a standalone sentence, filling in what the pronouns and omitted words point to, so a sentence-level detector can judge it correctly. When the reply already stands on its own, the model leaves it unchanged.
The constraint is what makes this a distinct method rather than "ask a chatbot to paraphrase." The rewriter may add only words copied verbatim from earlier turns, plus a small fixed set of connective and stance words such as "agrees," "rejects," and "that." It is trained without any gold rewrites. Its only learning signal is whether its rewrite makes a frozen detector agree with labels that human annotators gave while seeing the conversation. Because copying from context is bounded, the rewriter cannot invent hostility that the conversation does not contain. Because it is allowed to output the reply unchanged, it can ignore context exactly when context is noise.
Core Claim
The literature disagrees about whether conversational context helps toxicity detection. Toxicity Detection: Does Context Really Matter? built context-aware classifiers on Wikipedia Talk Page comments, the CAT-SMALL and CAT-LARGE datasets. It found no statistically significant gain from concatenating the parent comment, even though ROC AUC rose from 78.08% to 81.69%. Its explanation is that roughly 95% of comments do not depend on context, so the parent acts as noise. Hate Speech and Counter Speech Detection: Conversational Context Does Matter studied Reddit parent–reply pairs and reached the opposite conclusion. Annotators changed their label in 38.3% of cases once they saw the parent, and RoBERTa's weighted F1 rose from 0.58 to 0.64.
We claim both findings follow from one design choice. Both papers feed the parent to the classifier unconditionally, so the classifier must learn on its own when to use it. A rewriter that defaults to leaving the reply unchanged, and copies context into the reply only to resolve a dangling reference, should keep the gains on the context-dependent minority without paying the noise cost on the context-independent majority.
The second half of the claim concerns domain-specific pre-training. Specialized abusive-language encoders are sentence-level by construction. HateBERT continued masked-language-model training of BERT on 1.49M comments from banned Reddit communities, with the threads removed. ConPrompt used contrastive pre-training on standalone machine-generated statements and reached the lowest false-positive rate on neutral identity statements in HATECHECK (30.88%). Re-running such pre-training on conversation threads is expensive. It would also bring back the bias that HateBERT reports picking up from uncurated abusive text. Translating conversations into the single-sentence input these encoders were built for reuses their specialization as it is. It also makes every context-based decision inspectable: a moderator can read the rewrite that triggered the flag.
Research Program
The method borrows from conversational search, where rewriting a follow-up question into a standalone query is standard practice. Scaling Multi-Domain Dialogue State Tracking via Query Reformulation used pointer-generator networks to copy entities from dialogue history. We take its copy mechanism and make it a hard constraint. Our rewriter is a T5-sized sequence-to-sequence model whose decoder can emit only three kinds of output: tokens of the target reply, spans copied from up to $k$ prior turns, and a closed list of about 30 connective and stance words.
The training recipe adapts Breaking the Reference Bottleneck via Learning to Rewrite Conversational Queries without Gold Reference Passages. That paper's DualReform method trains a query rewriter with preference optimization using weak proxy signals instead of gold references, and reaches 96.9–99.1% of gold-supervised retrieval accuracy. PA-CQR likewise used preference optimization to stop rewriters from dropping key entities. In our version the weak signal is the context-aware toxicity label.
Concretely, we first warm-start the rewriter on a silver set of rewrites from a large language model, keeping only rewrites that satisfy the copy constraint. We then sample several candidate rewrites per conversation and score each with a frozen detector, either ConPrompt or HateBERT. We prefer a candidate when its predicted label matches the context-aware human label. Among candidates that match, we prefer the one with fewer edits, which means the unchanged reply wins whenever it is already labeled correctly. We then optimize these preferences with Direct Preference Optimization, a method that trains a model directly from pairs of preferred and rejected outputs.
This addresses a gap DualReform names itself: rewriters are optimized only for retrieval usefulness. Here the rewrite must instead preserve the communicative intent of the reply.
Two design questions are part of the study rather than settled.
The first is counter-speech. Yu et al. found that 55.1% of counter-hate replies looked neutral when read alone. A rewriter that copies the hateful parent into a rebuttal could turn it into apparent hate. The closed stance words, such as "rejects that …", exist to prevent this, and we measure whether they suffice.
The second is grounding in social norms. Social Norms Guide Reference Resolution showed that people resolve ambiguous references using norms and situational expectations, while standard coreference tools and GPT-3 did not. Latent Hatred found that adding Wikidata and ConceptNet knowledge did not help implicit hate detection. Together these warn us not to expect a factual entity linker to do the job. Our training signal is pragmatic, since it rewards agreement with human judgments made in context. We test whether that is enough.
Baselines
The naive reference point is the frozen sentence-level detector (ConPrompt and HateBERT) fine-tuned on each dataset and applied to the target reply alone. The rewriter must beat this on context-dependent items without losing more than one point of F1 or AUC on the rest.
The strongest existing competitor is concatenation fine-tuning: the same domain-pretrained encoder fine-tuned on "parent [SEP] reply," with Yu et al.'s auxiliary stance pre-training added. The best reported numbers are weighted F1 0.64 on Yu et al.'s Reddit data and ROC AUC 81.69% for CA-CONC-BERT-CCTK on CAT-LARGE from Pavlopoulos et al. This is the right comparison because it uses the same context and the same encoder and differs only in how context enters the model. For fairness, both systems see the same $k$ prior turns and the same labeled training split. Both receive matched hyperparameter search budgets: twenty trials each, with the rewriter's trials including its DPO steps. Total GPU-hours are reported for both. Beating it means a statistically significant gain on the context-flip subsets (bootstrap, $p<0.05$) together with parity elsewhere. It also means higher macro-F1 under cross-domain transfer, for example training on Reddit and testing on CAT and CONDA.
On in-game chat, ToxBuster from Towards Detecting Contextual Real-Time Toxicity for In-Game Chat is the reference. It reports F1 83.25 on Rainbow Six Siege versus 36.81 for Perspective API, using game metadata. We report a text-only version of it, because our setting excludes metadata. On CONDA, the reported implicit-toxicity F1 ranges from 0.59 to 0.76 across models in CONDA, and that range is the bar. We do not compare against CoSyn head-to-head, because it requires user post histories and social graphs. We note its reported gains and treat it as a different regime.
Three ablations isolate the key ingredients. The first is the same rewriter with no copy constraint, which tests whether the constraint prevents invented toxicity. The second is a rewriter forced to always rewrite, which tests whether being able to leave a reply unchanged is what resolves the noise problem. The third is a rewriter trained only on the silver LLM rewrites, without detector-agreement preferences, which tests whether the toxicity-aware training signal matters.
Why not just…?
Why not just fine-tune the detector on concatenated context? This is the real threat. If concatenation with stance pre-training matches us on the context-flip subsets and in transfer, then the rewriter's only remaining advantage is inspectability, and we will report exactly that. The evidence against concatenation is Pavlopoulos et al.'s non-significant result and their account of why: the classifier is tuned for the 95% of comments that need no context. That account is a hypothesis. Our flip-subset evaluation tests it directly, because a model that has learned to treat the parent as noise should fail precisely on flipped items.
Why not just prompt a large language model to rewrite, or to classify directly? No reported result was found on Lacuna for zero-shot LLM performance on CAT, Yu et al.'s Reddit data, or CONDA, so we run both variants ourselves under the same evaluation. The indirect evidence points against them. ConvGQR found fine-tuned T5 rewriters beating zero-shot GPT-4 on conversational retrieval. Abrams and Scheutz found GPT-3's norm-dependent reference resolution inconsistent across scenarios. Unconstrained LLM rewrites can also add hostility that was never in the conversation. Our faithfulness audit counts how often that happens.
Why not just continue pre-training HateBERT on full threads? This is the most natural extension of the domain pre-training line, and we train it: masked-language-model training on Reddit threads with parent comments, matched in token count to RAL-E, followed by concatenation fine-tuning. If it wins, conversational pre-training is the better investment. Our expectation is that it does not, for two reasons. It inherits the noise problem of concatenation. It also risks the bias acquisition HateBERT documents, and the HATECHECK false-positive rate on neutral identity statements will show whether that happens.
Proposed Experiments
We train on Yu et al.'s 6,846 Reddit pairs and on CAT-LARGE, and test in-domain and across domains on CAT-SMALL, CONDA, and the conversational datasets used by CoSyn, such as DIALOCONAN and CAD, where licenses permit.
The primary metric is macro-F1, or ROC AUC on CAT, reported separately for two groups of items. The first group is items whose human label flipped with context: CAT-SMALL's 5.2% flips, Yu et al.'s 38.3% disagreement set, and CONDA's implicit-toxicity class. The second group is all remaining items. Counter-speech recall is a separate metric, because it captures the copying failure mode described above. HATECHECK false-positive rate on neutral identity statements is the bias check, against ConPrompt's 30.88%.
We also run a faithfulness audit. Two annotators judge 500 rewrites on two questions: whether the rewrite preserves the reply's meaning in context, and whether it adds hostility absent from the conversation.
Three outcomes would decide the question. First, the gated, copy-constrained rewriter should significantly beat concatenation on flipped items while matching the reply-only detector elsewhere; this is the test of whether selective context resolves the contradiction between Pavlopoulos et al. and Yu et al. Second, its advantage should grow under cross-domain transfer, because resolving references should carry across platforms better than learning how to weight a concatenated parent. Third, removing the copy constraint should measurably raise the rate of added hostility and the false-positive rate. If the first outcome fails, the method has no case beyond interpretability, and we would say so.
References
- Toxicity Detection: Does Context Really Matter?
- Hate Speech and Counter Speech Detection: Conversational Context Does Matter
- HateBERT: Retraining BERT for Abusive Language Detection in English
- ConPrompt: Pre-training a Language Model with Machine-Generated Data for Implicit Hate Speech Detection
- Scaling Multi-Domain Dialogue State Tracking via Query Reformulation
- Breaking the Reference Bottleneck via Learning to Rewrite Conversational Queries without Gold Reference Passages
- Improving Contextual Query Rewrite for Conversational AI Agents through User-preference Feedback Learning
- Social Norms Guide Reference Resolution
- Latent Hatred: A Benchmark for Understanding Implicit Hate Speech
- Towards Detecting Contextual Real-Time Toxicity for In-Game Chat
- CONDA: a CONtextual Dual-Annotated dataset for in-game toxicity understanding and detection
- CoSyn: Detecting Implicit Hate Speech in Online Conversations Using a Context Synergized Hyperbolic Network
- ConvGQR: Generative Query Reformulation for Conversational Search