KediTherapist-pico-base

KediTherapist-pico-base is a small dense Llama-style language model trained from scratch for psychology, therapy, counseling, and human-relationship language modeling. It has 12.8M parameters (4.4M excluding the embedding table) and was pretrained on 410M tokens.

This is a tiny base model, before any instruction tuning or alignment. It continues text; it does not follow instructions. It is a research and educational artifact: it writes fluent, in-domain psychology and counseling prose but frequently makes up facts and loops after a sentence or two. Do not use it for medical, mental-health, or clinical advice.

The KediTherapist family

KediTherapist models share one Llama-style GQA architecture and tokenizer, scaling smoothly from local iGPU prototyping (pico) to multi-GPU tiers (large).

Scale Hidden Layers Heads (query / KV) FFN Context RoPE θ Total Non-embedding
pico ← this model 256 6 4 / 2 704 1,024 10,000 12.8M 4.4M
nano 384 8 6 / 2 1024 1,024 10,000 25.2M 12.6M
micro 512 10 8 / 2 1408 2,048 50,000 45.0M 28.2M
mini 640 12 10 / 2 1728 2,048 50,000 72.6M 51.6M
small 768 18 12 / 4 2048 4,096 100,000 138.4M 113.3M
base 1024 24 16 / 4 2752 4,096 100,000 299.4M 265.9M
medium 2048 24 16 / 4 5504 8,192 500,000 1,130.5M 1,063.4M
large 3072 28 24 / 8 8192 8,192 500,000 2,919.4M 2,818.8M

Architecture

A dense, Llama-style decoder-only transformer (llama_gqa).

Component This model
Parameters 12.82M total, 4.43M excluding the embedding table
Layers / hidden size 6 / 256, pre-norm (RMSNorm, eps 1e-06)
Attention Grouped-query attention: 4 query heads sharing 2 key/value heads, head dim 64, QK-norm
Positions RoPE (θ = 10,000); YaRN scaling available for longer contexts
Feed-forward SwiGLU, 704 hidden
Embeddings Input embedding and output head tied
Output Logit soft-cap 30 (cap · tanh(logits / cap))
Context 1,024 tokens

Training

Data 410M tokens (~93 tokens per non-embedding parameter)
Tokenizer Byte-level BPE, 32,768 tokens, with individual digit splitting and chat, reasoning, and tool-call special tokens
Steps 25,000 × 16,384 tokens (batch 4 × 1,024 × 4 accumulation)
Optimizer AdamW (β = 0.9, 0.95, ε = 1e-8), weight decay 0.1 (not on norms), gradient clipping 1.0
Learning rate 2.5e-3 peak; WSD: 1,469 warm-up steps, 19,531 constant, then cosine decay to 10% of peak over the last 4,000
Precision bf16 autocast
Compute ~1.1e16 FLOPs (6 × non-embedding parameters × tokens)
Hardware One AMD Radeon 890M (laptop iGPU, ROCm on Windows): 21.6 hours at ~6.7K tokens/s

Evaluation

Metric Value
Validation loss (nats/token, held-out) 3.827
Perplexity 45.9

Validation loss over training: 10.45 (0M tok) → 4.27 (66M tok) → 4.17 (139M tok) → 4.13 (205M tok) → 4.12 (270M tok) → 4.08 (336M tok) → 3.99 (377M tok) → 3.83 (410M tok)

Zero-shot Cloze benchmarks (main.py --mode bench --prompt-style cloze)

Task acc_norm acc gold_bpb Items Split Chance
BLiMP 57.1% ± 1.6% 63.1% 2.242 1,000 1,000 stratified pairs (20 phenomena) 50%
SciQ (Psychology) 58.8% ± 3.6% 61.5% 1.884 187 validation + test psychology slice 25%
MMLU High School Psychology 33.7% ± 1.9% 33.2% 1.455 605 validation + test 25%
MMLU Professional Psychology 27.8% ± 1.7% 26.9% 1.367 681 validation + test 25%
SocialIQA 40.0% ± 1.1% 36.3% 2.117 1,954 validation 33%

Each answer choice is scored by continuation log-likelihood in cloze format (in-place blank substitution for fill-in-the-blank items, natural prose continuation for stems/questions, and full-sentence scoring for BLiMP minimal pairs). acc_norm divides log-likelihood by the continuation's length in UTF-8 bytes; acc does not; gold_bpb is bits per byte on the correct continuation (lower is better). ± is one standard error.

