arXiv:2610.38044cs.AIOct 2026

Manuscript Offprint

arXiv:2610.38044

PromptSense: Sentiment-Aware Mental Health Chatbot with Dynamic Prompting

Sugi Lee, Jianlong Zhou, Jing sUN

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Sugi Lee¹, Jianlong Zhou²*, and Jing Sun²

¹ Transdisciplinary School, University of Technology Sydney, Sydney, Australia

² Data Science Institute, University of Technology Sydney, Sydney, Australia

jianlong.zhou@uts.edu.au

Abstract. Current Large Language Models (LLMs)-based mental health chatbots often lack sufficient empathy, contextual awareness, and safety mechanisms, potentially leading to ineffective or harmful interactions. This paper proposes a novel framework that integrates sentiment and depression analysis with a rule-based filtering mechanism prior to model inference. By dynamically constructing prompts based on emotional and risk-related insights, the framework aims to significantly improve the contextual relevance, empathy, and risk-aware of model-generated responses. We evaluated four model strategies and two prompt engineered variants across qualitative metrics such as empathy, helpfulness, clarity, relevance, safety, as well as toxicity assessments using the Perspective API. Experimental results indicate that the prompt engineering approaches outperforms DSFT and RLAIF by 1.8% and 1.1% respectively.

Keywords: Sentiment Analysis · Mental Health Chatbot · Prompt Engineering.

1 Introduction

A mental disorder is a clinically significant disturbance in the intellect, emotional control, or behaviour of an individual. While mental health struggles can occur without a formal diagnosis, factors like employment, living conditions, and service access influence well-being, affecting individuals and families. In Australia, 20% experience mental illness annually, with young people (16–24) most affected (38.8%). Global health systems fall short in meeting the needs of those with mental disorders, leading to a gap in treatment availability and quality. Barriers like stigma, financial constraints, and limited access prevent many from seeking help. For instance, 31% of Americans fear being judged when seeking mental health support. This situation has led to exploring technology, such as AI applications, to assist individuals coping with mental health issues.

The rapid development of Large Language Models (LLMs) have the potential to disrupt and transform the way people work and live in modern society. Technology has significantly advanced in accurately identifying and labelling emotions by analysing motion, facial expressions, online activities, phrasing, and

  • Corresponding author.

vocal tone [17]. Unlike traditional chatbots, LLM-based chatbots produce more nuanced, context-aware, and empathetic responses. However, their reliance on input-driven interactions can make extended conversations feel superficial [17], and their dependence on pre-learned world knowledge may result in misinformation or incorrect advice [3]. While fine-tuning state-of-the-art models can produce strong results, current mental health chatbots generate responses lacking empathy and contextual relevance, which can lead to ineffective or harmful interactions. Although they can deliver cognitive-behavioural therapies (CBT), their understanding of human emotions is constrained, require further contextualisation to respond appropriately to diverse emotional situations [9].

To address this challenge, this study explores approaches to use sentiment and depression analysis to dynamically tailor prompts based on user emotions and context. It employs qualitative and quantitative prompting strategies to enhance the model's ability to generate empathetic and context-aware responses. It is applied across various LLM variants, including the base model, Distilled Supervised Fine-Tuning (DSFT), and Reinforcement Learning with AI Feedback (RLAIF). Evaluation by AI judges focuses on empathy, helpfulness, clarity, relevance, and safety, with results showing consistent effectiveness across all models.

In summary, the primary contributions of this research include the following:

  • Proposing a framework for mental health chatbots that are empathetic, contextually relevant, and risk-aware.

  • Integrating sentiment analysis to dynamically adapt chatbot interactions based on emotional and psychological states of the user.

  • Experimenting the prompt engineering through two distinct strategies: qualitative and quantitative prompting.