Skip to content

PromptSense: A Mental Health Chatbot Based on Sentiment Awareness and Dynamic PromptsPromptSense: Sentiment-Aware Mental Health Chatbot with Dynamic Prompting

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.38044· Sugi Lee, Jianlong Zhou, Jing sUNTransdisciplinary School, University of Technology Sydney; Data Science Institute, University of Technology SydneyIndexed by this site · 24 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose PromptSense: using sentiment analysis to dynamically construct prompts for mental health chatbots; the authors claim qualitative prompts are 1.8% and 1.1% higher than DSFT and RLAIF, respectively.

Questions
Existing LLM mental health chatbots lack empathy, context awareness, and safety mechanisms, and may produce ineffective or harmful interactions; the authors aim to make replies more empathetic, better aligned with the user's emotional state, and risk-aware.
Methods
Proposes PromptSense: a three-head sentiment analysis model with MentalRoBERTa as its core (suicidal ideation classification, emotion multi-label classification, valence-arousal regression) analyzes user input, writes the results into the prompt in qualitative or quantitative form, drives DeepSeek-R1-Distill-Llama-8B to generate replies, and is paired with a song recommendation module.
Experiments and results
Three AI judges scored on 418 test dialogues from EmpatheticDialogues: prompt variants averaged 8.77–8.85, higher than Base 8.73, DSFT 8.68, and RLAIF 8.74; on the Perspective API, Base+PE-Q had the lowest toxicity (0.0156) and the highest sympathy (0.9415).
Limitations and future work
The authors state that AI review struggles to capture clinical dimensions such as emotional appropriateness and long-term psychological impact, and they plan to introduce human evaluation by mental health experts; the experiments used only an AI judge and the Perspective API, and did not report human evaluation, number of repetitions, or statistical tests.
Experimental setupDeepSeek-R1-Distill-Llama-8B、DSFT et al. · SWMH、GoEmotions et al. · MH Accuracy、EH F1 et al.
Evaluated models
DeepSeek-R1-Distill-Llama-8BDSFTRLAIFProposed Model (SAM)
Benchmarks
SWMHGoEmotionsNRC VAS LexiconCounsel ChatEmpatheticDialogues
Metrics
MH AccuracyEH F1V/A RMSEAI judge 五项均分Perspective API 毒性等指标
AI summaryThe PromptSense framework integrates sentiment and depression analysis and rule filtering before model inference, dynamically constructs prompts based on emotion and risk signals, and improves the empathy and safety of LLM mental health chatbot responses. The study evaluates four model strategies and two prompt engineering variants, using qualitative metrics such as empathy and safety and Perspective API toxicity evaluation; the prompt engineering methods are 1.8% and 1.1% higher than DSFT and RLAIF, respectively.

