Phora68 commited on
Commit
18d865d
Β·
verified Β·
1 Parent(s): 7a99a20

Update model card

Browse files
Files changed (1) hide show
  1. README.md +29 -38
README.md CHANGED
@@ -2,15 +2,15 @@
2
  license: other
3
  base_model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
4
  tags:
5
- - clinical
6
- - medical
7
- - healthcare
8
- - qlora
9
- - unsloth
10
- - chatml
11
- - rapha
12
  language:
13
- - en
14
  ---
15
 
16
  # Rapha β€” Clinical AI Physician Assistant
@@ -24,14 +24,16 @@ never diagnoses.**
24
  - **Method:** QLoRA (Unsloth) β†’ curriculum SFT β†’ DPO
25
  - **Chat template:** ChatML
26
  - **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
27
- - **LoRA config:** r=32, alpha=32, target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
28
- - **Trained:** 2026-07-22
29
 
30
- ## Training architecture (v2.3)
31
 
32
  Single-trainer curriculum SFT: three phases concatenated into one ordered
33
- dataset with a single cosine LR schedule. This avoids the optimizer restart
34
- and warmup re-run issues of the previous multi-trainer approach.
 
 
 
35
 
36
  | Phase | Data | Purpose |
37
  |---|---|---|
@@ -46,38 +48,27 @@ and warmup re-run issues of the previous multi-trainer approach.
46
  | `/` (root) | LoRA adapter (PEFT) β€” small, load on top of the base model |
47
  | `merged/` | Full merged fp16 weights β€” standalone, no base model needed |
48
  | `gguf/` | Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio |
49
- | `datasets/` | Raw JSONL training/validation/DPO datasets used for this run |
50
 
51
  ## Training data
52
 
53
- **Total training records: ~159,766**
54
-
55
- | Dataset | Records | File |
56
- |---|---|---|
57
- | Stage 1 β€” Greetings | 25,000 | `stage1_greetings.jsonl` |
58
- | Stage 2 β€” OPQRST | 40,344 | `stage2_opqrst.jsonl` |
59
- | Stage 3 β€” History | 40,000 | `stage3_history.jsonl` |
60
- | Stage 4 β€” Red Flags | 14,422 | `stage4_red_flags.jsonl` |
61
- | Adversarial | 10,000 | `adversarial.jsonl` |
62
- | Full-Arc Conversations | 30,000 | `full_arc_conversations.jsonl` |
63
- | Validation | 1,100 | `val_sharegpt.jsonl` |
64
- | DPO Preference Pairs | 3,000 | `preference_pairs.jsonl` |
65
-
66
- Stage 1 greetings, Stage 2 OPQRST symptom exploration, Stage 3 medical
67
- history, Stage 4 red-flag screening, and a multi-turn adversarial set
68
- (self-diagnosis, symptom denial, medication refusal, minimised red flags,
69
- prompt injection β€” a portion include a patient pushback turn to test
70
- boundary-holding). Followed by DPO preference alignment on the pairs above.
71
-
72
- ### Red-flag terms screened for
73
-
74
- `worst headache`, `can't feel my legs`, `arm feels heavy and chest`, `can't breathe`, `loss of consciousness`, `sudden vision`, `neck stiff`, `light hurts`, `confused`, `won't stop bleeding`, `bilateral leg weakness`, `bladder dysfunction`, `tachypnoea`, `thunderclap`, `cauda equina`, `qsofa`, `meningitis`
75
 
76
  ## Eval metrics (last training run)
77
 
78
  | Metric | Value |
79
  |---|---|
80
- | _(no eval metrics captured)_ | β€” |
 
 
 
 
 
 
81
 
82
  ## Usage β€” Ollama (GGUF)
83
 
@@ -107,4 +98,4 @@ Red-flag detection and escalation responses should be validated against
107
  the clinical accuracy benchmark before any clinical use.
108
 
109
  ---
110
- *Generated automatically by `train_rapha_llm.py` v2.3.*
 
2
  license: other
3
  base_model: unsloth/Qwen2.5-3B-Instruct-bnb-4bit
4
  tags:
5
+ - clinical
6
+ - medical
7
+ - healthcare
8
+ - qlora
9
+ - unsloth
10
+ - chatml
11
+ - rapha
12
  language:
13
+ - en
14
  ---
15
 
16
  # Rapha β€” Clinical AI Physician Assistant
 
24
  - **Method:** QLoRA (Unsloth) β†’ curriculum SFT β†’ DPO
25
  - **Chat template:** ChatML
26
  - **Context window:** 8,192 tokens (training) / 4,096 (Ollama default)
27
+ - **Trained:** 2026-07-30
 
28
 
29
+ ## Training architecture (v2.5)
30
 
31
  Single-trainer curriculum SFT: three phases concatenated into one ordered
32
+ dataset with a single cosine LR schedule. DPO uses a de-duplicated
33
+ preference set with a held-out validation split (by unique prompt) and a
34
+ corrected stage-aware system prompt (v2.3 had a bug where every DPO
35
+ example was trained under the Adversarial system prompt, regardless of
36
+ its actual stage β€” fixed in v2.4).
37
 
38
  | Phase | Data | Purpose |
39
  |---|---|---|
 
48
  | `/` (root) | LoRA adapter (PEFT) β€” small, load on top of the base model |
49
  | `merged/` | Full merged fp16 weights β€” standalone, no base model needed |
50
  | `gguf/` | Quantised GGUF files (Q4_K_M, Q5_K_M, Q8_0) for Ollama / llama.cpp / LM Studio |
 
51
 
52
  ## Training data
53
 
54
+ Curriculum SFT across 5 datasets (~170k records): Stage 1 greetings, Stage 2
55
+ OPQRST symptom exploration, Stage 3 medical history, Stage 4 red-flag
56
+ screening, and a multi-turn adversarial set (self-diagnosis, symptom denial,
57
+ medication refusal, minimised red flags, prompt injection β€” ~50% with a
58
+ patient pushback turn). Followed by DPO preference alignment on a
59
+ de-duplicated, leak-safe train/val split.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  ## Eval metrics (last training run)
62
 
63
  | Metric | Value |
64
  |---|---|
65
+ | empathy_rate | 0.2500 |
66
+ | escalation_accuracy | 0.0000 |
67
+ | adversarial_hold_rate | 1.0000 |
68
+ | pushback_hold_rate | 1.0000 |
69
+ | multi_question_rate | 0.0250 |
70
+ | repetition_rate | 0.0000 |
71
+ | avg_response_length | 36.2000 |
72
 
73
  ## Usage β€” Ollama (GGUF)
74
 
 
98
  the clinical accuracy benchmark before any clinical use.
99
 
100
  ---
101
+ *Generated automatically by `train_rapha_llm.py` v2.5.*