{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/just-say-no-analyzing-the-stance-of-neural","title":"Just Say No: Analyzing the Stance of Neural Dialogue Generation in Offensive Contexts","arxiv_id":"2108.11830","date":"2021-08-26","proceeding":"EMNLP 2021 11","authors":["Ashutosh Baheti","Maarten Sap","Alan Ritter","Mark Riedl"],"abstract":"Dialogue models trained on human conversations inadvertently learn to generate toxic responses. In addition to producing explicitly offensive utterances, these models can also implicitly insult a group or individual by aligning themselves with an offensive statement. To better understand the dynamics of contextually offensive language, we investigate the stance of dialogue model responses in offensive Reddit conversations. Specifically, we create ToxiChat, a crowd-annotated dataset of 2,000 Reddit threads and model responses labeled with offensive language and stance. Our analysis reveals that 42% of human responses agree with toxic comments, whereas only 13% agree with safe comments. This undesirable behavior is learned by neural dialogue models, such as DialoGPT, which we show are two times more likely to agree with offensive comments. To enable automatic detection of offensive language, we fine-tuned transformer-based classifiers on ToxiChat that achieve 0.71 F1 for offensive labels and 0.53 Macro-F1 for stance labels. Finally, we quantify the effectiveness of controllable text generation (CTG) methods to mitigate the tendency of neural dialogue models to agree with offensive comments. Compared to the baseline, our best CTG model achieves a 19% reduction in agreement with offensive comments and produces 29% fewer offensive replies. Our work highlights the need for further efforts to characterize and analyze inappropriate behavior in dialogue models, in order to help make them safer. Our code and corpus are available at https://github.com/abaheti95/ToxiChat .","url_abs":"https://arxiv.org/abs/2108.11830v2","url_pdf":"https://arxiv.org/pdf/2108.11830v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"just-say-no-analyzing-the-stance-of-neural","repo_url":"https://github.com/abaheti95/toxichat","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"CC-BY-SA-4.0"}}],"tasks":[{"task_slug":"dialogue-generation","task_name":"Dialogue Generation"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2108.11830","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.11830"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/abaheti95/toxichat","reach":{"status":"ok","spdx":"CC-BY-SA-4.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/abaheti95/ToxiChat","reach":{"status":"ok","spdx":"CC-BY-SA-4.0"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":1,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":5,"samples":[{"code_sha256_prefix":"644397b5b7a04dfd","entry":"get_GPT2_string_from_utterances","repo":"abaheti95/toxichat","repo_kind":"official","path":"experiments/train_and_evaluate_DGPT_offensive_classifier.py","file_url":"https://github.com/abaheti95/toxichat/blob/HEAD/experiments/train_and_evaluate_DGPT_offensive_classifier.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"CC-BY-SA-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"644397b5b7a04dfd"}},{"code_sha256_prefix":"851b700c4f538348","entry":"get_first_and_reply_f1_for_OS_C_flat_dataset","repo":"abaheti95/toxichat","repo_kind":"official","path":"experiments/train_and_evaluate_NBOW_offensive_classifier.py","file_url":"https://github.com/abaheti95/toxichat/blob/HEAD/experiments/train_and_evaluate_NBOW_offensive_classifier.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"CC-BY-SA-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"851b700c4f538348"}},{"code_sha256_prefix":"18a7fe95b28ee45d","entry":"reweight","repo":"abaheti95/toxichat","repo_kind":"official","path":"experiments/train_and_evaluate_BERT_offensive_classifier.py","file_url":"https://github.com/abaheti95/toxichat/blob/HEAD/experiments/train_and_evaluate_BERT_offensive_classifier.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"CC-BY-SA-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"18a7fe95b28ee45d"}},{"code_sha256_prefix":"50890dea0cb3dbeb","entry":"evaluate_OC_S_NBOW_offensive_predictions","repo":"abaheti95/toxichat","repo_kind":"official","path":"experiments/train_and_evaluate_NBOW_offensive_classifier.py","file_url":"https://github.com/abaheti95/toxichat/blob/HEAD/experiments/train_and_evaluate_NBOW_offensive_classifier.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"CC-BY-SA-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"50890dea0cb3dbeb"}},{"code_sha256_prefix":"b8bc11854f95d579","entry":"make_bert_predictions_on_offensive_dataset","repo":"abaheti95/toxichat","repo_kind":"official","path":"experiments/train_and_evaluate_BERT_offensive_classifier.py","file_url":"https://github.com/abaheti95/toxichat/blob/HEAD/experiments/train_and_evaluate_BERT_offensive_classifier.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"CC-BY-SA-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"b8bc11854f95d579"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}