DynaMentA: Dynamic Prompt Engineering and Weighted Transformer Architecture for Mental Health Classification using Social Media Data

Kumar, AkshiORCID logo; Sharma, Aditi; and Sangwan, Saurabh Raj. 2025. DynaMentA: Dynamic Prompt Engineering and Weighted Transformer Architecture for Mental Health Classification using Social Media Data. IEEE Transactions on Computational Social Systems, ISSN 2329-924X [Article] (In Press)
Copy

Mental health classification is inherently challenging, requiring models to capture complex emotional and linguistic patterns. Although large language models (LLMs) such as ChatGPT, Mental-Alpaca, and MentaLLaMA show promise, they are not trained on clinically grounded data and often overlook subtle psychological cues. Their predictions tend to overemphasize emotional intensity, while failing to capture contextually relevant indicators that are critical for accurate mental health assessment. This paper introduces DynaMentA (Dynamic Prompt Engineering and Weighted Transformer Architecture), a novel dual-layer transformer framework that integrates the strengths of BioGPT and DeBERTa to address these challenges. BioGPT captures fine-grained biomedical indicators, while DeBERTa provides context-aware disambiguation. The ensemble mechanism dynamically weights their outputs, guided by a simulated feedback loop that refines the predictions during training. Unlike previous studies that treat classification statically, DynaMentA incorporates dynamic prompt engineering to better align with evolving linguistic and emotional signals. Evaluated on three benchmark datasets, DepSeverity, SDCNL, and Dreaddit, DynaMentA achieves precision of 92.6\%, 91.9\% F1-score and 0.94 AUC-ROC, consistently outperforming the existing benchmark, including general-purpose LLMs and domain-specific mental health models. This scalable and interpretable framework establishes a state-of-the-art methodology for computational mental health analysis in high-stakes applications, such as suicide risk assessment and crisis intervention and early detection of severe depressive episodes.

picture_as_pdf

picture_as_pdf
TCSS_Final.pdf
subject
Accepted Version

View Download

Atom BibTeX OpenURL ContextObject in Span OpenURL ContextObject Dublin Core Dublin Core MPEG-21 DIDL Data Cite XML EndNote HTML Citation METS MODS RIOXX2 XML Reference Manager Refer ASCII Citation
Export

Downloads