Emotion-Aware Conversational AI for Mental Health Support
A Resource-Constrained Fine-Tuning Study of a 7B LLM for Empathetic Dialogue
Overview
This project documents the end-to-end design, development, and evaluation of an emotion-aware conversational AI system built using open-source large language models and publicly available emotional-support datasets.
The primary objective was to create a chatbot capable of generating empathetic, context-aware, supportive, and safe responses for users experiencing emotional distress — while operating under severe hardware constraints (Google Colab T4 GPU, limited VRAM, RAM caps, storage limits, and session timeouts).
Rather than focusing purely on model performance, this work emphasizes the real engineering challenges of training large language models on constrained resources, including dataset processing, memory optimization, runtime stability, and deployment feasibility.
This project reflects extensive experimentation, iterative problem-solving, and practical machine learning engineering under real-world limitations.
Motivation
Generic conversational models often produce fluent text but fail in emotionally sensitive contexts. In mental-health-related interactions, responses must be:
Empathetic
Contextually relevant
Supportive rather than generic
Safe, especially in crisis situations
The goal of this project was to fine-tune a model specifically for emotional support dialogue while minimizing harmful or unsafe outputs.
Base Model
An open-source ~7B parameter language model was selected as the foundation:
Base Model:mistralai/Mistral-7B-v0.1
This size offers strong conversational ability while remaining marginally trainable on a single consumer GPU using parameter-efficient techniques.
Fine-Tuning Method
Training was performed using QLoRA (Quantized Low-Rank Adaptation):
4-bit NF4 quantization of base model
LoRA adapters for trainable parameters
Frozen base model weights
Reduced memory footprint
Feasible training on Colab T4 GPU
This approach enables tuning large models without requiring high-end hardware.
Datasets Used
Two public emotional-support datasets were merged.
1. EmpatheticDialogues (Facebook Research)
A large corpus of emotionally grounded conversations.
Iterative experimentation is essential for successful training
Safety evaluation is critical for mental-health-related AI systems
Ethical Considerations
This system is not a substitute for professional mental health care.
Real-world deployment would require crisis escalation mechanisms, safeguards, and human oversight.
Author
Nihal Jaiswal
AI/ML Practitioner — Machine Learning, NLP, and Generative AI
Focus: Conversational AI, LLM Fine-Tuning, Safe AI Systems