title: Implementing Large Language Models for Tailored Mental Health Messaging in the COMPASS Study
Creators: name: Fritsche, L.
name: Frank, E.
name: Thomas, L.
name: Bohnert, A.
name: Sen, S.
Publisher: name: University of Michigan
Year: 2024
Subjects: subject: Large Language Models (LLMs); Just in Time Adaptive Interventions; JITAI; Digital Health; Mobile Health; Mobile Tech

description: Presented at the MeTRIC 2024 Symposium
description: Background: With the increasing use of mobile technologies in health research, personalized interventions have proven essential for improving patient engagement. In the COMPASS study (Comprehensive Mobile Precision Approach for Scalable Solutions in Mental Health Treatment), we aim to send participants tailored daily messages informed by metrics like sleep quality, mood, and activity levels. To enhance message personalization, we have developed an automated pipeline utilizing large language models (LLMs), particularly GPT-based systems, to generate diverse, contextually appropriate messages. Objectives: Our primary aim is to create a scalable and reproducible pipeline to generate personalized mental health messages. By integrating LLMs, we automate the generation of messages, ensuring diversity, relevance, and adherence to established messaging approaches. The system also incorporates built-in checks and reasoning steps to maintain message quality and reduce redundancies. Methods: The pipeline generates messages categorized into four levels (Neutral, Low, Medium, and High) based on participants' real-time data inputs (e.g., mood scores, activity levels). Messages are developed across five therapeutic domains: Behavioral Strategies, Cognitive Restructuring, Distanced Self-Talk, Mindfulness, and Motivational Interviewing. Each message is crafted to include actionable advice, question prompts, or supportive statements, and is personalized using placeholders (e.g., &lt;%CustomField.Metric_Mood_Avg_7Days%&gt;). Built-in chain-of-thought reasoning and self-checks enhance message coherence and ensure adherence to messaging approaches and platform compatibility. Human experts review outputs for messaging alignment and appropriateness. Results: Preliminary implementation of this pipeline has demonstrated efficient and consistent message generation. Integrating GPT models with a catalog of system prompts ensures that generated content is varied and adheres to the predefined messaging categories and requirements. The transition from GPT-4 to GPT-4o has already resulted in notable enhancements to message quality and relevance. The pipeline's design ensures scalability and flexibility, supporting continuous updates as LLM technologies evolve. Conclusions: This LLM-powered pipeline offers a promising approach to scaling personalized mental health interventions in mobile health research. By automating the generation of diverse and relevant messages, we can enhance patient engagement while maintaining high messaging standards and compatibility. As LLM capabilities advance, the potential for further personalization and impact in digital health interventions will continue to grow, aligning with the broader goals of mobile health research and patient care innovation.