From toxicity to constructive dialogue: an LLM-driven detoxification approach with multi-source parallel data
| bracu.degree.level | Undergraduate | |
| bracu.type.group | Student Works | |
| datacite.rights | Open Access | |
| dc.contributor.advisor | Gazzali, MD. Fakhruddin | |
| dc.contributor.advisor | Azmain, Md. Aquib | |
| dc.contributor.advisor | Sadeque, Farig Yousuf | |
| dc.contributor.author | Parvez, Md Fardin | |
| dc.contributor.author | Rashik, Aswadul Karim | |
| dc.contributor.author | Deepto, MD Yameem Daiyan | |
| dc.contributor.author | Haq, Mostakim Ul | |
| dc.contributor.author | Khan, Alex Noor | |
| dc.contributor.department | Department of Computer Science and Engineering | |
| dc.date.accessioned | 2025-09-16T05:07:23Z | |
| dc.date.available | 2025-09-16T05:07:23Z | |
| dc.date.copyright | 2025 | |
| dc.date.issued | 2025-06 | |
| dc.description | Cataloged from PDF version of thesis. | |
| dc.description | Includes bibliographical references (pages 39-42). | |
| dc.description | This thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science, 2025. | en_US |
| dc.description.abstract | The 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.degree | Bachelor of Science in Computer Science | |
| dc.description.statementofresponsibility | Md Fardin Parvez | |
| dc.description.statementofresponsibility | Aswadul Karim Rashik | |
| dc.description.statementofresponsibility | MD Yameem Daiyan Deepto | |
| dc.description.statementofresponsibility | Mostakim Ul Haq | |
| dc.description.statementofresponsibility | Alex Noor Khan | |
| dc.format.extent | 52 pages | |
| dc.identifier.other | ID 23341099 | |
| dc.identifier.other | ID 24341250 | |
| dc.identifier.other | ID 21241052 | |
| dc.identifier.other | ID 23241080 | |
| dc.identifier.other | ID 18241005 | |
| dc.identifier.uri | http://hdl.handle.net/10361/26753 | |
| dc.language.iso | en | en_US |
| dc.publisher | BRAC University | en_US |
| dc.rights | BRAC 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.subject | Chain-of-thought reasoning | en_US |
| dc.subject | Text detoxification | en_US |
| dc.subject | Large language models | en_US |
| dc.subject | Bias mitigation | en_US |
| dc.subject | LLM-driven detoxification | en_US |
| dc.subject.lcsh | Natural language processing (Computer science). | |
| dc.subject.lcsh | Computational linguistics. | |
| dc.subject.lcsh | Text processing (Computer science). | |
| dc.subject.lcsh | Content moderation (Social media). | |
| dc.title | From toxicity to constructive dialogue: an LLM-driven detoxification approach with multi-source parallel data | en_US |
| dc.type | Thesis | en_US |
Files
Original bundle
1 - 1 of 1
Loading...
- Name:
- 23341099, 24341250, 21241052, 23241080, 18241005_CSE.pdf
- Size:
- 488.75 KB
- Format:
- Adobe Portable Document Format
- Description:
License bundle
1 - 1 of 1
Loading...
- Name:
- license.txt
- Size:
- 1.71 KB
- Format:
- Item-specific license agreed upon to submission
- Description: