TRL : A Transformer Based Approach to Mental Health Counseling with Retrieval Augmented Generation and Low Rank Adaptation

Thumbnail Image

Date

2025-10-25

Journal Title

Journal ISSN

Volume Title

Publisher

Department of Computer Science and Engineering(CSE), Islamic University of Technology(IUT), Board Bazar, Gazipur-1704, Bangladesh

Abstract

Mental health is a critical component of global well-being, yet access to timely and af fordable careremains limitedduetostigma,scarcityofprofessionals,andeconomicor geographic barriers. In Bangladesh, where prevalence rates of anxiety and depression among adolescents and university students are alarmingly high, these challenges are particularly severe. At the same time, advances in artificial intelligence (AI) and nat ural language processing (NLP) have created new opportunities to deliver accessible and scalable mental health support through conversational agents. This research investigates the development of an AI-powered counseling chatbot us ing textual transformers. Building on the strengths of large language models, we refine response generation through the integration of Retrieval-Augmented Gener ation (RAG) and Low-Rank Adaptation (LoRA). RAG enables dynamic access to rel evant external knowledge, while LoRA provides efficient fine-tuning, resulting in a lightweight yet effective model. Our approach emphasizes improving contextual ac curacy, mitigating hallucinations, and ensuring sensitivity to the nuanced nature of mental health conversations. The contributions of this work are threefold: (1) advancing transformer-based meth ods to generate precise, compassionate, and personalized counseling responses; (2) addressing key challenges such as dataset authenticity, preprocessing for sensitive text, and factual reliability; and (3) proposing a scalable framework for deploying mental health chatbots in resource-constrained contexts. Ultimately, this research aims to bridge the gap between individuals in need of psychological support and the care they are often unable to access, offering an ethical, efficient, and practical AI driven solution.

Description

Supervised by Mr. Tareque Mohmud Chowdhury, Assistant Professor, Department of Computer Science and Engineering (CSE) Islamic University of Technology (IUT) Board Bazar, Gazipur, Bangladesh This thesis is submitted in partial fulfillment of the requirement for the degree of Bachelor of Science in Computer Science and Engineering, 2025

Keywords

Citation

[1] P. K. Adhikary et al., “Exploring the efficacy of large language models in sum marizing mental health counseling sessions: Benchmark study,” JMIR Mental Health, vol. 11, e57306, 2024. [2] T. Althoff, K. Clark, and J. Leskovec, “Large-scale analysis of counseling con versations: An application of natural language processing to mental health,” Transactions of the Association for Computational Linguistics, vol. 4, pp. 463 476, 2016. [3] S.K.Banshal, S. Das, S. A. Shammi, and N.R.Chakraborty, “Monovab: An an notatedcorpusforbanglamulti-labelemotiondetection,”arXivpreprintarXiv:2309.15670, 2023. [4] Z.Guo,A.Lai,J.H.Thygesen,J.Farrington,T.Keen,andK.Li,“Largelanguage models formentalhealthapplications:Systematicreview(preprint),”Feb.2024. doi: 10.2196/preprints.57400 [Online]. Available: http://dx.doi.org/ 10.2196/preprints.57400 [5] S.Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Compu tation, vol. 9, pp. 1735–1780, Nov. 1997. doi: 10.1162/neco.1997.9.8.1735 [6] E. J. Hu et al., “Lora: Low-rank adaptation of large language models.,” ICLR, vol. 1, no. 2, p. 3, 2022. [7] M.A.Iqbal,A.Das,O.Sharif,M.M.Hoque,andI.H.Sarker,“Bemoc:Acorpus for identifying emotion in bengali texts,” SN Computer Science, vol. 3, no. 2, p. 135, 2022. [8] M. S. Islam, M. E. Rahman, M. S. Moonajilin, and J. van Os, “Prevalence of depression, anxiety and associated factors among school going adolescents in bangladesh:Findingsfromacross-sectionalstudy,”Plosone,vol.16,no.4,e0247898, 2021. [9] M.S.Islam, M.M.Islam, M.R.Islam, M.S. Hossain, and M. R. Islam, “Mental health status among university entrance test-taking students in bangladesh: A cross-sectional study,” Scientific Reports, vol. 14, no. 1, pp. 1–10, 2024, Accessed: 31 2025-04-26. doi: 10.1038/s41598-024-72235-z [Online]. Available: https: //www.nature.com/articles/s41598-024-72235-z [10] S. Islam et al., A comprehensive survey on applications of transformers for deep learning tasks, 2023. arXiv: 2306.07303 [cs.LG]. [Online]. Available: https: //arxiv.org/abs/2306.07303 [11] J.-W. Kim, J.-E. Han, J.-S. Koh, H.-T. Seo, and D.-S. Chang, Enhancing psy chotherapy counseling: A data augmentation pipeline leveraging large language models for counseling conversations, 2024. arXiv: 2406.08718 [cs.CL]. [On line]. Available: https://arxiv.org/abs/2406.08718 [12] J. M. Liu, D. Li, H. Cao, T. Ren, Z. Liao, and J. Wu, Chatcounselor: A large lan guagemodels formental healthsupport,2023.arXiv:2309.15461[cs.CL].[On line]. Available: https://arxiv.org/abs/2309.15461 [13] W.H.Organization. “Minister of health releases first findings of national men tal health survey.” Accessed: 2025-04-26. [Online]. Available: https://www. who.int/bangladesh/news/detail/27-11-2019-minister-of-health releases-first-findings-of-national-mental-health-survey [14] D. Pant and S. K. Mukhiya, “Technical evaluation of gpt-4 and gpt-4-turbo re flective listening response generation with the counsel chat dataset,” 2024. [15] S.Patil and A. Rasave, “Artificial intelligence chat bot for counselling therapy,” in Proceedings of the 4th International Conference on Advances in Science Tech nology (ICAST2021), 2021. [16] A.J.Trappey,A.P.Lin,K.Y.Hsu,C.V.Trappey,andK.L.Tu,“Developmentof an empathy-centric counseling chatbot system capable of sentimental dialogue analysis,” Processes, vol. 10, no. 5, p. 930, 2022. [17] A. Vaswani et al., Attention is all you need, 2023. arXiv: 1706.03762 [cs.CL]. [Online]. Available: https://arxiv.org/abs/1706.03762 [18] X. Xu et al., “Mental-llm: Leveraging large language models for mental health prediction via online text data,” Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 8, no. 1, pp. 1–32, Mar. 2024, issn: 2474-9567. doi: 10.1145/3643540 [Online]. Available: http://dx.doi.org/ 10.1145/3643540 [19] X. Zhang and Z. Luo, Advancing conversational psychotherapy: Integrating pri vacy,dual-memory,anddomainexpertisewithlargelanguagemodels,2024.arXiv: 2412.02987 [cs.CL]. [Online]. Available: https://arxiv.org/abs/2412. 02987

Collections

Endorsement

Review

Supplemented By

Referenced By