RAG Prompting for Mental Health Classification with LLM: A Resource-Efficient Alternative to Instruction Tuning
摘要
This paper presents a Retrieval-Augmented Generation (RAG) approach to improving the mental health classification of social media posts. Our approach combines dynamic example retrieval, using an open-source vector database and a pre-trained sentence embedding model, with the reasoning capabilities of Large Language Models (LLMs) via multi-shot prompting. This offers a resource-efficient alternative to full model fine-tuning, which is often computationally prohibitive. We retrieve the top-K (typically 5, sometimes 1-4 due to LLM context window limitations) most relevant examples based on cosine similarity from a curated subset of a publicly available mental health dataset, incorporating them into prompts for Google’s Gemini-1.5-Flash, Gemma-2B-it, and OpenAI’s GPT-4o. We compare our RAG-enhanced prompting to zero-shot prompting, standard few-shot prompting (using expert-written examples), and to the performance of an instruction-tuned LLM designed for this task. Our results demonstrate that RAG prompting consistently outperforms both zero-shot and standard few-shot methods across multiple datasets and models. Furthermore, our RAG approach achieves performance that is competitive with state-of-the-art instruction-tuned models, without requiring any model fine-tuning. We also investigated the impact of adding a system prompt, finding mixed results that highlight the importance of prompt engineering for specific LLMs. Our work demonstrates the potential of RAG to improve the accuracy and efficiency of mental health classification, offering a practical and accessible approach for resource-constrained settings.