Privacy Aware Question-Answering System for Online Mental Health Risk Assessment
Year: 2023

Abstract:
Social media platforms have enabled individuals suffering from mental illnesses to share their lived experiences and find the online support necessary to cope. However, many users fail to receive genuine clinical support, thus exacerbating their symptoms. Screening users based on what they post online can aid providers in administering targeted healthcare and minimize false positives. Pre-trained Language Models (LMs) can assess users’ social media data and classify them in terms of their mental health risk. We propose a Question-Answering (QA) approach to assess mental health risk using the Unified-QA model on two large mental health datasets. To protect user data, we extend Unified-QA by anonymizing the model training process using differential privacy. Our results demonstrate the effectiveness of modeling risk assessment as a QA task, specifically for mental health use cases. Furthermore, the model’s performance decreases by less than 1% with the inclusion of differential privacy. The proposed system’s performance is indicative of a promising research direction that will lead to the development of privacy-aware diagnostic systems.

text: The 22nd Workshop on Biomedical Natural Language Processing and BioNLP Shared Tasks, pages 215–222 July 13, 2023 ©2023 Association for Computational Linguistics

heading: 1 Introduction
text: In recent years, Natural Language Processing (NLP) has emerged as a powerful field of study that focuses on the interaction between human language and computational systems (Singh et al., 2020). Mental health is a crucial aspect of overall well-being, and gaining insights into individuals’ mental states has become an increasingly important area of study. NLP techniques have been useful in identifying text markers that indicate an individual’s mental well-being (Zhang et al., 2022). Social media websites, such as Twitter and Reddit, provide a wealth of textual data that offers a unique
∗ Corresponding author † These authors contributed equally to this work
opportunity to analyze the mental health status of their users at scale, enabling the exploration of patterns, trends, and potential interventions (Skaik and Inkpen, 2020). Assessing users’ mental health risk can be reduced to a basic text classification task, where the Transformer architecture (Vaswani et al., 2017) has demonstrated state-of-the-art performance. BERT (Devlin et al., 2019) encodings have been utilized for training a variety of mental health risk detection systems (Jiang et al., 2020; Nisa and Muhammad, 2021; Zeberga et al., 2022). BERT models fine-tuned on social media data (Ji et al., 2022; Murarka et al., 2020) are able to classify at-risk individuals with high accuracy.
However, advances in text classification models have stagnated with the advent of BERT encodings. Posing the risk assessment problem as a QA task is more analogous to consulting a trained clinician (Mutabazi et al., 2021). QA systems built using BERT have been used for public education on topics in mental health (Guo et al., 2021). Nearly 30% of QA healthcare systems focus on mental health applications such as workplace empowerment, screening, effecting behavior change, and reducing smoking/alcohol dependence (Cilar Budler et al., 2023). Multiple-choice QA models demonstrate a promising alternative approach to depression severity estimation even with low amounts of training data (Gabín et al., 2021). Further development of QA models could lead to better autonomous diagnostic systems. This work proposes the use of AllenAI’s Unified-QA model (Khashabi et al., 2020) to assess the mental health risk of users from their social media posts. The research objective is to explore whether QA transformer models are better than text classification transformers at assessing the risk to mental health and modeling language markers that are indicative of specific mental illnesses. We compare Unified-QA to stateof-the-art pre-trained language models that perform text classification on the same data.
215
Training models on sensitive user data in their raw form makes them non-compliant with data privacy rules which can have serious legal ramifications in the case of unexpected data breaches (Brown et al., 2022). By using Differential Privacy, language models can be trained such that they do not memorize the training data, leading to data security and better model generalization (Basu et al., 2021; Behnia et al., 2022). This work also studies the impact of differential private training on QA model performance. The contributions of the paper are as follows.
1. We approached the text classification task for mental health posts using a QA framework. Specifically, we transformed our input data according to the Unified-QA model and subsequently fine-tuned and evaluated it against one binary dataset and one multi-class dataset.
2. We add noise to the model gradients to prevent the QA model from memorizing the input text, thereby making it differentially private.
3. Our model’s performance is compared against various text classification models, including both traditional classifiers and pre-trained language models with varying degrees of scale, spanning from low to high-parameter models.

