Development and Post-Hoc Evaluation of a Transformer-Based Mental Health Chatbot Using the ESPRT Framework
PDF

Keywords

chatbot development
ESPRT framework
FLAN-T5
LoRA
mental health
transformer

How to Cite

Development and Post-Hoc Evaluation of a Transformer-Based Mental Health Chatbot Using the ESPRT Framework. (2026). IJID (International Journal on Informatics for Development), 15(1), 36-50. https://doi.org/10.14421/ijid.2026.6024

Abstract

Mental health disorders are an increasing global concern, yet access to professional care is still limited due to resource shortages and persistent social stigma. Artificial intelligence–based chatbots have therefore emerged as a potential tool for providing early support. However, developing systems that are both computationally efficient and psychologically appropriate remains challenging. This study developed a chatbot using the FLAN-T5-base architecture, fine-tuned on the MentalChat16K dataset, comparing Full Fine-Tuning (FFT) and Low-Rank Adaptation (LoRA). Quantitative evaluation yielded objectively low n-gram scores (e.g., ROUGE-L of 17.81 for FFT and 17.17 for LoRA). Although these scores may suggest weak generative performance, they were largely affected by the brevity penalty because the models generated much shorter responses than the reference answers. Thus, to further evaluate response quality, an LLM-as-a-judge qualitative assessment was conducted, confirming that both models produced safe, contextually relevant, and reasonably empathetic responses. Notably, LoRA achieved comparable qualitative performance while updating only ~0.35% of parameters, reducing GPU memory usage by 21% and training time by about 24%. Interpreted through the Eco-Socio-Psycho-Religio-Technic (ESPRT) post-hoc discussion framework, the findings demonstrate that LoRA is a practical and sustainable approach for mental health support systems in resource-limited environments.

PDF

References

[1] A. Magomedova and G. Fatima, “Mental Health and Well-Being in the Modern Era: A Comprehensive Review of Challenges and Interventions,” Cureus, vol. 17, no. 1, p. e77683, 2025, doi: 10.7759/cureus.77683.

[2] M. Moitra et al., “Global Mental Health: Where We Are and Where We Are Going,” Curr. Psychiatry Rep., vol. 25, no. 7, pp. 301–311, 2023, doi: 10.1007/s11920-023-01426-8.

[3] World Health Organization, “Mental Health: Strengthening our Response,” Oct. 2025. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/mental-health-strengthening-our-response

[4] W. Liu et al., “Global burden and trends of major mental disorders in individuals under 24 years of age from 1990 to 2021, with projections to 2050: insights from the Global Burden of Disease Study 2021,” Front. Public Health, vol. 13, 2025, doi: 10.3389/fpubh.2025.1635801.

[5] J. Xu et al., “The burden of mental disorders, substance use disorders, and self-harm among youths globally: findings from the 2021 Global Burden of Disease study,” Transl. Psychiatry, vol. 15, no. 1, p. 346, 2025, doi: 10.1038/s41398-025-03533-x.

[6] L. Munira, P. Liamputtong, and P. Viwattanakulvanid, “Barriers and facilitators to access mental health services among people with mental disorders in Indonesia: A qualitative study,” Belitung Nurs. J., vol. 9, no. 2, pp. 110–117, 2023, doi: 10.33546/bnj.2521.

[7] Y. Gao, R. Burns, L. Leach, M. R. Chilver, and P. Butterworth, “Examining the mental health services among people with mental disorders: a literature review,” BMC Psychiatry, vol. 24, no. 1, p. 568, 2024, doi: 10.1186/s12888-024-05965-z.

[8] M. Njuguna, I. Ngune, and Y. Middlewick, “Mental Health Support Workers Perspectives on Barriers to and Facilitators of the Effective Delivery of their Roles: A Systematic Review and Meta-aggregation,” Community Ment. Health J., vol. 61, no. 8, pp. 1548–1573, 2025, doi: 10.1007/s10597-025-01490-9.

[9] E. Mayor, “Chatbots and mental health: a scoping review of reviews,” Current Psychology, vol. 44, no. 15, pp. 13619–13640, 2025, doi: 10.1007/s12144-025-08094-2.

