Upload folder using huggingface_hub
Browse files- README.md +57 -0
- mdlm_chat.onnx +3 -0
- model_120m_clean_sft.pt +3 -0
- model_66m_clean_sft.pt +3 -0
- spm_en.model +3 -0
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
library_name: pytorch
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- diffusion
|
| 8 |
+
- masked-diffusion
|
| 9 |
+
- mdlm
|
| 10 |
+
- psychology
|
| 11 |
+
- mental-health
|
| 12 |
+
- small-model
|
| 13 |
+
- on-device
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# psyche-diffuse-66m (production) & psyche-diffuse-120m
|
| 17 |
+
|
| 18 |
+
66.8M-parameter **masked diffusion language model** (MDLM, DiT backbone) for English psychology / mental-health dialogue, trained on one RTX 3090. The 120M sibling is published to make the paper's scaling null independently checkable. Paper: *Small-Scale Text Diffusion for a Psychology Assistant* (Denis Kim, 2026), PDF in the GitHub repo.
|
| 19 |
+
|
| 20 |
+
## ⚠️ Intended use & safety
|
| 21 |
+
|
| 22 |
+
Research artifact for studying small-scale text diffusion. **Not a therapist, not a medical device, not for crisis use.** Outputs are frequently vague, repetitive, and can be factually wrong (paper §4–8: blind homonym-drift floor 25–32%). For crisis support call 988 (US) or local equivalents. No real conversations or PII in training data.
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
|
| 26 |
+
| file | what |
|
| 27 |
+
|---|---|
|
| 28 |
+
| `model_66m_clean_sft.pt` | production checkpoint (DiT 512×12×8, MLP 1408; bf16) |
|
| 29 |
+
| `model_120m_clean_sft.pt` | scale checkpoint (640×15×10, 1664; bf16) |
|
| 30 |
+
| `spm_en.model` | 16k SentencePiece BPE (+`[MASK]`=16000) |
|
| 31 |
+
| `mdlm_chat.onnx` | fp32 mobile export of 66m |
|
| 32 |
+
|
| 33 |
+
## Use
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
git clone <github-repo>
|
| 37 |
+
python scripts/sample_mdlm_v2.py --checkpoint model_66m_clean_sft.pt \
|
| 38 |
+
--prompt "user: I feel anxious about work. assistant:" --resp_len 110 --steps 28 \
|
| 39 |
+
--temperature 0.9 --top_p 0.9 # + rep_penalty 1.3, neighbor-ban 2, no-repeat-3gram (defaults)
|
| 40 |
+
# 120m: add MDLM_HIDDEN=640 MDLM_LAYERS=15 MDLM_HEADS=10 MDLM_MLP_INTER=1664
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
Use confidence-ordered unmasking (v2 sampler). Random-order unmasking re-introduces repetition collapse (paper §4).
|
| 44 |
+
|
| 45 |
+
## Training
|
| 46 |
+
|
| 47 |
+
MDLM objective (mask prob t∼U(0.01,0.99), CE on masked); DiffuSeq-style SFT (response-only noising). Pretrain 20k steps / SFT 8k, batch 256×512, LR 4e-4 cosine, bf16 + AdamW8bit. Data: strict-filtered psychology corpus 0.774B tokens; SFT 261k pairs (assistant + mental-health + translated psychology dialogue). Corpora not redistributed; build scripts in repo.
|
| 48 |
+
|
| 49 |
+
## Eval (paper, audited)
|
| 50 |
+
|
| 51 |
+
725 paired prompts, MiniLM cosine-to-gold: 66m-clean 0.500; 120m 0.490 (d=−0.0094, win 0.479 → null at fixed data). Blind traps (3 annotators, κ .77–.87): 66m 9/28 vs 120m 7/28, p=0.77. distinct-2 0.993; rep-1 0.137; collapse 0.
|
| 52 |
+
|
| 53 |
+
## Citation
|
| 54 |
+
|
| 55 |
+
```bibtex
|
| 56 |
+
@misc{kim2026psyche, title={Small-Scale Text Diffusion for a Psychology Assistant}, author={Kim, Denis}, year={2026}, note={arXiv preprint}}
|
| 57 |
+
```
|
mdlm_chat.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff098964843e69b14b9529e09d24dfb45c9662c0b2461c2d1c3c0e44658fad46
|
| 3 |
+
size 300288169
|
model_120m_clean_sft.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6abfed68563a2b31bb06bb0c232c8b0114af59bf49dcf4528e9ae50f4dd9c4d7
|
| 3 |
+
size 242883302
|
model_66m_clean_sft.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b5f15153672f58a1f2aa151bd2ecbf175a1e42f8bff56c27c3e8b85696b4357
|
| 3 |
+
size 133733714
|
spm_en.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43b40ac179f7b6db0620c7fc4ad847e23159c3c855f1bbc30ce680071aab5216
|
| 3 |
+
size 486664
|