heading: 2 Proposed Methodology
text: The proposed work consists of fine-tuning the Unified-QA model on two large mental health datasets in a differentially private manner.

heading: 2.1 Mental Health Assessment as a QA task
text: Treating a text classification task as a seq2seq QA task involves converting input text-label pairs into a Question-Answer format. This approach can be beneficial for tasks such as sentiment analysis, topic classification, and other text classification tasks as it provides a more structured and interpretable output (Bakır and Aktas, 2022). Additionally, it allows for using pre-trained QA transformer models, which can improve performance without requiring large amounts of training data
(Han et al., 2021). In the proposed work, we have utilized Unified-QA, a single pre-trained QA model that performs exceptionally well across 17 diverse QA datasets with different formats. It demonstrates strong generalization even on unseen datasets, outperforming specialized models trained on individual datasets. Fine-tuning the Unified QA model leads to state-of-the-art performance on six datasets, making it a robust foundation for developing QA systems.
The Unified-QA model is prompted as shown in Figure 1, where each post-label pair from the training set is pre-processed by creating a task-specific question prompt to which the post is appended. For outputs, each training sample contains answer options whose values are equal to the set of class labels for each task. This approach enables a more nuanced analysis of mental health-related content, providing a clear rationale for the predicted mental health status. The input and output formatting is consistent for both training and testing.

heading: 2.2 Incorporating Differential Privacy
text: Mental health datasets are highly sensitive, containing personal and often confidential information about individuals’ private lives. Naïvely training language models on such data poses a high risk of input-memorization, allowing adversaries to reconstruct samples using the models and their weights (Fredrikson et al., 2015; Carlini et al., 2020). This work enhances the training process of the UnifiedQA model by incorporating differential privacy (Dwork, 2006). By adding controlled noise to the gradients during training (Neelakantan et al., 2015; Chhikara et al., 2023), a balance between model accuracy and privacy preservation is achieved. Consequently, individuals’ data remains secure within the model, even if an adversary gains access to the model’s weights. The proposed approach makes a powerful general-purpose QA system suitable for use in applications that involve sensitive data.
Table 1: Samples from each dataset with their corresponding label.
RedditMH SMK
Positive: Fed up with my crazy mother. First she was just angry all the time, now she’s angry and mad(schizophrenic) all the time, it’s frustrating to not get a proper father in the house and add to that not even a stable mother, unstable is not even half the things she is. My god. She thinks my father is cooking up dark magic portions all the time. It’s infuriating to have family like this, especially when half the things in my life doesn’t seem to work properly or s**t always happens with me. honestly fed up with always trying to improve my life, exercising, meditating, everything under the sun, and they definitely have effect but it’s not satisfactory and I always wonder what’d happen if I just didn’t have such a mother, and actually have a father in the house.
Negative: Is it possible to lose fat without losing weight? I used to workout all the time and was pretty muscular (80kg) when I was 17. I quit working out like about 3 months ago because I was working 14h everyday to sustain my s**t and had problems back then. I’m now 75ish kg and I’m slim but have high body fat. I found a pretty good job that is pretty good in terms of hours and finally have time to working out. I’ll start rucking with 20kg some 5 miles starting Monday. I have gotten a pretty fat face, and some love handles. My question is, can I lose fat but still maintaining my weight?
ADHD: Please, please help me. The past 2-3 months I have been doing very well managing my symptoms and I have been overall, happy. About 2 weeks ago I noticed myself becoming angry just by my fiancé’s presence. . . it makes me feel crazy as he is literally my favorite person. I have been SO irrationally angry with him about nothing. I can reason with myself, but can’t help my anger. Not currently on any medications as none I have tried have worked. Been off for 3ish months. I’m also upset because Christmas is my FAVORITE and being p***y is ruining it for me. Please help me
Depression: Does anyone else still manage fully function society’s eyes despite severely depressed? I fulltime job I’m never late for, I act happy people believe it, I go gym regularly, I try best maintain friendships even though they’re seeming one-sided. To society, I’m fine. What see crying eyes whenever I drive own, I constantly think suicide self harm, I feel like I’m wasting life. When I get home work, I’ll sit phone wait go sleep. I interest passions I feel trying push something I used love drains me. But society, I’m fine.

