Views
No views yet
Base model: meta-llama/Meta-Llama-3-8B-InstructInput: A system prompt with a fixed counselor instruction, followed by the dialogue history and the client profile.Output: The next counselor turn in the therapeutic dialogue.Training data: Graph2Counsel — a dataset of synthetic counseling sessions grounded in CPGs derived from real counseling sessions.Fine-tuning method: QLoRA1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "UKPLab/Llama3-G2C"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13system_prompt = (
14 "You are a professional counselor. Your task is to generate a natural, empathetic "
15 "and therapeutic response to the client's most recent utterance while adhering to "
16 "established psychological techniques. You are provided with the current dialogue "
17 "history and the client profile. Please be mindful to only generate the counselor "
18 "response for a single turn, and do not include extra text like \"here is the next "
19 "counselor utterance\" or \"Here is a possible next utterance\" or anything mentioning "
20 "or explaining the used technique."
21)
22
23history = (
24 "Counselor: What brings you in today?\n"
25 "Client: I've been feeling really anxious at work lately. "
26 "It usually happens when I have to give feedback. "
27 "I worry my comments won't be taken seriously."
28)
29
30profile = (
31 "Client is a 28-year-old graphic designer who overthinks interactions "
32 "with colleagues and struggles to articulate her feelings in stressful situations."
33)
34
35user_content = f"Dialogue History:\n{history}\nClient Profile:\n{profile}"
36
37messages = [
38 {"role": "system", "content": system_prompt},
39 {"role": "user", "content": user_content},
40]
41
42input_ids = tokenizer.apply_chat_template(
43 messages,
44 tokenize=True,
45 add_generation_prompt=True,
46 return_tensors="pt"
47).to(model.device)
48
49with torch.no_grad():
50 output = model.generate(
51 input_ids,
52 max_new_tokens=256,
53 do_sample=True,
54 temperature=0.7,
55 top_p=0.9,
56 )
57
58response = tokenizer.decode(output[0][input_ids.shape[-1]:], skip_special_tokens=True)
59print(response)1@misc{mandal2026graph2counselclinicallygroundedsynthetic,
2 title={Graph2Counsel: Clinically Grounded Synthetic Counseling Dialogue Generation from Client Psychological Graphs},
3 author={Aishik Mandal and Hiba Arnaout and Clarissa W. Ong and Juliet Bockhorst and Kate Sheehan and Rachael Moldow and Tanmoy Chakraborty and Iryna Gurevych},
4 year={2026},
5 eprint={2604.20382},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2604.20382},
9}