The PromptSense framework integrates sentiment and depression analysis and rule filtering before model inference, dynamically constructs prompts based on emotion and risk signals, and improves the empathy and safety of LLM mental health chatbot responses. The study evaluates four model strategies and two prompt engineering variants, using qualitative metrics such as empathy and safety and Perspective API toxicity evaluation; the prompt engineering methods are 1.8% and 1.1% higher than DSFT and RLAIF, respectively.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors argue that existing LLM mental health chatbots lack empathy and safety awareness, and propose a sentiment-aware dynamic prompt framework to address this.

    Core problem: existing LLM-based mental health chatbots lack empathy, context awareness, and safety mechanisms, which may lead to ineffective or even harmful interactions.

    • Problem setting: The authors cite data stating that 20% of people in Australia experience mental illness each year, rising to 38.8% among those aged 16–24, while stigma, cost, and accessibility hinder help-seeking (e.g., 31% of Americans worry about being judged), prompting exploration of AI-assisted mental health support.
    • Shortcomings of existing methods: The authors state that current chatbots, even after fine-tuning, still produce replies lacking empathy and contextual relevance; LLMs relying on pretrained knowledge may produce misinformation or bad advice, and long conversations tend to become superficial.
    • Core idea: Before model inference, first use sentiment and depression analysis modules to understand the user's emotions and risk state, then dynamically construct the prompt accordingly, so that replies are more empathetic, more contextually appropriate, and risk-aware.
    • Paper output: Proposes the PromptSense framework, comprising four modules: sentiment analysis model, risk assessment, model inference, and song recommendation; compares three model strategies Base, DSFT, and RLAIF with two prompt variants, qualitative (PE-Q) and quantitative (PE-P), evaluated with AI judges and Perspective API.
  2. What related research exists?

    Related work is mainly LLM fine-tuning research for mental health; the authors distinguish their approach by dynamic prompting rather than a pure fine-tuning route.

    Mental health LLM fine-tuning research (summarized in Table 1)

    • [16] (MentaLLaMA): Fine-tunes LLaMA2-7B with an instruction set, performing interpretable mental health analysis based on the IMHI dataset.
    • [17]: LoRA fine-tuning on LLaMA2-7B based on the CounselChat dataset; the authors also cite its survey noting that LLM chatbots tend to be superficial in long conversations.
    • [8]: Fine-tunes GPT-4 combined with localized prompt engineering, using CounselChat and Indonesian local mental health discussion data to serve Indonesian university students.
    • [10] (MentalBERT): Pretrains BERT/RoBERTa variants on Reddit data such as SWMH and Depression Reddit; this paper's sentiment analysis model is built on its MentalRoBERTa.

    The authors' overall judgment of related work: The authors state that these studies repeatedly show that fine-tuning models such as LLaMA2 and GPT-4 on diverse datasets can improve the ability to recognize mental health disorders, but fine-tuned chatbot replies still lack empathy, context awareness, and sensitivity to user risk.

    Baselines and comparison setup: This paper does not directly compare with the above systems, but builds its own controls—three model strategies Base (DeepSeek-R1-Distill-Llama-8B), DSFT, and RLAIF, combined with two prompt variants PE-Q/PE-P; the sentiment analysis model's controls are RoBERTa-base (Original) and a frozen version of MentalRoBERTa (Base).

    Positioning of this paper: The authors state that the difference lies in integrating sentiment and depression analysis into prompt engineering, dynamically adjusting the interaction according to the user's emotions and mental state, rather than relying solely on fine-tuning.

  3. How does the paper address this problem?

    PromptSense uses a three-head sentiment analysis model to parse the user's state, writing it into the prompt in qualitative or quantitative form to drive LLM replies.

    Overall approach: first use a multi-task sentiment analysis model to parse the user input's risk, emotions, and mood, then dynamically write the parsed results into the prompt to guide the mental health LLM to generate empathetic replies. PromptSense contains four modules: sentiment analysis, risk assessment, model inference, and song recommendation (Fig. 1).

    Sentiment Analysis Model (SAM)

    • Backbone and structure: Based on the MentalRoBERTa encoder, stacked with two residual blocks with layer normalization and dropout, connected to three output heads.
    • Mental Head: Multi-class classification to identify risks such as suicidal ideation, trained on the SWMH dataset, with standard cross-entropy loss Lmental = −1/N∑i∑c yi,clogŷi,c; when high risk is detected, a preset escalation/referral protocol is triggered.
    • Emotion Head: Multi-label classification on GoEmotions (27 emotion classes plus Neutral), using a class weighting strategy based on effective sample size to mitigate class imbalance, with weighted BCE loss.
    • VA Head: Regression to predict valence and arousal, with MSE loss; the Emotion and VA heads are jointly trained with uncertainty weighting as in Kendall et al., Lcombined = 1/(2σemo2)Lemo + logσemo + 1/(2σVA2)LVA + logσVA, where σ is a learnable parameter.

    Mental Health LLM and Two-Stage Training

    • Base: DeepSeek-R1-Distill-Llama-8B (Unsloth pretrained version).
    • Stage 1 DSFT: Distillation-style supervised fine-tuning on the Counsel Chat dataset (2,612 cleaned counseling dialogues), yielding the DSFT model.
    • Stage 2 RLAIF: Sampled replies are scored 1–10 by a Mistral-7B-Instruct-v0.3 judge on five criteria—empathy, helpfulness, relevance, clarity, and safety—and used as rewards for reinforcement learning, yielding the RLAIF model (Fig. 2).

    Dynamic Prompt Engineering

    • Quantitative (PE-P): The numerical probabilities output by SAM are written directly into the prompt context (e.g., mental state percentages, valence/arousal values).
    • Qualitative (PE-Q): Probabilities are mapped to five levels of verbal description: 0.8–1.0 Very High, 0.6–0.8 High, 0.4–0.6 Moderate, 0.2–0.4 Low, 0.0–0.2 Very Low, then written into the prompt.
    • Output constraints: Both prompts require the model to reply in the role of an empathetic psychological counselor; the main text provides a complete prompt example.

    Data and Evaluation Design

    • Datasets: SWMH (54,412 entries; train 34,823/validation 8,706/test 10,883), GoEmotions (43,410/5,426/5,427), NRC VAS Lexicon (a valence-arousal lexicon of 55,000+ words), Counsel Chat (2,612 entries), EmpatheticDialogues test set of 418 dialogues (Table 2).
    • SAM metrics: Accuracy for the Mental Head, macro-averaged F1 for the Emotion Head, RMSE for VA.
    • LLM evaluation: Three AI judges (Mistral-7B-Instruct-v0.3, Mixtral-8x7B-v0.1, MentaLLaMA-chat-13B) score on a unified five-criteria standard; Perspective API is additionally used to measure toxicity, identity attack, insult, threat, and sympathy, respect, nuance, incoherence (Table 3).
  4. What experiments did the paper conduct?

    Three groups of experiments: SAM ablation, three judges scoring nine model configurations, and Perspective API ethical metric evaluation.

    Experimental setup

    • Models tested: Three strategies Base (DeepSeek-R1-Distill-Llama-8B), DSFT, and RLAIF, each combined with PE-Q and PE-P prompt variants, 9 configurations in total.
    • Evaluation data: 418 randomly selected dialogues from the EmpatheticDialogues test set; the paper does not report the number of repetitions.
    • Review method: Three LLM judges—Mistral-7B-Instruct-v0.3 (MIST, the same judge used in RLAIF training), Mixtral-8x7B-v0.1 (MIXT), MentaLLaMA-chat-13B (MELL)—score 1–10 each on empathy, helpfulness, clarity, relevance, and safety.
    • Ethical metrics: Perspective API outputs eight scores: toxicity, identity attack, insult, threat, sympathy, respect, nuance, incoherence.
    • SAM controls: Original (RoBERTa-base, frozen), Base (MentalRoBERTa, frozen), Proposed (with residual blocks, frozen/unfrozen versions).

    Main results

    According to Table 5 (average of the five metrics across the three judges):

    Swipe horizontally to read the table

    ModelMIXTMISTMELLAVG
    Base8.639.128.448.73
    Base + PE-Q8.709.268.548.83
    Base + PE-P8.789.258.528.85
    DSFT8.599.088.368.68
    DSFT + PE-Q8.709.238.468.80
    DSFT + PE-P8.669.208.468.77
    RLAIF8.669.128.448.74
    RLAIF + PE-Q8.749.288.508.84
    RLAIF + PE-P8.799.238.498.84
    • The authors state that prompt engineering brings an average improvement of +0.12, and that PE-Q outperforms PE-P in 6 of the 9 evaluations; the abstract states that the prompt method is 1.8% and 1.1% higher than DSFT and RLAIF, respectively.
    • The authors state that DSFT (8.68) and RLAIF (8.74) yield minimal gains over Base (8.73), and that existing optimization methods may struggle with the complexity of mental health conversations.
    • The authors note that the general-purpose judge MIST scores higher than the specialized judge MELL in all configurations (e.g., Base: 9.12 vs. 8.44), raising questions about the generalization ability of specialized models as reviewers; they also caution that the score range is narrow (8.36–9.28) and that AI review may overlook clinical factors.

    Perspective API evaluation

    • What was measured: Eight ethical and emotional metrics for the outputs of the 9 configurations (Table 6).
    • Results: Base+PE-Q has the lowest toxicity (0.0156) and highest sympathy (0.9415); RLAIF+PE-Q has the lowest incoherence (0.1442). PE-P's toxicity (0.0171–0.0180) is instead higher than the corresponding no-prompt versions (0.0166–0.0174).
    • Authors' interpretation: The authors state that PE-Q reduces toxicity and incoherence and increases sympathy and respect across all three models, whereas DSFT/RLAIF without prompts show limited ethical improvement.

    Sentiment analysis model ablation

    • Results (Table 4): The unfrozen Proposed model achieves MH accuracy 0.6803, EH F1 0.4840, V/A RMSE 0.2025/0.1835, outperforming the frozen version (0.5997/0.3527/0.2420/0.1990) and both controls across the board.
    • Authors' interpretation: The authors state that after unfreezing, MH accuracy improves by 17.5% and F1 by 504.2% (relative to the frozen version), but minority-class emotion classification still has room for improvement.

    Other ablations and analyses

    • The Figure 3 scatter plots show the relationship between empathy and the other four dimensions by median-split quadrants; the authors state that the PE variants rank high on both empathy and secondary dimensions, and that in the Empathy vs. Relevance plot the PE models have slightly lower relevance, which the authors consider an empathy-relevance trade-off.
    • The paper does not report statistical significance tests, human evaluation, or inter-judge agreement.
  5. What are some points that can be further explored?

    The authors state that AI review struggles to cover clinical dimensions, and they plan to introduce expert human evaluation and prompt optimization based on expert feedback.

    Limitations and future directions noted by the authors

    • Clinical validity of AI review (Section 4.2, Section 5): The authors state that AI review may overlook key clinical factors such as therapeutic empathy and emotional appropriateness, and that the score range is narrow (8.36–9.28), requiring more sensitive evaluation metrics.
    • Long-term effects not covered (Section 5): The authors state that AI evaluation remains limited in capturing clinically meaningful aspects such as emotional appropriateness and long-term psychological effects.
    • Introducing human evaluation (Section 5): The authors plan to include human evaluation by mental health professionals.
    • Improving prompt generation (Section 5): The authors plan to improve prompt generation using reinforcement learning from expert feedback.
    • SAM minority-class performance (Section 4.1): The authors state that the Emotion Head's minority-class classification still has room for improvement.

    Scope of experiments

    • The models tested are three strategies (Base, DSFT, RLAIF) on the same base model (DeepSeek-R1-Distill-Llama-8B) plus two prompt variants, 9 configurations in total.
    • The evaluation data are 418 dialogues from the EmpatheticDialogues test set; the reviewers are three LLM judges plus Perspective API, and the paper does not report human evaluation or inter-judge agreement.
    • The paper does not report the number of repetitions, statistical significance tests, or hyperparameters such as the number of RLAIF training iterations and sampling scale.
    • SAM evaluation covers the three heads corresponding to the three datasets SWMH, GoEmotions, and NRC VAS; the song recommendation module was not evaluated separately in the experiments.
  6. Summarize the main content of the paper

    PromptSense uses sentiment analysis to drive dynamic prompts, which the authors state improves reply quality more than DSFT/RLAIF fine-tuning.

    A methods paper on mental health chatbots: addressing the insufficient empathy, context awareness, and safety mechanisms of existing LLM chatbots, the authors propose the PromptSense framework.

    • Method: A three-head sentiment analysis model built from MentalRoBERTa plus residual blocks—the Mental Head detects suicidal ideation and triggers an escalation protocol, the Emotion Head performs multi-label emotion classification on GoEmotions, and the VA Head regresses valence and arousal; the analysis results are written into the prompt either qualitatively (five-level linguistic descriptions) or quantitatively (probability values), driving DeepSeek-R1-Distill-Llama-8B to generate responses, with an additional song recommendation module.
    • SAM results: The unfrozen model achieves MH accuracy 0.6803, EH F1 0.4840, and V/A RMSE 0.2025/0.1835, outperforming the frozen version and the RoBERTa-base and MentalRoBERTa controls (Table 4).
    • Main results: On 418 test dialogues from EmpatheticDialogues, among the five-metric average scores from three LLM judges, the prompt variants (8.77–8.85) are higher than Base (8.73), DSFT (8.68), and RLAIF (8.74); the authors state that the prompt method is 1.8% and 1.1% higher than DSFT and RLAIF, respectively (Table 5).
    • Ethical metrics: On the Perspective API, Base+PE-Q has the lowest toxicity (0.0156) and the highest sympathy (0.9415); PE-P's toxicity is instead higher than the no-prompt version (Table 6).
    • Authors' conclusion: The authors consider qualitative prompt engineering an effective strategy for improving empathy and response quality, and that in emotionally nuanced scenarios prompts are more critical than fine-tuning alone; they also acknowledge that AI review struggles to cover clinical dimensions, and plan to introduce human evaluation by mental health experts and reinforcement learning based on expert feedback.
Read originalarxiv.org