What it can and can't do

This is the smallest KediTherapist: a dense 12.8M-parameter model (4.4M excluding the embedding table — about two thirds of the model is the embedding table) trained from scratch on a laptop's integrated GPU, reaching a held-out validation loss of 3.827 (perplexity 45.9) after 410M tokens (~93 tokens per non-embedding parameter). It stays consistently in the register of psychology, therapy, and counseling prose, writes short grammatical sentences, and beats chance across all five domain and linguistic Cloze benchmarks, but it loses the thread after a sentence or two, loops frequently, and invents statistics and citations. It is a research and educational artifact — the bottom rung of the KediTherapist scaling ladder — not a clinical tool or source of mental-health advice.

What it does

  • ✅ Stays squarely in domain. Given psychology or therapy prompts, it continues in the right clinical/educational vocabulary and paragraph register: "When a client feels overwhelmed by anxiety, a therapist can help by" → "asking the client what's happening as it's affecting how they feel"; "In cognitive behavioral therapy," → "In most cases, CBT helps individuals to identify and change thought patterns and behaviors"; "Active listening in counseling involves" → "Active listening encourages discussion of issues and concerns… allowing the individual to express their concerns and needs".
  • ✅ Recognizes core concepts by neighborhood. Prompted with "According to Freud, the ego", it immediately pulls in id, ego, and superego; prompted with attachment theory, it references attachment patterns and early stages — even when it cannot keep the exact definitions straight.
  • ✅ Zero-shot Cloze benchmarks (all above chance): SciQ (Psychology) 58.8% (n=187, chance 25%), MMLU High School Psychology 33.7% (n=605, chance 25%), MMLU Professional Psychology 27.8% (n=681, chance 25%), SocialIQA 40.0% (n=1,954, chance 33.3%), and BLiMP 57.1% acc_norm / 63.1% acc (n=1,000 stratified across 20 phenomena, chance 50%).

What it can't do

  • ❌ Clinical accuracy or advice. This is an unaligned 12.8M-parameter base model. Never rely on it for diagnosis, crisis support, therapeutic guidance, or factual medical/psychological claims.
  • ❌ Facts, citations, and numbers. It confidently fabricates statistics and attributions (e.g., "10-11 percent of individuals with ASD…", "According to the National Institute of Mental Health (NIMH), 'the first step towards healthy health is eating healthy'"). Treat every percentage, study, and quote as invented.
  • ❌ Multi-sentence coherence. After one or two solid sentences it loses track of the argument and falls into local repetition loops ("Behaviors that are behaviors that are behavioral…", "asking the client what's happening at first and asking the client what's happening at first").
  • ❌ Instruction following or chat. Pretrained only — no SFT, preference tuning, or safety alignment yet.
  • ❌ Long context. Trained at a 1,024-token sequence length (YaRN scaling is implemented in the architecture but not fine-tuned for longer contexts at this size).

Decoding

Greedy decoding loops almost immediately. Use sampling with temperature ≈ 0.7 and top-k ≈ 40 (the defaults of KediTherapistModel.generate), keep max_new_tokens short (40–80 tokens), and expect to sample a few seeds.

Usage

PyTorch (needs the keditherapist package):

import torch
from keditherapist.models.model import KediTherapistModel
from keditherapist.tokenizer.tokenizer import KediTokenizer

model = KediTherapistModel.from_pretrained(".")  # this folder: config.json + model.safetensors
tok = KediTokenizer.load("tokenizer.json")
ids = torch.tensor([tok.encode("In cognitive behavioral therapy, ", add_bos=True)])
out = model.generate(ids, max_new_tokens=60, temperature=0.7, top_k=40)
print(tok.decode(out[0].tolist(), skip_special_tokens=True))

Files

File Contents
model.safetensors PyTorch weights, keditherapist parameter names; the output head is tied to tok_embeddings.weight and not stored
config.json ModelConfig for keditherapist
tokenizer.json Byte-level BPE tokenizer (Hugging Face tokenizers format)

Card generated 2026-12-03 by prepare_release.py from llama_gqa_pico_therapy_cooldown.pt.

Downloads last month
108
Safetensors
Model size
12.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support