LLMs to Replace Crowdsourcing For Parallel Data Creation? The Case of Text Detoxification

Daniil Moskovskiy, Sergey Pletenev, Alexander PanchenkoEMNLP 2024

Abstract

Creating high-quality parallel datasets for text detoxification traditionally relies on expensive and slow crowdsourcing. This study explores whether Large Language Models (LLMs), specifically the Llama 3 family, can serve as effective synthetic data annotators. By employing a novel activation patching technique to bypass safety-alignment refusals, the researchers generated "PseudoParaDetox," a synthetic dataset. Results indicate that models trained on this LLM-generated data can outperform those trained on human-annotated data in terms of fluency and style transfer accuracy, suggesting a viable path toward automated dataset creation for sensitive NLP tasks.

Introduction

Text detoxification—rewriting toxic content into neutral, polite equivalents while preserving semantic meaning—is a critical task for maintaining healthy online discourse. The primary bottleneck in developing robust detoxification models is the scarcity of parallel data. Traditional human annotation is not only costly but often inconsistent. While LLMs possess the linguistic capability to perform these rewrites, their safety guardrails frequently cause them to refuse processing toxic input, even for benign research purposes. This paper addresses this "refusal hurdle" and evaluates the utility of LLM-generated synthetic data for training smaller, specialized models.

Methodology

The researchers proposed a workflow to generate synthetic parallel data using Llama 3 (8B and 70B) as an automated annotator.

Workflow comparing human-annotated ParaDetox with LLM-annotated PseudoParaDetox for training BART models.

Activation Patching

To overcome model refusals, the team utilized activation patching. This training-free method identifies the internal activation "direction" associated with refusal behaviors. By patching these specific directions in the model's weight matrices, the researchers effectively "un-censored" the models, allowing them to process toxic prompts from the ParaDetox dataset without triggering safety filters.

PseudoParaDetox Generation

Using the patched Llama 3 models, the researchers generated neutral rewrites for the toxic sentences in the ParaDetox corpus. This process was tested in both 0-shot and 10-shot configurations, resulting in the PseudoParaDetox dataset. Finally, a BART model was fine-tuned on this synthetic data to evaluate its downstream performance against a baseline trained on human data.

Results

The effectiveness of the activation patching technique was immediate and significant. As shown in the table below, refusal rates for the Llama 3 8B model dropped from 94% to 0% in a 0-shot setting.

Refusal rates of Llama 3 models before and after activation patching.

Performance Metrics

The synthetic data proved to be a high-quality training resource. Models trained on PseudoParaDetox achieved higher Style Transfer Accuracy (STA) and Fluency (FL) than the human-trained baseline. While human annotations maintained a slight edge in semantic Similarity (SIM), the overall Joint score (J)—which aggregates accuracy, similarity, and fluency—favored the LLM-driven approach. Specifically, the BART model trained on Llama 3 70B data achieved a J-score of 0.462, surpassing the human-trained baseline of 0.444.

Human Preference

Manual side-by-side evaluations confirmed these metrics. Human evaluators preferred the outputs of the BART model trained on LLM data over the baseline, with win rates of 58% for the 8B-sourced data and 65% for the 70B-sourced data.

Discussion and Limitations

The study demonstrates that LLMs can produce "cleaner" and more consistent training data than average crowd workers. However, several considerations remain:

  • Similarity Trade-off: LLMs tend to be more creative in their rewrites, which can lead to lower semantic similarity to the original toxic text compared to human literalism.
  • Scale and Prompting: The 70B model significantly outperformed the 8B variant, and the quality of output remains sensitive to the choice of few-shot examples.
  • Ethical Considerations: While activation patching is a powerful tool for data creation, the ability to bypass safety filters carries inherent risks of misuse for generating harmful content.

Conclusion

This research provides a proof-of-concept for replacing traditional crowdsourcing with LLM-based synthetic data generation in the domain of text detoxification. By technically bypassing refusal mechanisms, researchers can leverage the superior linguistic capabilities of large models to train smaller, efficient, and highly capable specialized models.

Summary updated

BibTeX
@inproceedings{moskovskiy2024llms,
  author = {Daniil Moskovskiy and Sergey Pletenev and Alexander Panchenko},
  title = {{LLMs to Replace Crowdsourcing For Parallel Data Creation? The Case of Text Detoxification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.839},
}
Figure