Maelstrome commited on
Commit
b128db0
·
verified ·
1 Parent(s): a524731

Standardize README: add sibling-runs table, known-quirks, full eval metrics

Browse files
Files changed (1) hide show
  1. README.md +35 -17
README.md CHANGED
@@ -31,6 +31,20 @@ A unified LoRA adapter on top of **Gemma 4 E2B Instruct** that handles three str
31
 
32
  All three surfaces emit strict JSON, no markdown, no analysis voice, in patient-facing tone.
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ## Provenance and intended use
35
 
36
  Trained for the WAVE app, a wellness/reflection tool — not a medical device, not clinical decision support, not a substitute for professional advice. Use under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms).
@@ -79,7 +93,7 @@ User prompt:
79
  <task>Generate exactly 6 patient-facing narration lines. Return only strict JSON. Schema: {"lines":["...", ...]}</task>
80
  ```
81
 
82
- Expected output (set `max_new_tokens >= 224`):
83
 
84
  ```json
85
  {"lines":["You've made it to the end of this practice.","Check in with your urge now — has anything shifted?","...","...","...","..."]}
@@ -87,8 +101,6 @@ Expected output (set `max_new_tokens >= 224`):
87
 
88
  ### `reflection` (post-session card)
89
 
90
- User prompt:
91
-
92
  ```
93
  <surface>reflection</surface>
94
  <patient_context>{"durationSeconds":780,"endingIntensity":2,"intakeIntensity":7,"matType":"buprenorphine","medicationStatus":"on_time","sessionsCount":12,"trigger":"stress","usedSubstanceToday":false}</patient_context>
@@ -97,8 +109,6 @@ User prompt:
97
 
98
  ### `check_in` (multi-turn)
99
 
100
- User prompt:
101
-
102
  ```
103
  <surface>check_in</surface>
104
  <specialized_surface>lora-check-in-1</specialized_surface>
@@ -111,11 +121,11 @@ User prompt:
111
  | | |
112
  |---|---|
113
  | Base | `unsloth/gemma-4-E2B-it` |
114
- | Method | QLoRA (4-bit) |
115
- | Adapter rank / alpha / dropout | 16 / 32 / 0 |
116
  | Target modules | q/k/v/o + gate/up/down (language layers only) |
117
  | Vision/audio layers | Frozen |
118
- | Optimizer | adamw_8bit |
119
  | LR | 2e-4, linear schedule |
120
  | Warmup | 64 steps (~5%) |
121
  | Weight decay | 0.001 |
@@ -132,18 +142,22 @@ Loss curve: 1.55 (step 1) → 0.76 (avg first 50) → 0.148 (steps 400-500) →
132
 
133
  ## Evaluation
134
 
135
- ### Held-out validation (n=428, completion-only)
136
 
137
- | Metric | Value |
138
- |---|---|
139
- | Completion NLL | 4.704 |
140
- | Completion PPL | 110.4 |
 
 
 
 
141
 
142
- Surface coverage: `check_in 165`, `phase_narration 155`, `reflection 108`.
143
 
144
- ### Generation sanity (n=8 from held-out test)
145
 
146
- | Metric | Value |
147
  |---|---|
148
  | JSON validity | 100% (8/8) |
149
  | Schema pass | 100% (8/8) |
@@ -155,7 +169,11 @@ Surface coverage: `check_in 165`, `phase_narration 155`, `reflection 108`.
155
  | Check-in turn sequence pass | 100% |
156
  | Mean tokens/sec (Python QLoRA path) | 10.1 |
157
 
158
- > **Generation-time tip:** `phase_narration` outputs need a budget of **≥ 224 new tokens** (256 recommended). Test outputs needed up to 207 tokens for the six-line JSON to complete cleanly. `check_in` is fine at 96, `reflection` at 192.
 
 
 
 
159
 
160
  ## Dataset
161
 
 
31
 
32
  All three surfaces emit strict JSON, no markdown, no analysis voice, in patient-facing tone.
33
 
34
+ ## Sibling runs
35
+
36
+ This is the **rank-16 / 3-epoch RTX 5080** training of the WAVE corpus. The rank-32 / 1-epoch A100 sibling lives at [`Maelstrome/lora-wave-session-r32`](https://huggingface.co/Maelstrome/lora-wave-session-r32) and wins on every probability metric on the same frozen 428-row test split:
37
+
38
+ | | **rank-16 (this run)** | rank-32 (sibling) |
39
+ |---|---|---|
40
+ | LoRA completion NLL | **4.7149** | 4.5576 |
41
+ | LoRA perplexity | **111.59** | 95.35 |
42
+ | Paired wins vs base | **386 / 428 (90.2%)** | 428 / 428 (100%) |
43
+ | Mean NLL Δ vs base | **0.327 nats** | 0.508 nats |
44
+ | Sign-test p-value | **9.5 × 10⁻⁷¹** | 2.9 × 10⁻¹²⁹ |
45
+
46
+ See [`Maelstrome/lora-wave-session-r32-report`](https://huggingface.co/Maelstrome/lora-wave-session-r32-report) for the full head-to-head report (recipes, generation eval, reproducibility check).
47
+
48
  ## Provenance and intended use
49
 
50
  Trained for the WAVE app, a wellness/reflection tool — not a medical device, not clinical decision support, not a substitute for professional advice. Use under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms).
 
93
  <task>Generate exactly 6 patient-facing narration lines. Return only strict JSON. Schema: {"lines":["...", ...]}</task>
94
  ```
95
 
96
+ Expected output (set `max_new_tokens 224`):
97
 
98
  ```json
99
  {"lines":["You've made it to the end of this practice.","Check in with your urge now — has anything shifted?","...","...","...","..."]}
 
101
 
102
  ### `reflection` (post-session card)
103
 
 
 
104
  ```
105
  <surface>reflection</surface>
106
  <patient_context>{"durationSeconds":780,"endingIntensity":2,"intakeIntensity":7,"matType":"buprenorphine","medicationStatus":"on_time","sessionsCount":12,"trigger":"stress","usedSubstanceToday":false}</patient_context>
 
109
 
110
  ### `check_in` (multi-turn)
111
 
 
 
112
  ```
113
  <surface>check_in</surface>
114
  <specialized_surface>lora-check-in-1</specialized_surface>
 
121
  | | |
122
  |---|---|
123
  | Base | `unsloth/gemma-4-E2B-it` |
124
+ | Method | QLoRA (4-bit) via Unsloth `FastModel` |
125
+ | Adapter rank / alpha / dropout | **16 / 32 / 0** |
126
  | Target modules | q/k/v/o + gate/up/down (language layers only) |
127
  | Vision/audio layers | Frozen |
128
+ | Optimizer | `adamw_8bit` |
129
  | LR | 2e-4, linear schedule |
130
  | Warmup | 64 steps (~5%) |
131
  | Weight decay | 0.001 |
 
142
 
143
  ## Evaluation
144
 
145
+ ### Held-out completion eval (n=428, full test split)
146
 
147
+ | Metric | Base Gemma 4 E2B | This adapter | Delta |
148
+ |---|---|---|---|
149
+ | Completion NLL | 4.9327 | **4.7149** | **−0.218** |
150
+ | Completion perplexity | 138.76 | **111.59** | **−27.16** |
151
+ | Paired wins (LoRA assigned higher prob to reference) | — | **386 / 428 (90.2%)** | — |
152
+ | Mean per-example NLL Δ | — | **0.327** nats | 95% bootstrap CI [0.301, 0.352] |
153
+ | Median per-example NLL Δ | — | 0.285 nats | — |
154
+ | Sign-test p-value | — | **9.54 × 10⁻⁷¹** | overwhelming |
155
 
156
+ Surface coverage on test split: `check_in 144`, `phase_narration 147`, `reflection 137`.
157
 
158
+ ### Generation eval (n=8 sanity sample from held-out test)
159
 
160
+ | Gate | Pass rate |
161
  |---|---|
162
  | JSON validity | 100% (8/8) |
163
  | Schema pass | 100% (8/8) |
 
169
  | Check-in turn sequence pass | 100% |
170
  | Mean tokens/sec (Python QLoRA path) | 10.1 |
171
 
172
+ This was a small sanity-check sample. For a larger 60-example generation gate sweep on the rank-32 sibling, see [`Maelstrome/lora-wave-session-r32`](https://huggingface.co/Maelstrome/lora-wave-session-r32#evaluation).
173
+
174
+ ## Known quirks
175
+
176
+ - **Phase narration needs a generation budget of `max_new_tokens ≥ 224`** (256 recommended). The six-line JSON output runs to ~207 tokens; with a lower cap the closing `]}` gets truncated and `JSON.parse` fails. `check_in` is fine at 96; `reflection` at 192.
177
 
178
  ## Dataset
179