Text Generation
Safetensors
English
llama
conversational

Model Card for Llama3-MAGneT

Llama-3-8B-Instruct fine-tuned on the MAGneT dataset for mental health counseling dialogue generation. MAGneT sessions are generated using a coordinated multi-agent framework incorporating specialized response agents (reflection, questioning, solutions, normalizing, psycho-education), a technique agent, a CBT agent, and a response generation agent — resulting in more nuanced and clinically grounded counseling dialogues than single-agent approaches.

Model Details

Base model: meta-llama/Meta-Llama-3-8B-Instruct

Input: A system prompt with a fixed counselor role instruction, followed by the client's demographic information, reason for seeking counseling, and the dialogue history.

Output: The next counselor turn in the therapeutic dialogue.

Training data: MAGneT — 442 synthetic multi-turn counseling sessions grounded in client profiles from the CACTUS dataset, generated using a coordinated multi-agent framework.

Fine-tuning method: QLoRA

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
 
model_id = "UKPLab/Llama3-MAGneT"
 
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
 
system_prompt = (
    "You are playing the role of a counselor in a psychological counseling session. "
    "Your task is to use the provided client information to generate the next counselor "
    "response in the dialogue by combining psychological techniques like reflections, "
    "questioning, providing solutions, normalizing and psychoeducation. The goal is to "
    "create a natural and engaging response that builds on the previous conversation. "
    "Please ensure that the response is empathetic and understanding of the client's issues "
    "and builds trust between the counselor and the client. Please be mindful to only generate "
    "the counselor response for a single turn, and do not include extra text like \"here is the "
    "next counselor utterance\" or \"Here is a possible next utterance\" or anything mentioning "
    "the used technique."
)
 
client_information = (
    "Name:\nLaura Saunders\nAge:\n45\nGender:\nfemale\nOccupation: Office Job\n"
    "Education: College Graduate\nMarital Status: Single\nFamily Details: Lives alone"
)
 
reason_counseling = (
    "I decided to seek counseling because this negative belief is hindering my enjoyment "
    "of running and affecting my overall mood."
)
 
history = (
    "Counselor: Hello, Laura. It's nice to meet you. What brings you in today?\n"
    "Client: Hi, thank you. I've been struggling with the thought that I can't run far, "
    "despite enjoying running as a hobby. It's really getting me down."
)
 
user_content = (
    f"Client Information:\n{client_information}\n"
    f"Reason for seeking counseling:\n{reason_counseling}\n"
    f"Counseling Dialogue:\n{history}"
)
 
messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user",   "content": user_content},
]
 
input_ids = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt"
).to(model.device)
 
with torch.no_grad():
    output = model.generate(
        input_ids,
        max_new_tokens=256,
        do_sample=True,
        temperature=0.7,
        top_p=0.9,
    )
 
response = tokenizer.decode(output[0][input_ids.shape[-1]:], skip_special_tokens=True)
print(response)

Citation

Please cite this model using:

@misc{mandal2025magnetcoordinatedmultiagentgeneration,
      title={MAGneT: Coordinated Multi-Agent Generation of Synthetic Multi-Turn Mental Health Counseling Sessions}, 
      author={Aishik Mandal and Tanmoy Chakraborty and Iryna Gurevych},
      year={2025},
      eprint={2509.04183},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2509.04183}, 
}

Contact

For questions or feedback, please contact: aishik.mandal@tu-darmstadt.de

Downloads last month
30
Safetensors
Model size
8B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for UKPLab/Llama3-MAGneT

Finetuned
(1055)
this model

Dataset used to train UKPLab/Llama3-MAGneT

Collection including UKPLab/Llama3-MAGneT

Paper for UKPLab/Llama3-MAGneT