[10] H. R. Lawrence, R. A. Schneider, S. B. Rubin, M. J. Matarić, D. J. McDuff, and M. J. Bell, “The Opportunities and Risks of Large Language Models in Mental Health,” JMIR Ment Health, vol. 11, p. e59479, Jul. 2024, doi: 10.2196/59479.

[11] A. Bucher, S. Egger, I. Vashkite, W. Wu, and G. Schwabe, “‘It’s Not Only Attention We Need’: Systematic Review of Large Language Models in Mental Health Care,” JMIR Ment Health, vol. 12, p. e78410, 2025, doi: 10.2196/78410.

[12] Z. Guo, A. Lai, J. H. Thygesen, J. Farrington, T. Keen, and K. Li, “Large Language Models for Mental Health Applications: Systematic Review,” JMIR Ment Health, vol. 11, p. e57400, 2024, doi: 10.2196/57400.

[13] R. Sanjeewa, R. Iyer, P. Apputhurai, N. Wickramasinghe, and D. Meyer, “Empathic Conversational Agent Platform Designs and Their Evaluation in the Context of Mental Health: Systematic Review,” JMIR Ment Health, vol. 11, p. e58974, 2024, doi: 10.2196/58974.

[14] A. A. Dzaky et al., “Optimization Chatbot Services Based on DNN-Bert for Mental Health of University Students,” Journal of Applied Informatics and Computing, vol. 8, no. 1, pp. 13–21, 2024, doi: 10.30871/jaic.v8i1.7403.

[15] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” CoRR, vol. abs/1810.04805, 2018, [Online]. Available: http://arxiv.org/abs/1810.04805

[16] J. Zeniarja et al., “Integrating ELECTRA and BERT models in transformer-based mental healthcare chatbot,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 37, no. 1, pp. 315 – 324, 2025, doi: 10.11591/ijeecs.v37.i1.pp315-324.

[17] K. Clark, M.-T. Luong, Q. V Le, and C. D. Manning, “ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators,” CoRR, vol. abs/2003.10555, 2020, [Online]. Available: https://arxiv.org/abs/2003.10555

[18] D. Mandal and H. Himanshu, “Harnessing Deep Learning for Mental Health: A Comparative Study of BERT, LSTM, and GPT-2,” in 2025 6th International Conference for Emerging Technology (INCET), 2025, pp. 1–7. doi: 10.1109/INCET64471.2025.11140291.

[19] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever, “Language Models are Unsupervised Multitask Learners,” OpenAI, 2019, [Online]. Available: https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf

[20] J. S. J, K. Manoharan, and K. Arul, “Evaluation of BERT and BART in Mental Health Dialogue by Using a Counselling Chatbot,” in 2025 International Conference on Engineering Innovations and Technologies (ICoEIT), 2025, pp. 1412–1417. doi: 10.1109/ICoEIT63558.2025.11211681.

[21] M. Lewis et al., “BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension,” in Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, D. Jurafsky, J. Chai, N. Schluter, and J. Tetreault, Eds., Online: Association for Computational Linguistics, Jul. 2020, pp. 7871–7880. doi: 10.18653/v1/2020.acl-main.703.

[22] O. Taiwo and B. Al-Bander, “Emotion-aware psychological first aid: Integrating BERT-based emotional distress detection with Psychological First Aid-Generative Pre-Trained Transformer chatbot for mental health support,” Cognitive Computation and Systems, vol. 7, no. 1, p. e12116, 2025, doi: 10.1049/ccs2.12116.

[23] H. Q. Yu and S. McGuinness, “An Experimental Study of Integrating Fine-tuned LLMs and Prompts for Enhancing Mental Health Support Chatbot System,” J. Med. Artif. Intell., vol. 7, p. 16, 2024, doi: 10.21037/jmai-23-136.

[24] H. M. Mohssen and H. H. Safi, “An Efficient Mental Healthcare Chatbot Using Reprogramming Transformer Model Based on a Fine-Tuned GPT-2,” in Data Processing and Networking, A. Swaroop, B. Virdee, S. D. Correia, and J. Valicek, Eds., Singapore: Springer Nature Singapore, 2025, pp. 69–83.

