Welcome to the upgraded BRAC University Institutional Repository. We are currently organizing collections after a recent system upgrade. Homepage category counters may temporarily show lower numbers while syncing, but over 27,000 repository items remain safe and accessible. Please use the search bar to find theses, scholarly outputs, and institutional documents.

From toxicity to constructive dialogue: an LLM-driven detoxification approach with multi-source parallel data

bracu.degree.levelUndergraduate
bracu.type.groupStudent Works
datacite.rightsOpen Access
dc.contributor.advisorGazzali, MD. Fakhruddin
dc.contributor.advisorAzmain, Md. Aquib
dc.contributor.advisorSadeque, Farig Yousuf
dc.contributor.authorParvez, Md Fardin
dc.contributor.authorRashik, Aswadul Karim
dc.contributor.authorDeepto, MD Yameem Daiyan
dc.contributor.authorHaq, Mostakim Ul
dc.contributor.authorKhan, Alex Noor
dc.contributor.departmentDepartment of Computer Science and Engineering
dc.date.accessioned2025-09-16T05:07:23Z
dc.date.available2025-09-16T05:07:23Z
dc.date.copyright2025
dc.date.issued2025-06
dc.descriptionCataloged from PDF version of thesis.
dc.descriptionIncludes bibliographical references (pages 39-42).
dc.descriptionThis thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science, 2025.en_US
dc.description.abstractThe surge of toxic interactions online poses a serious obstacle to cultivating constructive digital spaces. Current automated detoxification systems, though encouraging in theory, often stumble: they veer off-topic (semantic drift), strip away too much nuance (over-detoxification), and operate like black boxes, eroding trust and complicating real-world use. In response, this paper outlines a detoxification pipeline designed to tackle these issues head-on by weaving explicit reasoning into grounded generation. Our proposed pipeline particularly introduces a multi-task setup that finetunes a 7-billion-parameter language model in two stages: first, it produces a clear explanation of why a comment is toxic (drawing on the concept of Chain-of-Thought prompting), and then it rewrites the comment. What sets our approach apart is a three-step inference routine: the explanation guides a retrieval query that fetches relevant, benign examples from a curated knowledge base via Retrieval-Augmented Generation. The final rewrite leans on both the rationale and these examples, anchoring the output in a transparent reasoning path and verified data. To bolster robustness, we merge data from over 40,000 cases across three sources—synthetic examples with reasoning (DetoxLLM), human-crafted paraphrases (ParaDetox), and adversarial hate speech instances (ToxiGen)—using a fresh fusion strategy. Crucially, we make the fine-tuning doable on everyday hardware by employing 4-bit Quantized Low-Rank Adaptation (QLoRA). Experiments show that our reasoningplus- retrieval pipeline is a feasible and effective alternative at retaining the original meaning while achieving strong style-transfer metrics. By emphasising not only performance but also clarity and fidelity, this system charts a path toward more accountable, inspectable moderation tools.en_US
dc.description.degreeBachelor of Science in Computer Science
dc.description.statementofresponsibilityMd Fardin Parvez
dc.description.statementofresponsibilityAswadul Karim Rashik
dc.description.statementofresponsibilityMD Yameem Daiyan Deepto
dc.description.statementofresponsibilityMostakim Ul Haq
dc.description.statementofresponsibilityAlex Noor Khan
dc.format.extent52 pages
dc.identifier.otherID 23341099
dc.identifier.otherID 24341250
dc.identifier.otherID 21241052
dc.identifier.otherID 23241080
dc.identifier.otherID 18241005
dc.identifier.urihttp://hdl.handle.net/10361/26753
dc.language.isoenen_US
dc.publisherBRAC Universityen_US
dc.rightsBRAC University theses are protected by copyright. They may be viewed from this source for any purpose, but reproduction or distribution in any format is prohibited without written permission.
dc.subjectChain-of-thought reasoningen_US
dc.subjectText detoxificationen_US
dc.subjectLarge language modelsen_US
dc.subjectBias mitigationen_US
dc.subjectLLM-driven detoxificationen_US
dc.subject.lcshNatural language processing (Computer science).
dc.subject.lcshComputational linguistics.
dc.subject.lcshText processing (Computer science).
dc.subject.lcshContent moderation (Social media).
dc.titleFrom toxicity to constructive dialogue: an LLM-driven detoxification approach with multi-source parallel dataen_US
dc.typeThesisen_US

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
23341099, 24341250, 21241052, 23241080, 18241005_CSE.pdf
Size:
488.75 KB
Format:
Adobe Portable Document Format
Description:

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
1.71 KB
Format:
Item-specific license agreed upon to submission
Description: