Model Details
Model Description
MentalHealthAI-Qwen2.5-1.5B is an experimental adaptation of the Qwen2.5-1.5B-Instruct language model.
The model is intended to support educational and research-oriented mental wellbeing conversations. Its adaptation focuses on conversational responsiveness, empathetic communication, supportive language and appropriate safety boundaries.
The model is fine-tuned using Supervised Fine-Tuning (SFT) and Low-Rank Adaptation (LoRA), allowing the existing language model to be adapted without updating all its original parameters.
The project explores the use of relatively lightweight open-weight language models in developing accessible mental wellbeing chatbot applications.
Model characteristics:
- Developed by: [Project owner / development team]
- Model type: Decoder-only Transformer language model
- Base model: Qwen2.5-1.5B-Instruct
- Model size: Approximately 1.54 billion parameters
- Language: English (fine-tuning dataset)
- Fine-tuning method: Supervised Fine-Tuning (SFT)
- Parameter-efficient adaptation: LoRA
- Framework: Hugging Face Transformers, PEFT and TRL
- License: Apache 2.0, subject to the licensing and redistribution terms of the included components and training data.
- Primary task: Conversational text generation
Model Sources
Uses
Direct Use
The model is intended for experimental, educational and research-oriented mental wellbeing conversations.
Potential direct uses include:
- Providing empathetic responses to general emotional wellbeing questions.
- Engaging in supportive, non-judgmental conversations.
- Sharing general mental wellbeing information.
- Encouraging healthy help-seeking behaviour.
- Directing users towards appropriate professional support when necessary.
- Demonstrating the application of parameter-efficient fine-tuning to conversational AI.
The model is intended to function as a supportive conversational assistant, not as a mental healthcare professional.
Downstream Use
The model may be integrated into conversational applications through an inference API or an application backend.
The intended project integration consists of:
- A frontend that collects conversational input.
- A FastAPI backend that manages requests.
- A hosted fine-tuned model that generates responses.
- Appropriate safety and privacy controls around the model interaction.
Potential downstream applications include educational mental wellbeing chatbots and research prototypes investigating responsible conversational AI.
Any downstream implementation should include suitable safety mechanisms, human oversight and clear communication about the model's limitations.
Out-of-Scope Use
This model is not designed or validated for:
- Diagnosing mental health conditions.
- Recommending or prescribing medication.
- Providing individualized treatment plans.
- Replacing psychologists, psychiatrists, counsellors or other qualified professionals.
- Performing autonomous clinical assessments.
- Determining suicide or self-harm risk.
- Providing emergency or crisis intervention independently.
- Making clinical decisions.
- Processing identifiable patient records without appropriate authorization and safeguards.
The model must not be presented as a qualified therapist, medical professional or clinically validated mental health system.
Bias, Risks, and Limitations
This model inherits limitations from its original base model and may introduce additional limitations through fine-tuning.
Important limitations include:
1. Limited training data
The initial experimental dataset consists of a small collection of synthetic mental wellbeing conversations. It cannot represent the full diversity of real-world mental health experiences.
2. Potential hallucinations
The model may generate inaccurate, misleading or unsupported information.
3. Cultural and linguistic limitations
The fine-tuning data is primarily English-language. Although the base model supports multiple languages, the fine-tuned model has not been evaluated adequately in Kiswahili or other languages and cultural contexts.
4. Clinical limitations
The model has not undergone clinical validation and should not be relied upon for diagnosis, treatment or professional mental health assessment.
5. Safety limitations
The model may fail to recognize certain crisis-related messages or produce an inadequate response to sensitive situations. Fine-tuning alone does not guarantee safe behaviour.
6. Dataset limitations
Synthetic examples are useful for experimentation but do not establish clinical accuracy, real-world representativeness or effectiveness.
7. Bias
The base model may contain demographic, cultural, linguistic and other biases inherited from its original training data. Fine-tuning does not automatically eliminate these biases.
Recommendations
- Use the model for research and educational experimentation.
- Clearly communicate that responses are AI-generated.
- Do not rely on generated content for clinical decisions.
- Avoid entering identifiable patient information.
- Implement safeguards for crisis-related interactions.
- Provide appropriate pathways to qualified human support.
- Evaluate responses across different conversational scenarios.
- Obtain qualified clinician review before considering any clinical application.
- Conduct appropriate privacy and security assessments before deployment.
- Monitor model failures and update the system when necessary.
How to Get Started with the Model
The following example assumes that the fine-tuned model has been uploaded to Hugging Face as a merged model checkpoint.
Replace the repository identifier with the actual model repository after uploading.
import torch from transformers import ( AutoTokenizer, AutoModelForCausalLM) MODEL_ID = "YOUR_HF_USERNAME/mentalhealthai-qwen2.5-1.5b" tokenizer = AutoTokenizer.from_pretrained( MODEL_ID) model = AutoModelForCausalLM.from_pretrained( MODEL_ID, torch_dtype="auto", device_map="auto") messages = [ { "role": "system", "content": ( "You are a supportive mental wellbeing " "information assistant. Be empathetic and " "respectful. Do not diagnose, prescribe " "medication or replace professional care. " "Acknowledge limitations and encourage " "appropriate professional support." ) }, { "role": "user", "content": ( "I have been feeling overwhelmed lately. " "Can you help me think through what I am experiencing?" ) }] inputs = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate( input_ids=inputs, max_new_tokens=200, do_sample=True, temperature=0.7, top_p=0.9 ) response = tokenizer.decode( outputs[0][inputs.shape[-1]:], skip_special_tokens=True) print(response)
For a repository containing only a LoRA adapter rather than merged weights, load the original base model and attach the adapter using PeftModel.from_pretrained().
Training Details
Training Data
The initial experiment uses a small, synthetic mental wellbeing conversational dataset.
The starter dataset contains approximately 40 artificially constructed prompt-response examples.
The examples cover topics such as:
- General emotional support.
- Stress and overwhelming feelings.
- Empathetic communication.
- Encouraging professional assistance.
- Respectful and supportive conversations.
- Mental wellbeing information.
- Appropriate boundaries around diagnosis and treatment.
- Responses to sensitive or crisis-related messages.
No identifiable patient records or private clinical conversations are intended to be used in this initial experiment.
The dataset is intended for educational model-adaptation experiments and does not represent a clinically validated mental health corpus.
Dataset repository: [Add dataset repository URL if separately published]
Dataset documentation: [Add dataset card URL if available]
Training Procedure
The model is adapted using Supervised Fine-Tuning (SFT).
Low-Rank Adaptation (LoRA) is used to introduce trainable low-rank matrices into selected model layers while keeping the original model parameters frozen.
This reduces the number of trainable parameters and makes experimentation more accessible with limited computational resources.
The training workflow uses:
- Hugging Face Transformers for model loading and model operations.
- Hugging Face Datasets for dataset preparation.
- PEFT for LoRA configuration.
- TRL for supervised fine-tuning.
- PyTorch for model computation.
Preprocessing
The training examples are converted into conversational prompt-response format.
The model's chat template is applied to ensure that messages follow the expected conversational structure.
The dataset is split into training and evaluation subsets before fine-tuning.
Preprocessing includes:
- Removing malformed examples.
- Checking for empty messages.
- Verifying prompt-response formatting.
- Applying the model's tokenizer and chat template.
- Limiting sequence length to the selected training configuration.
The exact dataset split, tokenization settings and preprocessing decisions should be documented from the final training run.
Training Hyperparameters
The following are the planned experimental settings. Replace them with the actual configuration recorded during training.
- Training objective: Supervised Fine-Tuning (SFT)
- Training regime: [Record fp16, bf16 or fp32]
- Fine-tuning method: LoRA
- LoRA rank (r): [Record actual value]
- LoRA alpha: [Record actual value]
- LoRA dropout: [Record actual value]
- Learning rate: [Record actual value]
- Batch size: [Record actual value]
- Gradient accumulation steps: [Record actual value]
- Number of epochs: [Record actual value]
- Maximum sequence length: [Record actual value]
- Optimizer: [Record actual optimizer]
- Random seed: [Record actual seed]
Speeds, Sizes, Times
- Training duration: [Record actual duration]
- Trainable parameters: [Record from training output]
- Total model parameters: Approximately 1.54 billion for the base model.
- LoRA adapter size: [Record actual size]
- Merged model size, if applicable: [Record actual size]
Evaluation
The model should be evaluated after fine-tuning to determine whether it demonstrates useful changes in response behaviour compared with the original base model.
No formal evaluation results are claimed in this model card until the experiment has been completed.
Testing Data, Factors and Metrics
Testing Data
The evaluation should use held-out conversational examples that were not included in training.
The test examples should cover:
- General wellbeing conversations.
- Emotional support requests.
- Stress-related questions.
- Requests for diagnosis.
- Requests for medication recommendations.
- Crisis-related scenarios.
- Questions outside the model's intended scope.
No identifiable patient information should be included in the evaluation dataset.
Factors
Evaluation should consider:
- Response relevance.
- Empathy and respectful communication.
- Instruction following.
- Recognition of model limitations.
- Appropriate professional-care referrals.
- Handling of sensitive and crisis-related prompts.
- Potential harmful or misleading outputs.
- Language and cultural limitations.
Metrics
Recommended evaluation measures include:
- Evaluation loss: Measures model prediction performance on held-out training-format examples.
- Response relevance: Assesses how closely a response addresses the user's message.
- Instruction adherence: Measures whether the model follows its specified conversational constraints.
- Safety compliance: Evaluates whether prohibited clinical claims and unsafe recommendations are avoided.
- Human review: Uses structured assessment of empathy, clarity, factual consistency and appropriate boundaries.
Quantitative results should be reported only after the relevant evaluation has actually been performed.
Results
Evaluation status: Pending experimental fine-tuning and testing.
Table with columns: Evaluation area, Result| Evaluation area | Result |
|---|
| Training loss | To be recorded |
| Evaluation loss | To be recorded |
| Response relevance | Not yet evaluated |
| Empathy and communication | Not yet evaluated |
| Safety compliance | Not yet evaluated |
| Clinical review | Not yet conducted |
Summary
The model is an experimental adaptation intended to investigate whether lightweight fine-tuning can improve the conversational behaviour of an existing instruction-tuned language model for non-clinical mental wellbeing interactions.
Its effectiveness and safety remain to be established through systematic evaluation.
Model Examination
Future examination should compare the original Qwen2.5-1.5B-Instruct model against the fine-tuned model using identical test prompts.
The examination should investigate:
- Differences in response quality.
- Improvements in conversational behaviour.
- Changes in instruction following.
- Unexpected changes in general language abilities.
- Unsafe or unsupported responses.
- Performance on prompts outside the training distribution.
Environmental Impact
The model is intended to be fine-tuned using relatively accessible cloud computing resources, such as a Google Colab GPU.
Environmental impact has not yet been measured.
- Hardware type: [Record actual GPU or CPU]
- Hours used: [Record actual training time]
- Cloud provider: [Record actual provider, e.g. Google Colab]
- Compute region: [Record if available]
- Carbon emitted: Not measured.
Carbon emissions may be estimated using the Machine Learning Impact calculator.
Technical Specifications
Model Architecture and Objective
The base model uses the Qwen2.5 decoder-only Transformer architecture.
Key characteristics of the original Qwen2.5-1.5B-Instruct model include:
- Approximately 1.54 billion parameters.
- 28 Transformer layers.
- Rotary positional embeddings (RoPE).
- Grouped-query attention.
- SwiGLU activation.
- RMSNorm.
- Autoregressive next-token prediction.
The fine-tuning objective is to adapt the existing instruction-tuned language model to generate responses that align more closely with the project's non-clinical mental wellbeing conversational examples.
Compute Infrastructure
The experimental setup is designed for low-cost development and experimentation.
Hardware
- Google Colab GPU, subject to availability.
- NVIDIA T4 GPU where available.
- CPU support for limited inference experiments.
Software
- Python
- PyTorch
- Hugging Face Transformers
- Hugging Face Datasets
- Hugging Face PEFT
- Hugging Face TRL
- Accelerate
- SentencePiece, where required by the tokenizer.
Exact software versions should be recorded from the actual training environment.
Citation
Base Model
The project builds upon the Qwen2.5 model family.
Research paper: Qwen Team (2024). Qwen2.5 Technical Report.
https://arxiv.org/abs/2412.15115
Base model repository:
https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct
Glossary
- LLM: Large Language Model.
- SFT: Supervised Fine-Tuning.
- PEFT: Parameter-Efficient Fine-Tuning.
- LoRA: Low-Rank Adaptation.
- TRL: Transformer Reinforcement Learning library, which also provides supervised fine-tuning tools.
- Tokenizer: A component that converts text into numerical token representations.
- Inference: Generating predictions or responses using a trained model.
- Merged model: A model in which learned adapter weights have been incorporated into the original model weights.
- Model card: Documentation describing a model's characteristics, training, evaluation, intended use and limitations.
This project forms part of an educational exploration of responsible healthcare-focused AI development.
The immediate objective is to develop a working mental wellbeing conversational prototype using an existing open-weight language model and parameter-efficient fine-tuning.
Future improvements may explore:
- Larger and more diverse conversational datasets.
- Retrieval-Augmented Generation (RAG).
- Improved safety evaluation.
- Kiswahili language support.
- Clinician-reviewed educational content.
- Privacy-preserving application design.
- Systematic comparison of fine-tuning approaches.
Any future clinical application would require appropriate clinical, ethical, legal and regulatory assessment.
Model Card Authors
[Insert project author or development team]
[Insert project contact email or repository link]
Publication note: This model card should be updated after the actual fine-tuning and evaluation run. All training hyperparameters, evaluation results, hardware specifications and final dataset information must reflect the experiment that was actually performed.