ZhiyangQi97's picture
Document public model access
ad30d46 verified
|
Raw History Blame Contribute Delete
5.28 kB
---
license: apache-2.0
language:
- zh
library_name: transformers
pipeline_tag: text-generation
base_model: Qwen/Qwen3-8B
base_model_relation: finetune
tags:
- counseltraj
- counseltrajlm
- counseling
- conversational
- qwen3
- merged
---
# CounselTrajLM — Qwen3-8B
📄 **Paper:** [arXiv:2611.24168](https://arxiv.org/abs/2611.24168)
CounselTrajLM generates the next Chinese counselor response from a counseling
dialogue history. This version is fine-tuned on
[CounselTrajD](https://github.com/UEC-InabaLab/CounselTraj#counseltrajd), using
[Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) as its base.
The repository contains the **complete merged BF16 model**, in nine safetensors
shards totaling approximately **16.4 GB**, together with its tokenizer, chat
template, inference script, and checksums. It loads directly with Transformers.
Inference uses **non-thinking mode** (`enable_thinking=False`).
This response-generation model is separate from the
[CounselTraj trajectory planner](https://huggingface.co/UEC-InabaLab/CounselTraj).
Project, dataset, and evaluation prompts are available in the
[CounselTraj repository](https://github.com/UEC-InabaLab/CounselTraj).
## Training details
| Item | Value |
| --- | --- |
| Base model | Qwen/Qwen3-8B |
| Base revision | `b968826d9c46dd6066d109eabc6255188de91218` |
| Training data | CounselTrajD; dialogue-disjoint 90/10 train/validation split |
| Training / validation examples | 425,679 / 47,528 next-response examples |
| Fine-tuning method | QLoRA; adapter merged into the unquantized BF16 base for release |
| LoRA rank / alpha / dropout | 32 / 64 / 0.05 |
| Learning rate | 0.0002 |
| Schedule / warmup ratio | Cosine / 0.06 |
| Epochs | 3; final-epoch export |
| Final optimizer step | 79,815 |
| Effective batch size | 16 |
| Maximum training sequence length | 2,048 tokens |
| Maximum history length | Last 1,800 characters |
| Thinking mode | Disabled |
| Release format | Complete merged BF16 safetensors |
Validation was used for monitoring. The released model is the final epoch.
See [training_summary.json](training_summary.json) for the recorded settings.
## Generate a reply
Download the public model repository and install the inference dependencies:
```bash
pip install huggingface_hub
python -c 'from huggingface_hub import snapshot_download; snapshot_download("UEC-InabaLab/CounselTrajLM-Qwen3-8B", local_dir="CounselTrajLM-Qwen3-8B")'
cd CounselTrajLM-Qwen3-8B
pip install -r requirements.txt
python generate_reply.py --model . --input-file examples/histories.jsonl
```
Or provide a history directly:
```bash
python generate_reply.py --model . --history 'client:最近工作压力很大,晚上总是睡不好。'
```
Input JSONL rows contain an optional `id` and a nonempty `history` string. Use
`client:` and `counselor:` speaker prefixes within the history. The script uses the
original counselor system instruction and training prompt format, retaining the
last 1,800 history characters. It outputs JSON with the generated `response`.
The three bundled histories are newly written synthetic examples.
After downloading the repository, it can also be used from Python:
```python
from generate_reply import load_model, generate_reply
tokenizer, model = load_model("UEC-InabaLab/CounselTrajLM-Qwen3-8B")
response = generate_reply(
tokenizer, model,
"client:最近工作压力很大,晚上总是睡不好。",
)
print(response)
```
The complete weights load in BF16, with additional memory required for inference.
A separate base-model download or PEFT adapter loading is not required.
The release was checked with Transformers 5.13.0, PyTorch 2.5.1,
Accelerate 1.13.0, and safetensors 0.8.0. The GPU generation checks and integrity
results are recorded in [validation.json](validation.json); file checksums are in
[SHA256SUMS](SHA256SUMS).
## Training data and references
CounselTrajD contains 10,964 synthetic Chinese counseling dialogues expanded from
three sources:
- SmileChat: Qiu et al. (2024), [SMILE](https://aclanthology.org/2024.findings-emnlp.34/).
- PsyDTCorpus: Xie et al. (2025), [PsyDT](https://aclanthology.org/2025.acl-long.55/).
- CPsyCounD: Zhang et al. (2024), [CPsyCoun](https://aclanthology.org/2024.findings-acl.830/).
See the project's [licensing scope](https://github.com/UEC-InabaLab/CounselTraj/blob/master/LICENSING.md)
and [source notices](https://github.com/UEC-InabaLab/CounselTraj/blob/master/THIRD_PARTY_NOTICES.md)
for the source-specific data terms. The model is released under Apache-2.0;
see [LICENSE](LICENSE).
## Intended use and limitations
The model is intended for research on Chinese counseling dialogue generation.
Its training data are synthetic. Generated responses may be inaccurate,
inappropriate, or unsafe, and the model is not a substitute for professional
mental health care.
## Citation
```bibtex
@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",
}
```