{"id":{"repo_id":"vt","oai_identifier":"oai:vtechworks.lib.vt.edu:10919/143655"},"canonical_url":"https://search.ndltd.org/etd/vt/oai:vtechworks.lib.vt.edu:10919/143655","repository":{"repo_id":"vt","name":"Virginia Tech","base_url":"https://vtechworks.lib.vt.edu/oai/request"},"display":{"title":"Defending the Dialog: Characterizing and Mitigating Harmful Fine-Tuning Attacks in Conversational AI","abstract":"Generative AI (GenAI), especially Large Language Models (LLMs), has transformed conversational AI, enabling chatbots that converse fluently across a wide range of topics and perform diverse downstream tasks. There is growing demand to customize chatbots for specific downstream applications, and LLMs are routinely fine-tuned on application or task-specific conversational datasets. This customization paradigm, however, introduces a new attack surface. We refer to this emerging class of attacks as harmful fine-tuning attacks, in which an adversary poisons the training dataset with harmful or unsafe samples, causing the resulting chatbot to produce unsafe responses. Such attacks can cause real harm, particularly for vulnerable populations, including minorities and those with physical or mental health challenges. This dissertation systematically characterizes and defends against harmful fine-tuning attacks in conversational AI. On the attack characterization side, we focus on toxicity injection attacks, a subclass of harmful fine-tuning attacks in which an adversary injects toxic language into the training dataset. We design malicious agents that leverage GenAI to automatically inject toxic conversations into a dialog-based learning (DBL) pipeline. We then study how such attacks can poison a deployed chatbot. We further investigate the resilience of existing defenses and find that while they are effective in non-adaptive settings, they become vulnerable to adaptive adversarial attacks. Building upon these findings, on the defense side, we propose Optimus, a novel defense framework that mitigates toxicity while preserving conversational utility and seamlessly integrates into existing fine-tuning pipelines. Optimus uses safety-aligned LLMs to identify toxic samples and combines synthetic healing data with direct preference optimization (DPO) to steer the chatbot toward safe responses. Optimus remains effective even when the toxicity classifier is biased or imperfect. Optimus also remains resilient against adaptive adversarial attacks that target individual stages of the defense pipeline. Modern general-purpose chatbots, however, face a much broader range of safety harms beyond toxicity. Building upon Optimus, we propose SafetyOpus, a generalized defense framework that extends its design to a broad spectrum of safety harms spanning hate speech, drug abuse, self-harm, violence, and child abuse. SafetyOpus uses purpose-built LLM-based guardrail filters to identify harmful context-response pairs. SafetyOpus's framework restores the chatbot's safety and utility to levels comparable to those of the original base model, while also mitigating the alignment drift that arises during fine-tuning. Notably, this performance holds even when the underlying guardrail filter is imperfect, demonstrating that SafetyOpus generalizes beyond the filter's detection horizon. This dissertation takes an important step toward making chatbot customization safer by offering deployable defenses and valuable insights for future research toward developing safer and more reliable conversational AI.","abstract_html":"Generative AI (GenAI), especially Large Language Models (LLMs), has transformed conversational AI, enabling chatbots that converse fluently across a wide range of topics and perform diverse downstream tasks. There is growing demand to customize chatbots for specific downstream applications, and LLMs are routinely fine-tuned on application or task-specific conversational datasets. This customization paradigm, however, introduces a new attack surface. We refer to this emerging class of attacks as harmful fine-tuning attacks, in which an adversary poisons the training dataset with harmful or unsafe samples, causing the resulting chatbot to produce unsafe responses. Such attacks can cause real harm, particularly for vulnerable populations, including minorities and those with physical or mental health challenges. This dissertation systematically characterizes and defends against harmful fine-tuning attacks in conversational AI. On the attack characterization side, we focus on toxicity injection attacks, a subclass of harmful fine-tuning attacks in which an adversary injects toxic language into the training dataset. We design malicious agents that leverage GenAI to automatically inject toxic conversations into a dialog-based learning (DBL) pipeline. We then study how such attacks can poison a deployed chatbot. We further investigate the resilience of existing defenses and find that while they are effective in non-adaptive settings, they become vulnerable to adaptive adversarial attacks. Building upon these findings, on the defense side, we propose Optimus, a novel defense framework that mitigates toxicity while preserving conversational utility and seamlessly integrates into existing fine-tuning pipelines. Optimus uses safety-aligned LLMs to identify toxic samples and combines synthetic healing data with direct preference optimization (DPO) to steer the chatbot toward safe responses. Optimus remains effective even when the toxicity classifier is biased or imperfect. Optimus also remains resilient against adaptive adversarial attacks that target individual stages of the defense pipeline. Modern general-purpose chatbots, however, face a much broader range of safety harms beyond toxicity. Building upon Optimus, we propose SafetyOpus, a generalized defense framework that extends its design to a broad spectrum of safety harms spanning hate speech, drug abuse, self-harm, violence, and child abuse. SafetyOpus uses purpose-built LLM-based guardrail filters to identify harmful context-response pairs. SafetyOpus&#x27;s framework restores the chatbot&#x27;s safety and utility to levels comparable to those of the original base model, while also mitigating the alignment drift that arises during fine-tuning. Notably, this performance holds even when the underlying guardrail filter is imperfect, demonstrating that SafetyOpus generalizes beyond the filter&#x27;s detection horizon. This dissertation takes an important step toward making chatbot customization safer by offering deployable defenses and valuable insights for future research toward developing safer and more reliable conversational AI.","abstract_has_math":false,"creators":["Cheruvu, Aravind"],"institution":"Virginia Tech","degree_name":"Doctor of Philosophy","degree_level":"doctoral","degree_discipline":"Computer Science & Applications","degree_department":"Computer Science and#38; Applications","school":null,"contributors":[],"advisors":[],"committee_chairs":["Yao, Danfeng"],"committee_members":["Chung, Taejoong Tijay","Cheng, Long","Gao, Peng","Hicks, Matthew"],"year":2026,"date_issued":"2026-07-14","date_published":"2026-07-14","updated_at":"2026-11-18T20:07:59Z","subjects":["Conversational AI","Data Poisoning","Harmful Fine-Tuning","Toxicity Mitigation","AI Security"],"languages":["en"],"rights":["Creative Commons Attribution 4.0 International"],"rights_urls":["http://creativecommons.org/licenses/by/4.0/"],"identifier_entries":[{"key":"dc:identifier.other","label":"Dc Identifier Other","values":["vt_gsexam:47422"],"render_values":[{"text":"vt_gsexam:47422","href":null,"code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/10919/143655","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/10919/143655","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","download_url":null,"download_label":null,"download_source":null,"access_status":null,"embargo_until":null,"access_note":null},"source_record":{"url":"https://vtechworks.lib.vt.edu/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Avtechworks.lib.vt.edu%3A10919%2F143655","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.committeechair","label":"Committee Chair","values":["Yao, Danfeng"]},{"key":"dc:contributor.committeemember","label":"Committee Member","values":["Chung, Taejoong Tijay","Cheng, Long","Gao, Peng","Hicks, Matthew"]},{"key":"dc:contributor.department","label":"Department","values":["Computer Science and#38; Applications"]},{"key":"dc:creator","label":"Author","values":["Cheruvu, Aravind"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2026-07-15T08:00:52Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2026-07-15T08:00:52Z"]},{"key":"dc:date.issued","label":"Date","values":["2026-07-14"]},{"key":"dc:publisher","label":"Institution","values":["Virginia Tech"]},{"key":"dc:type","label":"Dc Type","values":["Dissertation"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Computer Science & Applications"]},{"key":"thesis:degree_level","label":"Degree Level","values":["doctoral"]},{"key":"thesis:degree_name","label":"Degree Name","values":["Doctor of Philosophy"]},{"key":"thesis:institution_name","label":"Thesis Institution Name","values":["Virginia Polytechnic Institute and State University"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Conversational AI","Data Poisoning","Harmful Fine-Tuning","Toxicity Mitigation","AI Security"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["en"]},{"key":"dc:rights","label":"Dc Rights","values":["Creative Commons Attribution 4.0 International"]},{"key":"dc:rights.uri","label":"Rights URI","values":["http://creativecommons.org/licenses/by/4.0/"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.other","label":"Dc Identifier Other","values":["vt_gsexam:47422"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/10919/143655"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Generative AI (GenAI), especially Large Language Models (LLMs), has transformed conversational AI, enabling chatbots that converse fluently across a wide range of topics and perform diverse downstream tasks. There is growing demand to customize chatbots for specific downstream applications, and LLMs are routinely fine-tuned on application or task-specific conversational datasets. This customization paradigm, however, introduces a new attack surface. We refer to this emerging class of attacks as harmful fine-tuning attacks, in which an adversary poisons the training dataset with harmful or unsafe samples, causing the resulting chatbot to produce unsafe responses. Such attacks can cause real harm, particularly for vulnerable populations, including minorities and those with physical or mental health challenges. This dissertation systematically characterizes and defends against harmful fine-tuning attacks in conversational AI. On the attack characterization side, we focus on toxicity injection attacks, a subclass of harmful fine-tuning attacks in which an adversary injects toxic language into the training dataset. We design malicious agents that leverage GenAI to automatically inject toxic conversations into a dialog-based learning (DBL) pipeline. We then study how such attacks can poison a deployed chatbot. We further investigate the resilience of existing defenses and find that while they are effective in non-adaptive settings, they become vulnerable to adaptive adversarial attacks. Building upon these findings, on the defense side, we propose Optimus, a novel defense framework that mitigates toxicity while preserving conversational utility and seamlessly integrates into existing fine-tuning pipelines. Optimus uses safety-aligned LLMs to identify toxic samples and combines synthetic healing data with direct preference optimization (DPO) to steer the chatbot toward safe responses. Optimus remains effective even when the toxicity classifier is biased or imperfect. Optimus also remains resilient against adaptive adversarial attacks that target individual stages of the defense pipeline. Modern general-purpose chatbots, however, face a much broader range of safety harms beyond toxicity. Building upon Optimus, we propose SafetyOpus, a generalized defense framework that extends its design to a broad spectrum of safety harms spanning hate speech, drug abuse, self-harm, violence, and child abuse. SafetyOpus uses purpose-built LLM-based guardrail filters to identify harmful context-response pairs. SafetyOpus's framework restores the chatbot's safety and utility to levels comparable to those of the original base model, while also mitigating the alignment drift that arises during fine-tuning. Notably, this performance holds even when the underlying guardrail filter is imperfect, demonstrating that SafetyOpus generalizes beyond the filter's detection horizon. This dissertation takes an important step toward making chatbot customization safer by offering deployable defenses and valuable insights for future research toward developing safer and more reliable conversational AI."]},{"key":"dc:description.abstractgeneral","label":"General Abstract","values":["Modern AI chatbots powered by Large Language Models (LLMs) are increasingly being used to converse with people, answer questions, and assist with a wide range of everyday tasks. To make these chatbots useful for specific applications, developers commonly adapt them by further training on additional conversational datasets, a step called fine-tuning. However, if a portion of such training data is untrustworthy or has been intentionally manipulated by an adversary, the chatbot can learn harmful behaviors and produce toxic, hateful, or otherwise unsafe responses. This can cause real harm, particularly for vulnerable groups such as minorities and those with mental health challenges. To address this problem, this dissertation studies the security of chatbots in two complementary directions. We first investigate how attackers can design automated agents powered by LLMs that masquerade as fake users to steer chatbots into learning toxic or unsafe behaviors. We study how well existing defenses work when attackers with knowledge of such defenses attempt to evade them. We then develop defense frameworks that protect chatbots from learning harmful behaviors during fine-tuning, even when the defender does not have knowledge of what kind of harmful content the attacker is using. Our defenses use a safety detector to identify potentially harmful samples in the training data, replace them with carefully crafted safer examples, and guide the chatbot toward safer and more helpful responses. They cover a broad range of harms, including hate speech, drug abuse, self-harm, violence, and child abuse. Our defenses restore the chatbot's safety and utility to levels comparable to the original model before fine-tuning. Our defense frameworks remain effective even when attackers actively try to evade them or when the underlying safety detector is imperfect and misses a substantial fraction of harmful content. This work takes a step toward AI chatbots that remain safe and helpful as they are adapted for new use cases, and points the way for future research on building chatbots that people can rely on."]},{"key":"dc:description.degree","label":"Dc Description Degree","values":["Doctor of Philosophy"]},{"key":"dc:format.medium","label":"Dc Format Medium","values":["ETD"]},{"key":"dc:title","label":"Title","values":["Defending the Dialog: Characterizing and Mitigating Harmful Fine-Tuning Attacks in Conversational AI"]}]}],"canonical_facts":{"dc:contributor.committeechair":["Yao, Danfeng"],"dc:contributor.committeemember":["Chung, Taejoong Tijay","Cheng, Long","Gao, Peng","Hicks, Matthew"],"dc:contributor.department":["Computer Science and#38; Applications"],"dc:creator":["Cheruvu, Aravind"],"dc:date.accessioned":["2026-07-15T08:00:52Z"],"dc:date.available":["2026-07-15T08:00:52Z"],"dc:date.issued":["2026-07-14"],"dc:description.abstract":["Generative AI (GenAI), especially Large Language Models (LLMs), has transformed conversational AI, enabling chatbots that converse fluently across a wide range of topics and perform diverse downstream tasks. There is growing demand to customize chatbots for specific downstream applications, and LLMs are routinely fine-tuned on application or task-specific conversational datasets. This customization paradigm, however, introduces a new attack surface. We refer to this emerging class of attacks as harmful fine-tuning attacks, in which an adversary poisons the training dataset with harmful or unsafe samples, causing the resulting chatbot to produce unsafe responses. Such attacks can cause real harm, particularly for vulnerable populations, including minorities and those with physical or mental health challenges. This dissertation systematically characterizes and defends against harmful fine-tuning attacks in conversational AI. On the attack characterization side, we focus on toxicity injection attacks, a subclass of harmful fine-tuning attacks in which an adversary injects toxic language into the training dataset. We design malicious agents that leverage GenAI to automatically inject toxic conversations into a dialog-based learning (DBL) pipeline. We then study how such attacks can poison a deployed chatbot. We further investigate the resilience of existing defenses and find that while they are effective in non-adaptive settings, they become vulnerable to adaptive adversarial attacks. Building upon these findings, on the defense side, we propose Optimus, a novel defense framework that mitigates toxicity while preserving conversational utility and seamlessly integrates into existing fine-tuning pipelines. Optimus uses safety-aligned LLMs to identify toxic samples and combines synthetic healing data with direct preference optimization (DPO) to steer the chatbot toward safe responses. Optimus remains effective even when the toxicity classifier is biased or imperfect. Optimus also remains resilient against adaptive adversarial attacks that target individual stages of the defense pipeline. Modern general-purpose chatbots, however, face a much broader range of safety harms beyond toxicity. Building upon Optimus, we propose SafetyOpus, a generalized defense framework that extends its design to a broad spectrum of safety harms spanning hate speech, drug abuse, self-harm, violence, and child abuse. SafetyOpus uses purpose-built LLM-based guardrail filters to identify harmful context-response pairs. SafetyOpus's framework restores the chatbot's safety and utility to levels comparable to those of the original base model, while also mitigating the alignment drift that arises during fine-tuning. Notably, this performance holds even when the underlying guardrail filter is imperfect, demonstrating that SafetyOpus generalizes beyond the filter's detection horizon. This dissertation takes an important step toward making chatbot customization safer by offering deployable defenses and valuable insights for future research toward developing safer and more reliable conversational AI."],"dc:description.abstractgeneral":["Modern AI chatbots powered by Large Language Models (LLMs) are increasingly being used to converse with people, answer questions, and assist with a wide range of everyday tasks. To make these chatbots useful for specific applications, developers commonly adapt them by further training on additional conversational datasets, a step called fine-tuning. However, if a portion of such training data is untrustworthy or has been intentionally manipulated by an adversary, the chatbot can learn harmful behaviors and produce toxic, hateful, or otherwise unsafe responses. This can cause real harm, particularly for vulnerable groups such as minorities and those with mental health challenges. To address this problem, this dissertation studies the security of chatbots in two complementary directions. We first investigate how attackers can design automated agents powered by LLMs that masquerade as fake users to steer chatbots into learning toxic or unsafe behaviors. We study how well existing defenses work when attackers with knowledge of such defenses attempt to evade them. We then develop defense frameworks that protect chatbots from learning harmful behaviors during fine-tuning, even when the defender does not have knowledge of what kind of harmful content the attacker is using. Our defenses use a safety detector to identify potentially harmful samples in the training data, replace them with carefully crafted safer examples, and guide the chatbot toward safer and more helpful responses. They cover a broad range of harms, including hate speech, drug abuse, self-harm, violence, and child abuse. Our defenses restore the chatbot's safety and utility to levels comparable to the original model before fine-tuning. Our defense frameworks remain effective even when attackers actively try to evade them or when the underlying safety detector is imperfect and misses a substantial fraction of harmful content. This work takes a step toward AI chatbots that remain safe and helpful as they are adapted for new use cases, and points the way for future research on building chatbots that people can rely on."],"dc:description.degree":["Doctor of Philosophy"],"dc:format.medium":["ETD"],"dc:identifier.other":["vt_gsexam:47422"],"dc:identifier.uri":["https://hdl.handle.net/10919/143655"],"dc:language.iso":["en"],"dc:publisher":["Virginia Tech"],"dc:rights":["Creative Commons Attribution 4.0 International"],"dc:rights.uri":["http://creativecommons.org/licenses/by/4.0/"],"dc:subject":["Conversational AI","Data Poisoning","Harmful Fine-Tuning","Toxicity Mitigation","AI Security"],"dc:title":["Defending the Dialog: Characterizing and Mitigating Harmful Fine-Tuning Attacks in Conversational AI"],"dc:type":["Dissertation"],"thesis:degree_discipline":["Computer Science & Applications"],"thesis:degree_level":["doctoral"],"thesis:degree_name":["Doctor of Philosophy"],"thesis:institution_name":["Virginia Polytechnic Institute and State University"]},"updated_at":"2026-11-18T20:07:59Z"}