Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
119 tokens/sec
GPT-4o
56 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
6 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

GPT-DETOX: An In-Context Learning-Based Paraphraser for Text Detoxification (2404.03052v1)

Published 3 Apr 2024 in cs.CL

Abstract: Harmful and offensive communication or content is detrimental to social bonding and the mental state of users on social media platforms. Text detoxification is a crucial task in NLP, where the goal is removing profanity and toxicity from text while preserving its content. Supervised and unsupervised learning are common approaches for designing text detoxification solutions. However, these methods necessitate fine-tuning, leading to computational overhead. In this paper, we propose GPT-DETOX as a framework for prompt-based in-context learning for text detoxification using GPT-3.5 Turbo. We utilize zero-shot and few-shot prompting techniques for detoxifying input sentences. To generate few-shot prompts, we propose two methods: word-matching example selection (WMES) and context-matching example selection (CMES). We additionally take into account ensemble in-context learning (EICL) where the ensemble is shaped by base prompts from zero-shot and all few-shot settings. We use ParaDetox and APPDIA as benchmark detoxification datasets. Our experimental results show that the zero-shot solution achieves promising performance, while our best few-shot setting outperforms the state-of-the-art models on ParaDetox and shows comparable results on APPDIA. Our EICL solutions obtain the greatest performance, adding at least 10% improvement, against both datasets.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (34)
  1. S. González-Bailón and Y. Lelkes, “Do social media undermine social cohesion? a critical review,” Social Issues and Policy Review, vol. 17, no. 1, pp. 155–180, 2023.
  2. W. X. Zhao, K. Zhou, J. Li, T. Tang, X. Wang, Y. Hou, Y. Min, B. Zhang, J. Zhang, Z. Dong et al., “A survey of large language models,” arXiv preprint arXiv:2303.18223, 2023.
  3. L. Weidinger, J. Mellor, M. Rauh, C. Griffin, J. Uesato, P.-S. Huang, M. Cheng, M. Glaese, B. Balle, A. Kasirzadeh et al., “Ethical and social risks of harm from language models,” arXiv preprint arXiv:2112.04359, 2021.
  4. T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell et al., “Language models are few-shot learners,” Advances in neural information processing systems, vol. 33, pp. 1877–1901, 2020.
  5. L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray et al., “Training language models to follow instructions with human feedback,” Advances in Neural Information Processing Systems, vol. 35, pp. 27 730–27 744, 2022.
  6. P. F. Christiano, J. Leike, T. Brown, M. Martic, S. Legg, and D. Amodei, “Deep reinforcement learning from human preferences,” Advances in neural information processing systems, vol. 30, 2017.
  7. J. Li, R. Jia, H. He, and P. Liang, “Delete, retrieve, generate: a simple approach to sentiment and style transfer,” arXiv preprint arXiv:1804.06437, 2018.
  8. X. Wu, T. Zhang, L. Zang, J. Han, and S. Hu, ““mask and infill”: Applying masked language model to sentiment transfer,” arXiv preprint arXiv:1908.08039, 2019.
  9. J. Lee, “Stable style transformer: Delete and generate approach with encoder-decoder for text style transfer,” arXiv preprint arXiv:2005.12086, 2020.
  10. D. Dale, A. Voronov, D. Dementieva, V. Logacheva, O. Kozlova, N. Semenov, and A. Panchenko, “Text detoxification using large pre-trained neural models,” arXiv preprint arXiv:2109.08914, 2021.
  11. V. Logacheva, D. Dementieva, S. Ustyantsev, D. Moskovskiy, D. Dale, I. Krotova, N. Semenov, and A. Panchenko, “Paradetox: Detoxification with parallel data,” in Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2022, pp. 6804–6818.
  12. K. Atwell, S. Hassan, and M. Alikhani, “Appdia: A discourse-aware transformer-based style transfer model for offensive social media conversations,” arXiv preprint arXiv:2209.08207, 2022.
  13. R. Liu, C. Gao, C. Jia, G. Xu, and S. Vosoughi, “Non-parallel text style transfer with self-parallel supervision,” 2022.
  14. J. He, X. Wang, G. Neubig, and T. Berg-Kirkpatrick, “A probabilistic formulation of unsupervised text style transfer,” arXiv preprint arXiv:2002.03912, 2020.
  15. M. Lewis, Y. Liu, N. Goyal, M. Ghazvininejad, A. Mohamed, O. Levy, V. Stoyanov, and L. Zettlemoyer, “BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension,” in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.   Online: Association for Computational Linguistics, Jul. 2020, pp. 7871–7880.
  16. G. Floto, M. M. A. Pour, P. Farinneya, Z. Tang, A. Pesaranghader, M. Bharadwaj, and S. Sanner, “Diffudetox: A mixed diffusion model for text detoxification,” 2023.
  17. T. Schick and H. Schütze, “It’s not just size that matters: Small language models are also few-shot learners,” 2021.
  18. J. Liu, D. Shen, Y. Zhang, B. Dolan, L. Carin, and W. Chen, “What makes good in-context examples for GPT-3?” in Proceedings of Deep Learning Inside Out (DeeLIO 2022): The 3rd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures.   Dublin, Ireland and Online: Association for Computational Linguistics, May 2022, pp. 100–114.
  19. J. Wei, M. Bosma, V. Y. Zhao, K. Guu, A. W. Yu, B. Lester, N. Du, A. M. Dai, and Q. V. Le, “Finetuned language models are zero-shot learners,” arXiv preprint arXiv:2109.01652, 2021.
  20. Y. Meng, J. Huang, Y. Zhang, and J. Han, “Generating training data with language models: Towards zero-shot language understanding,” 2022.
  21. K. M. Yoo, D. Park, J. Kang, S.-W. Lee, and W. Park, “Gpt3mix: Leveraging large-scale language models for text augmentation,” arXiv preprint arXiv:2104.08826, 2021.
  22. C. Zheng and M. Huang, “Exploring prompt-based few-shot learning for grounded dialog generation,” 2022.
  23. A. Madotto, Z. Lin, G. I. Winata, and P. Fung, “Few-shot bot: Prompt-based learning for dialogue systems,” 2021.
  24. Q. Ye, I. B. M. E. Peters, X. Ren, and H. Hajishirzi, “Investigating fusion methods for in-context learning.”
  25. Y.-J. Lee, C.-G. Lim, and H.-J. Choi, “Does gpt-3 generate empathetic dialogues? a novel in-context example selection method and automatic evaluation metric for empathetic dialogue generation,” in Proceedings of the 29th International Conference on Computational Linguistics, 2022, pp. 669–683.
  26. S. Ye, H. Hwang, S. Yang, H. Yun, Y. Kim, and M. Seo, “In-context instruction learning,” arXiv preprint arXiv:2302.14691, 2023.
  27. S. Shen, L. Hou, Y. Zhou, N. Du, S. Longpre, J. Wei, H. W. Chung, B. Zoph, W. Fedus, X. Chen et al., “Flan-moe: Scaling instruction-finetuned language models with sparse mixture of experts,” arXiv preprint arXiv:2305.14705, 2023.
  28. L. Wang, W. Xu, Y. Lan, Z. Hu, Y. Lan, R. K.-W. Lee, and E.-P. Lim, “Plan-and-solve prompting: Improving zero-shot chain-of-thought reasoning by large language models,” 2023.
  29. J. Wieting, T. Berg-Kirkpatrick, K. Gimpel, and G. Neubig, “Beyond bleu: training neural machine translation with semantic similarity,” arXiv preprint arXiv:1909.06694, 2019.
  30. J. Wieting and K. Gimpel, “Paranmt-50m: Pushing the limits of paraphrastic sentence embeddings with millions of machine translations,” arXiv preprint arXiv:1711.05732, 2017.
  31. A. Warstadt, A. Singh, and S. R. Bowman, “Cola: The corpus of linguistic acceptability (with added annotations),” 2019.
  32. K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu, “Bleu: a method for automatic evaluation of machine translation,” in Proceedings of the 40th annual meeting of the Association for Computational Linguistics, 2002, pp. 311–318.
  33. C.-W. Liu, R. Lowe, I. Serban, M. Noseworthy, L. Charlin, and J. Pineau, “How NOT to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation,” in Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing.   Austin, Texas: Association for Computational Linguistics, Nov. 2016, pp. 2122–2132.
  34. M. L. McHugh, “Interrater reliability: the kappa statistic,” Biochemia medica, vol. 22, no. 3, pp. 276–282, 2012.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (3)
  1. Ali Pesaranghader (10 papers)
  2. Nikhil Verma (10 papers)
  3. Manasa Bharadwaj (8 papers)
Citations (2)

Summary

We haven't generated a summary for this paper yet.