Abstract
Traditional content moderation often relies on a binary "keep or delete" approach, which can stifle online discussion and reduce the diversity of discourse. This paper proposes an alternative: paraphrasing offensive content into polite language using In-Context Learning (ICL). By providing Large Language Models (LLMs) with a few well-chosen examples, the researchers demonstrate that ICL matches the quality of specialized supervised models while reducing toxicity by 76% and requiring 90% less training data.
Introduction
Existing supervised paraphrasers, such as fine-tuned BART models, face two significant hurdles. First, they are "data hungry," requiring massive labeled datasets of toxic-to-civil pairs. Second, they often suffer from toxicity retention; because they are trained to preserve original meaning, they frequently fail to remove the offensive "sting" of the source text. This study investigates whether LLMs can overcome these issues by leveraging their pre-existing knowledge through ICL.
Methodology: In-Context Learning
The core approach involves constructing a prompt that guides the LLM without updating its underlying weights. As shown in Figure 1, an ICL prompt typically consists of a task instruction, a small set of demonstrations (input-output pairs), and the target query.
The researchers conducted a systematic study of demonstration selection and ordering. They found that "Most Similar (Descending Order)" selection—where examples are semantically closest to the query and arranged from most to least similar—yielded the best performance across models like GPT-3.5 and Vicuna-13b.
Datasets and Evaluation
The study utilized three key benchmarks:
- APPDIA: Offensive Reddit comments.
- ParaDetox: A large corpus of toxic/non-toxic pairs.
- CAPP (Context-Aware Polite Paraphrase): A new dataset introduced in this paper that focuses on dialogue, including the prior turns of conversation to provide necessary context for the rudeness.
Key Results
As illustrated in Figure 2, ICL-based approaches significantly outperformed supervised baselines in toxicity reduction while maintaining competitive linguistic quality (BLEU scores).
Major Findings:
- Toxicity Reduction: ICL paraphrasers achieved 76% lower toxicity than state-of-the-art supervised models. This suggests that ICL acts as a natural regularizer, stripping away toxicity more effectively than models explicitly trained to mimic specific datasets.
- Human Preference: In blind tests, humans rated ICL-generated paraphrases 25% better than those from supervised models.
- Efficiency and Robustness: Models reached near-peak performance using only 10% of available training data for example selection. Furthermore, the "Most Similar" retrieval method proved to be orders of magnitude faster than complex selection algorithms like MMR.
- The Power of Examples: Demonstrations were found to be the primary drivers of performance. In several instances, providing examples without any explicit instruction performed nearly as well as providing both.
Discussion and Future Work
While adding dialogue context in the CAPP dataset significantly improved relevance, the authors note that more sophisticated methods for incorporating conversational history could be explored. Additionally, while open-source models like Vicuna-13b performed well, they still lag behind closed-source models in following complex instructions. Finally, the researchers acknowledge the ethical risk of "reverse use," where these techniques could be used to toxify harmless content, highlighting the need for continued safety research.
Summary updated