heading: 2.3 Datasets
text: The following public domain datasets were used to fine-tune and evaluate the language models listed in Section 2.4. As the datasets are openly available for research purposes, no additional user consent was required to procure them. Table 1 shows a snapshot from each dataset and Figure 2 shows the train-test splits and class distributions.
Reddit Mental Health Dataset (RedditMH): This dataset (Low et al., 2020) contains posts from 28 subreddits collected from 2018-2020, including 15 specific mental health support groups, two broad mental health subreddits, and 11 non-mental health subreddits. For the purpose of this study, instances from broad mental-health (45K) and non-mental health (137K) subreddits are chosen. This was done since LMs perform better at answering clinical questions when pre-trained on open-domain corpora (Soni and Roberts, 2020).
Solomonk’s Reddit Mental Health (SMK): This dataset1 is comprised of 151K Reddit posts exclusively from five mental health-related subreddits. After cleaning, approximately 88k (depression: 13.8K, OCD: 26.3K, Aspergers: 14.1K, PTSD: 13.7K, and ADHD: 20.3K) entries were considered for experimentation.

heading: 2.4 Models
text: The Unified-QA model is fine-tuned and evaluated using the aforementioned datasets. To assess its performance, we compare its results against the following model classes.
Baseline classifiers: The following traditional algorithms were used to define baselines which the LMs improve upon: Logistic Regression (LR), Support Vector Machine (SVM), Decision Tree (DT), Random Forest (RF), AdaBoost, Stochastic Gradient Descent (SGD), Multilayer Perceptron (MLP), ExtRA trees (xTrees) & Multinomial Naive Bayes (MNb).
Low-parameter LMs: The following transformers (10-25M parameters) were evaluated: (1) roberta-small2 , a distilled version of RoBERTa that can be trained on a single GPU. (2) Rohanian et al. (2023a) developed a suite of lightweight transformers specifically for clinical NLP applications. Of these , tiny-clinicalbert, clinical-mobilebert,
1https://huggingface.co/datasets/ solomonk/reddit_mental_health_posts
2https://huggingface.co/smallbenchnlp/ roberta-small
bio-mobilebert and tiny-biobert (Rohanian et al., 2023b) are evaluated.
High-parameter LMs: The following large transformers (>100M parameters) were evaluated on the datasets : (1) PsychBERT (Vajre et al., 2021), a model pre-trained on clinical and biomedical literature. (2) MentalBERT and MentalRoBERTa, state-of-the-art models which are pre-trained on data from mental health-related subreddits.

heading: 3 Experimental Setup

heading: 3.1 Model Training
text: The baseline classifiers were implemented by training vectorized inputs (TF-IDF, Count, Hash) using scikit-learn on consumer-grade PCs without any hyperparameter tuning or GPU acceleration. The language models were fine-tuned as text-classifiers using Nvidia A10G GPUs with 24 GB GDDR6 memory. They were fine-tuned for five epochs with varying batch sizes using the Hugging Face API with default hyperparameters. Since these models are pre-trained on relevant clinical or social media data, fine-tuning on the evaluation datasets for too many epochs hurts model performance.
The proposed QA models were trained for 20 epochs. The small and base models were trained with 128 and 64 batch sizes, respectively. The input text token length is set to 200. The Adam optimizer (lr=10−3) with weight decay and a linear learning rate scheduler are used.

heading: 3.2 Differential Privacy
text: Fine-tuning a small portion of layers on a subset of the training data can enhance pre-trained model performance on specific tasks and reduce the risk of overfitting. Fine-tuning saves time and resources compared to training a model from scratch on the same dataset, as pre-trained models have already learned multiple language features that are pertinent. Noise, denoted by noisestd is sampled from the standard normal distribution (µ = 0, σ = 1) and added during the training phase. The encoder and decoder of the Unified-QA model are frozen while the remaining layers are fine-tuned with 10% of the evaluation datasets. Clipping the gradients if their norm exceeds a specified maximum value prevents them from exploding during training, which mitigates numerical instability and improves convergence time (Zhang et al., 2020).