[25] L. Wang et al., “Parameter-efficient fine-tuning in large language models: a survey of methodologies,” Artif. Intell. Rev., vol. 58, no. 8, p. 227, 2025, doi: 10.1007/s10462-025-11236-4.

[26] Z. Han, C. Gao, J. Liu, J. Zhang, and S. Q. Zhang, “Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey,” 2024. [Online]. Available: https://arxiv.org/abs/2403.14608

[27] E. J. Hu et al., “LoRA: Low-Rank Adaptation of Large Language Models,” CoRR, vol. abs/2106.09685, 2021, [Online]. Available: https://arxiv.org/abs/2106.09685

[28] V. B. Parthasarathy, A. Zafar, A. Khan, and A. Shahid, “The Ultimate Guide to Fine-Tuning LLMs from Basics to Breakthroughs: An Exhaustive Review of Technologies, Research, Best Practices, Applied Research Challenges and Opportunities,” 2024. [Online]. Available: https://arxiv.org/abs/2408.13296

[29] V.-T. Doan, Q.-T. Truong, D.-V. Nguyen, V.-T. Nguyen, and T.-N. N. Luu, “Efficient Finetuning Large Language Models For Vietnamese Chatbot,” in 2023 International Conference on Multimedia Analysis and Pattern Recognition (MAPR), 2023, pp. 1–6. doi: 10.1109/MAPR59823.2023.10288647.

[30] S. Pratap, A. R. Aranha, D. Kumar, G. Malhotra, A. P. N. Iyer, and S. S.S., “The fine art of fine-tuning: A structured review of advanced LLM fine-tuning techniques,” Natural Language Processing Journal, vol. 11, p. 100144, 2025, doi: 10.1016/j.nlp.2025.100144.

[31] J. Xu et al., “MentalChat16K: A Benchmark Dataset for Conversational Mental Health Assistance,” in Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2, in KDD ’25. New York, NY, USA: Association for Computing Machinery, 2025, pp. 5367–5378. doi: 10.1145/3711896.3737393.

[32] H. W. Chung et al., “Scaling instruction-finetuned language models,” J. Mach. Learn. Res., vol. 25, no. 1, Jan. 2024.

[33] C. Raffel et al., “Exploring the limits of transfer learning with a unified text-to-text transformer,” J. Mach. Learn. Res., vol. 21, no. 1, Jan. 2020.

[34] Md. S. Salim, S. I. Hossain, T. Jalal, D. K. Bose, and M. J. I. Basher, “LLM based QA chatbot builder: A generative AI-based chatbot builder for question answering,” SoftwareX, vol. 29, p. 102029, 2025, doi: 10.1016/j.softx.2024.102029.

[35] D. J. P and S. B. Karnati, “BuddyBot: AI Powered Chatbot for Enhancing English Language Learning,” in 2024 IEEE International Conference on Interdisciplinary Approaches in Technology and Management for Social Innovation (IATMSI), 2024, pp. 1–6. doi: 10.1109/IATMSI60426.2024.10502595.

[36] B. B. P. Sai, R. H. Krishna, C. L. Reddy, and C. U. Kumari, “Enhancing Conversational AI: Building an Intelligent Chatbot with Llama Using LoRa & Analyzing Different Llama Models,” in 2025 International Conference on Inventive Computation Technologies (ICICT), 2025, pp. 1061–1066. doi: 10.1109/ICICT64420.2025.11004777.

[37] Y. Mao et al., “A survey on LoRA of large language models,” Front. Comput. Sci., vol. 19, no. 7, p. 197605, 2024, doi: 10.1007/s11704-024-40663-9.

[38] J. Hu, X. Liao, J. Gao, Z. Qi, H. Zheng, and C. Wang, “Optimizing Large Language Models with an Enhanced LoRA Fine-Tuning Algorithm for Efficiency and Robustness in NLP Tasks,” in 2024 4th International Conference on Communication Technology and Information Technology (ICCTIT), 2024, pp. 526–530. doi: 10.1109/ICCTIT64404.2024.10928552.

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.