Uppsats

Towards Controlled Mental Health Safety Plan Generation Using Large Language Models : <em data-ogsc="" data-olk-copy-source="MessageBody">A Comparative Study of Prompt Effects

Kandidat-uppsats

Linnéuniversitetet/Institutionen för datavetenskap och medieteknik (DM)

Publicerad: 2026

Språk: Engelska

Sammanfattning

Mental-health safety plans are commonly created manually by healthcare professionals to support individuals at risk during mental-health crises. While this process is important, manual creation can be time-consuming and difficult to standardize across patients and clinical contexts. Recent advances in large language models (LLMs) show strong potential for automated and controlled text generation, yet their applicability for generating structured mental-health safety plans has not been sufficiently explored, particularly in safety-critical settings where reliability and structural correctness are essential. This thesis investigates the use of LLMs for generating structured mental-health safety plans, with a particular focus on how model selection and prompt engineering influence structural reliability and perceived usefulness. To support the study, a reproducible generation and evaluation pipeline was developed that enforces a predefined JSON schema, performs automated validation and structural metric analysis, and enables repeated-run consistency and content-quality evaluation. Two controlled experiments were conducted using synthetic patient profiles across three LLMs: (1) a comparative model evaluation and (2) a prompt engineering study. The experiments assessed schema compliance, structural violations, cardinality consistency, repeated-run stability, and content grounding. The results show that explicit schema-guided prompting enables reliable structural adherence across models, with structural accuracy scores of 96.67–100% across all conditions. However, robustness, consistency, and perceived usefulness varied depending on the model–prompt combination, with consistency scores ranging from 76.67% to 96.11% across conditions. Although prompt engineering had limited impact on structural performance, it influenced contextual grounding and human-rated usefulness, revealing a trade-off between strict structural control and contextual realism. The thesis concludes that constrained prompting techniques can support reliable structured text generation for mental-health safety plans, but clinically meaningful outputs still require careful prompt design and human oversight. The findings contribute to understanding the potential and limitations of LLMs in safety-critical healthcare applications and provide directions for future research.

Information

Lärosäte / institution
Linnéuniversitetet/Institutionen för datavetenskap och medieteknik (DM)
Publiceringsdatum
2026
Uppsatstyp
Kandidat-uppsats
Språk
Engelska

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.