How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "UEC-InabaLab/CounselTrajLM"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "UEC-InabaLab/CounselTrajLM",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Use Docker
docker model run hf.co/UEC-InabaLab/CounselTrajLM
Quick Links

CounselTrajLM

📄 Paper: arXiv:2611.24168

CounselTrajLM generates the next Chinese counselor response from a counseling dialogue history. It is fine-tuned on CounselTrajD and is the dialogue model used in the CounselTraj response-level and dialogue-level experiments.

This release contains the complete merged BF16 text language model, its tokenizer, and a working inference script. It combines the previously released three-epoch LoRA adapter with the unquantized Qwen/Qwen3.5-9B base at revision c202236235762e1c871ad0ccb60c8ee5ba337b9a and loads directly with Transformers. The model is released under Apache-2.0; see LICENSE.

Project, dataset, and evaluation prompts: UEC-InabaLab/CounselTraj. The separate CounselTraj model plans dialogue-act trajectories for data synthesis.

Training details

The following settings come from the saved training records for the released checkpoint.

Item Value
Base model Qwen/Qwen3.5-9B, text language-model component
Release format Complete merged BF16 text language model
Fine-tuning QLoRA, NF4 with double quantization and bfloat16 computation
Adapter rank / alpha / dropout 32 / 64 / 0.05
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Adapter parameters 58,195,968
Dataset split Dialogue-disjoint 90% training / 10% validation
Training / validation examples 425,679 / 47,528 next-response examples
Training epochs 3
Final optimizer step 79,815
Learning rate / warmup ratio 0.0002 / 0.06
Learning-rate schedule Cosine
Optimizer paged_adamw_8bit
Maximum training sequence length 2,048 tokens
Maximum history length Last 1,800 characters
Per-device training batch size / gradient accumulation 2 / 1
Random seed 20260704
Recorded final validation loss 1.5481888056

The merged model uses the final adapter saved after three epochs. Its SHA256 was verified against both the source final adapter and the previously published adapter. The trainer record contains no best-validation checkpoint selection. The original adapter release remains available in the repository history.

Training data and references

CounselTrajD contains 10,964 synthetic Chinese counseling dialogues expanded from three sources:

See the project's licensing scope and source notices for the source-specific data terms.

Generate a reply

Download the public complete model and run the included example:

pip install huggingface_hub
python -c 'from huggingface_hub import snapshot_download; snapshot_download("UEC-InabaLab/CounselTrajLM", local_dir="CounselTrajLM")'
cd CounselTrajLM
pip install -r requirements.txt
python generate_reply.py --model . --input-file examples/histories.jsonl

Or supply a history directly:

python generate_reply.py --model . --history 'client:最近工作压力很大,晚上总是睡不好。'

The script uses the original counselor system prompt and user-history format, with enable_thinking=False. It loads the complete text language model in BF16, with additional memory required for the generation cache. A separate base-model download and the PEFT library are no longer required.

The weights occupy approximately 17.9 GB. The exported model was reloaded on CUDA and checked on the three bundled synthetic histories. The merge comparison and file integrity results are recorded in validation.json.

Input JSONL rows contain an optional id and a nonempty history string. The script outputs JSON with the generated response. The three bundled histories are newly written synthetic examples.

Load in Python

After downloading the repository and installing its requirements:

from generate_reply import load_model, generate_reply

tokenizer, model = load_model("UEC-InabaLab/CounselTrajLM")
response = generate_reply(
    tokenizer,
    model,
    "client:最近工作压力很大,晚上总是睡不好。",
)
print(response)

Evaluation

The response-level evaluation uses PsyDial-D101 from Qiu and Lan (2025), PsyDial: A Large-scale Long-term Conversational Dataset for Mental Health Support. The dialogue-level evaluation uses client profiles from Pan et al. (2026), PsychEval: A Multi-Session and Multi-Therapy Benchmark for High-Realism AI Psychological Counselor. The evaluation documentation provides the prompts, dimensions, and research foundations.

Files

  • model-*.safetensors, model.safetensors.index.json, and config.json: complete merged text language model.
  • generation_config.json: generation defaults.
  • tokenizer.json, tokenizer_config.json, and chat_template.jinja: saved tokenizer and chat template.
  • generate_reply.py: inference entry point.
  • requirements.txt: inference dependencies.
  • model_details.json: actual training settings and checkpoint provenance.
  • examples/histories.jsonl: synthetic example inputs.
  • validation.json: release integrity and generation checks.
  • SHA256SUMS: file checksums.
  • LICENSE: Apache-2.0 license.

The model is intended for counseling dialogue research. Its generated responses have not been validated as clinical care or crisis support.

Citation

@inproceedings{qi-inaba-2027-counseltraj,
    title = "{CounselTraj}: Synthesizing Process-Aware Psychological Counseling Dialogues via Dialogue-Act Trajectory Planning",
    author = "Qi, Zhiyang and Inaba, Michimasa",
    booktitle = "Proceedings of the 20th Conference of the European Chapter of the Association for Computational Linguistics",
    year = "2027",
    url = "https://arxiv.org/abs/2611.24168",
}
Downloads last month
-
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for UEC-InabaLab/CounselTrajLM

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(1,439)
this model

Papers for UEC-InabaLab/CounselTrajLM