heading: 3.3 Evaluating Model Safety
text: In order to assess whether the proposed model effectively implements differential privacy, ϵ and δ values are computed. ϵ measures the strength of the privacy guarantee, and δ is a parameter that bounds the probability of failing to provide the privacy guarantee (Abadi et al., 2016). S is the sensitivity of the loss function with respect to individual training examples. The clipnorm parameter is the maximum L2-norm of the gradient before adding noise. The standard deviation of the maximum noise is computed using Equation 1.
maxNoisestd ← clipnorm ∗ √
2 ∗ totalepsilon n
+ S ∗
√ 2 ∗ log (1.25δ )
ϵ
(1)
where totalepsilon is 2ϵ and n represents the number of instances used in the computation. If the standard deviation of the Gaussian noise added (noisestd) to gradients during training process is less than maxNoisestd, then the model is differential private.

heading: 4 Results and Analysis

heading: 4.1 Unified-QA model
text: Table 2 shows the metrics calculated with respect to the positive class (label-1/answer-yes) for the RedditMH (binary choice) dataset. Table 3 shows the weighted average results for the SMK (multiple choice) dataset. The Unified-QA model clearly outperforms the top three baselines and low parameter language models. It also performs competitively against state-of-the-art language models, being only slightly outperformed by PsychBERT. The Appendix contains the complete evaluation results for traditional classifiers.
One possible explanation for the superior performance of the QA approach is that it is better suited to the mental health-related text classification task, which requires a deeper understanding of the context and nuances of the text. By transforming the input text into a question, Unified-QA can better capture the semantic relationships and dependencies between the words in the text. Its ability to handle long and complex sentences lends more accurate mental health risk assessments.

heading: 4.2 Differential Private model
text: Training the Unified-QA model using differential privacy makes it an ideal system for mental health applications, given the sensitive nature of the training data. The final model’s privacy is validated using Equation 1. The F1 score of the Unified-QAsmall differential private model dropped by 0.47% and 0.82% (absolute values) on the RedditMH and SMK dataset, respectively. The additional complexity of a multi-class problem challenges the model to make a privacy-performance trade-off even further, which could explain the higher drop in F1. These findings suggest that while differential privacy techniques can help protect user privacy during model training, their impact on model performance is not insignificant. The promise of safeguarding user data while being able to triage at-risk users accurately offers a promising direction of research to reduce the gap in performance.

heading: 5 Conclusion & Future Work
text: This work aimed to explore the effectiveness of Question-Answering models for mental health risk assessment. The Unified-QA model performed ∼2% better than low-parameter pre-trained language models and produced competitive results when compared to larger state-of-the-art language models. With differential privacy, the model only suffers a sub-one percent drop in performance. This study contributes to the growing body of research on mental health analysis using social media data. It highlights the potential of artificial intelligence techniques to improve our understanding of mental
health and support the development of effective interventions.
Some limitations in the design of this study offer directions for further work to improve performance. Since the RedditMH dataset uses posts from general mental health subreddits, the binary-choice QA model was not exposed to finer-grained data from illness-specific subreddits, which could lead to better assessments. Also, the multiple-choice QA model forces an answer from the list of five diseases even if there are no distinct language markers of any disease. Future work will combine binary and multi-choice QA models to filter at-risk individuals. Two-stage QA models will serve as effective screening tools to ultimately provide care to individuals who need it the most.

heading: Acknowledgements
text: We want to express our gratitude to beam.cloud3, an ML Infrastructure startup for generously providing the necessary compute resources to train and evaluate our models. We greatly appreciate their commitment to advancing the field of natural language processing and their willingness to support our research endeavors.

heading: Future Work
text: Future work will combine binary and multi-choice QA models to filter at-risk individuals. Two-stage QA models will serve as effective screening tools to ultimately provide care to individuals who need it the most