JohnP1 commited on
Commit
25e3486
·
verified ·
1 Parent(s): 977c030

v0.6.1: routing temperature (use_case_temperatures.routing), same weights as v0.6 (jonpol01/d1a#264)

Browse files
Files changed (2) hide show
  1. README.md +7 -4
  2. d1a_config.json +237 -133
README.md CHANGED
@@ -10,6 +10,8 @@ tags: [mlx, gemma4, d1a, decision-model, structured-output, classification, appl
10
 
11
  # D1A-E2B v0.6 · MLX 8-bit
12
 
 
 
13
  **A small decision model for Apple Silicon: give it a document and a few questions, and it picks the answers.** Each question
14
  is yes/no, multiple choice or a score; D1A returns a calibrated probability for every option in one forward pass, with no
15
  generated text, so every answer is a valid option. About 0.2 s per request on an M4 Mac mini, 3.5 GB on disk.
@@ -20,7 +22,7 @@ small pointer head. Questions in English; documents in English or Japanese.
20
 
21
  ```python
22
  from d1a import D1A # pip install "d1a[serve,media] @ git+https://github.com/jonpol01/d1a@v0.5.0"
23
- m = D1A.load("mlx-community/d1a-e2b-8bit@v0.6")
24
  m.decide("The customer was charged twice for the same order and wants a refund today.",
25
  {"team": {"type": "choice", "instructions": "Which team handles this?",
26
  "criteria": {"billing": None, "shipping": None, "support": None}},
@@ -130,10 +132,10 @@ The [PR-labeler recipe](https://github.com/jonpol01/d1a/tree/main/recipes/pr-lab
130
 
131
  ```bash
132
  pip install "d1a[serve,media] @ git+https://github.com/jonpol01/d1a@v0.5.0"
133
- python -m d1a.serving.serve --run mlx-community/d1a-e2b-8bit@v0.6 --port 8009
134
  ```
135
 
136
- or in-process: `from d1a import D1A; D1A.load("mlx-community/d1a-e2b-8bit@v0.6").decide(state, questions)`. The PyTorch checkpoint is [JohnP1/d1a-e2b](https://huggingface.co/JohnP1/d1a-e2b) `v0.6`. For general decisions only, `@v0.2.1-2epoch-calibrated` is 1.4 points better on decision-v7.
137
 
138
  ## Limits
139
 
@@ -145,7 +147,7 @@ or in-process: `from d1a import D1A; D1A.load("mlx-community/d1a-e2b-8bit@v0.6")
145
  - **Media**: zero-shot, measured on 14 demo requests only. It calls 2 of 3 intact photos damaged, more often than E4B v0.6 does (above).
146
  - **The playground's evals demo** grades answers less sharply than v0.2.1 did. For the English "good answer", error goes from 0.088 to 0.153 and quality from 3.81 to 3.51 (out of 5).
147
  - On the owner's review-bot replay it calls security 5 times, where v0.2.1 called it once.
148
- - One temperature for every question, and no use-case temperatures.
149
  - The recent PR labels come from one large open-source project and a few days of it. If its conventions move again, so will these numbers.
150
  - Questions are in English. The documents can be English or Japanese.
151
 
@@ -158,6 +160,7 @@ Earlier versions (every tag below), the PyTorch checkpoint and the Core ML build
158
  | `v0.1`, `v0.1-1epoch` | general decisions (decision-v7, 1 epoch) |
159
  | `v0.2`, `v0.2-2epoch` | general decisions, 2 epochs |
160
  | `v0.2.1-2epoch-calibrated` | the same weights with a calibration temperature (1.52) |
 
161
  | **`v0.6`** | **every later D1A skill in one run: PR labels, hard, developer-tool and long-document decisions, Japanese, agent routing; a release exception (decision-v7 −1.4)** |
162
 
163
  ## License and data
 
10
 
11
  # D1A-E2B v0.6 · MLX 8-bit
12
 
13
+ **v0.6.1 (2026-10-13)** is v0.6 with one addition, a routing temperature: requests sent with `"use_case": "routing"` are served at T 0.95 instead of 1.45, which brings factory routing's calibration error from 0.091 to 0.035 without changing any answer. The weights and every result below are v0.6's.
14
+
15
  **A small decision model for Apple Silicon: give it a document and a few questions, and it picks the answers.** Each question
16
  is yes/no, multiple choice or a score; D1A returns a calibrated probability for every option in one forward pass, with no
17
  generated text, so every answer is a valid option. About 0.2 s per request on an M4 Mac mini, 3.5 GB on disk.
 
22
 
23
  ```python
24
  from d1a import D1A # pip install "d1a[serve,media] @ git+https://github.com/jonpol01/d1a@v0.5.0"
25
+ m = D1A.load("mlx-community/d1a-e2b-8bit@v0.6.1")
26
  m.decide("The customer was charged twice for the same order and wants a refund today.",
27
  {"team": {"type": "choice", "instructions": "Which team handles this?",
28
  "criteria": {"billing": None, "shipping": None, "support": None}},
 
132
 
133
  ```bash
134
  pip install "d1a[serve,media] @ git+https://github.com/jonpol01/d1a@v0.5.0"
135
+ python -m d1a.serving.serve --run mlx-community/d1a-e2b-8bit@v0.6.1 --port 8009
136
  ```
137
 
138
+ or in-process: `from d1a import D1A; D1A.load("mlx-community/d1a-e2b-8bit@v0.6.1").decide(state, questions)`. The PyTorch checkpoint is [JohnP1/d1a-e2b](https://huggingface.co/JohnP1/d1a-e2b) `v0.6`. For general decisions only, `@v0.2.1-2epoch-calibrated` is 1.4 points better on decision-v7.
139
 
140
  ## Limits
141
 
 
147
  - **Media**: zero-shot, measured on 14 demo requests only. It calls 2 of 3 intact photos damaged, more often than E4B v0.6 does (above).
148
  - **The playground's evals demo** grades answers less sharply than v0.2.1 did. For the English "good answer", error goes from 0.088 to 0.153 and quality from 3.81 to 3.51 (out of 5).
149
  - On the owner's review-bot replay it calls security 5 times, where v0.2.1 called it once.
150
+ - One temperature for every question except routing: from v0.6.1, requests sent with `"use_case": "routing"` are served at T 0.95.
151
  - The recent PR labels come from one large open-source project and a few days of it. If its conventions move again, so will these numbers.
152
  - Questions are in English. The documents can be English or Japanese.
153
 
 
160
  | `v0.1`, `v0.1-1epoch` | general decisions (decision-v7, 1 epoch) |
161
  | `v0.2`, `v0.2-2epoch` | general decisions, 2 epochs |
162
  | `v0.2.1-2epoch-calibrated` | the same weights with a calibration temperature (1.52) |
163
+ | **`v0.6.1`** | **v0.6's weights with a routing temperature**: `"use_case": "routing"` is served at T 0.95 (others keep 1.45); factory routing calibration error 0.091 → 0.035, answered at ≥ 0.9 confidence 34% → 55%, no answer changed (jonpol01/d1a#264) |
164
  | **`v0.6`** | **every later D1A skill in one run: PR labels, hard, developer-tool and long-document decisions, Japanese, agent routing; a release exception (decision-v7 −1.4)** |
165
 
166
  ## License and data
d1a_config.json CHANGED
@@ -1,142 +1,246 @@
1
  {
2
- "format": "d1a-mlx",
3
- "format_version": 1,
4
- "base": "google/gemma-4-E2B",
5
- "base_revision": "d29ff6b45f081a49ee2733a859c9c9c2d95d1a6f",
6
- "source": "JohnP1/d1a-e2b",
7
- "source_revision": "5517e8213504de567175e0b644b9c674c91af771",
8
- "adapter_sha256": "247f222314c8ceee158140d38a0be1c304da81719034ef6e71ee02506e334c1b",
9
- "lora": 16,
10
- "head_dim": 256,
11
- "hidden_size": 1536,
12
- "temperature": 1.447269237440378,
13
- "leading_ids": [
14
- 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ],
16
- "bos_id": 2,
17
- "delimiter_ids": [
18
- 6,
19
- 7,
20
- 8,
21
- 9,
22
- 10
23
  ],
24
- "pad_id": 0,
25
- "dtype": "bfloat16",
26
- "quantization": {
27
- "group_size": 64,
28
- "bits": 8,
29
- "mode": "affine",
30
- "language_model.model.embed_tokens_per_layer": {
31
- "group_size": 64,
32
- "bits": 4,
33
- "mode": "affine"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  },
35
- "embeddings": true
36
- },
37
- "head": "head.safetensors",
38
- "temperature_fit": {
39
- "rows": [
40
- "cal/rows.json",
41
- "calpr/rows.json"
42
- ],
43
- "n": 3178,
44
- "method": "min micro mean NLL over a 121-point log grid 0.25..4",
45
- "cross_validation": {
46
- "raw": {
47
- "n": 3178,
48
- "ece": 0.0505561988092814,
49
- "brier": 0.2952905648331223,
50
- "nll": 0.5648973549274169,
51
- "confident_error_rate": 0.02957835116425425,
52
- "coverage_at_5pct_error": 0.5613593455003146
53
- },
54
- "out_of_fold": {
55
- "n": 3178,
56
- "ece": 0.023704548579686884,
57
- "brier": 0.2896952220920997,
58
- "nll": 0.5324486179012022,
59
- "confident_error_rate": 0.017935808684707365,
60
- "coverage_at_5pct_error": 0.5556954059156702
61
- },
62
- "ece_ci95": {
63
- "raw": [
64
- 0.04102750015575881,
65
- 0.06377306530700594
66
- ],
67
- "out_of_fold": [
68
- 0.016511069955034523,
69
- 0.03860363764230206
70
- ],
71
- "delta": [
72
- -0.04016350379193325,
73
- -0.010727297381358629
74
- ]
75
- },
76
- "separated": true,
77
- "temperatures": [
78
- 1.447269237440378,
79
- 1.447269237440378,
80
- 1.4142135623730947,
81
- 1.4810975522865641,
82
- 1.447269237440378
83
- ],
84
- "folds": 5,
85
- "seed": 0,
86
- "samples": 1000,
87
- "groups": 1670,
88
- "unit": "source-stratified (source, group); sibling questions and variants stay together"
89
  },
90
- "interval": {
91
- "level": 0.9,
92
- "samples": 2000,
93
- "seed": 0,
94
- "lower": 1.381912879967776,
95
- "upper": 1.5157165665103978,
96
- "questions": 3178
 
 
 
 
 
 
97
  },
98
- "fit_rows": [
99
- {
100
- "rows": "cal/rows.json",
101
- "suite": "evals/v7/decision-v7",
102
- "split": "calibration",
103
- "questions": 1148
104
- },
105
- {
106
- "rows": "calpr/rows.json",
107
- "suite": "evals/d1a/pr-labels",
108
- "split": "development",
109
- "questions": 2030
110
- }
111
- ],
112
- "training_suites": [
113
- "evals/devtools-v1",
114
- "evals/documents-v1",
115
- "evals/hard-v1",
116
- "evals/v7/decision-v7"
117
  ],
118
- "training_partitions": [
119
- "evals/d1a/ja-jglue:train",
120
- "evals/d1a/pr-labels:train",
121
- "evals/d1a/pr-labels:train-blast",
122
- "evals/d1a/pr-labels:train-ja",
123
- "evals/d1a/routing:factory-train",
124
- "evals/d1a/routing:generic-train"
125
- ],
126
- "same_corpus": [
127
- "calpr/rows.json: SAME CORPUS: evals/d1a/pr-labels:development is an eval partition of evals/d1a/pr-labels, whose train partitions ['evals/d1a/pr-labels:train', 'evals/d1a/pr-labels:train-blast', 'evals/d1a/pr-labels:train-ja'] the checkpoint trained on"
128
- ],
129
- "in_distribution": {
130
- "allowed": true,
131
- "problems": [
132
- "cal/rows.json: evals/v7/decision-v7 is training data of the checkpoint",
133
- "cal/rows.json: it pools 12 training source(s) ['agnews', 'amazon', 'banking77', 'boolq', 'compositional', 'dbpedia14', 'imdb', 'legacy_policy'] ...",
134
- "cal/rows.json: it reads the calibration partition of evals/v7/decision-v7, a training corpus",
135
- "calpr/rows.json: SAME CORPUS: evals/d1a/pr-labels:development is an eval partition of evals/d1a/pr-labels, whose train partitions ['evals/d1a/pr-labels:train', 'evals/d1a/pr-labels:train-blast', 'evals/d1a/pr-labels:train-ja'] the checkpoint trained on",
136
- "cannot list the sources of --data data/train-e2b-v06.jsonl (outside evals/, no sidecar train-e2b-v06.jsonl.json naming its sources), training data of d1"
137
- ]
 
 
 
 
 
 
138
  }
139
- },
140
- "use_case_temperatures": {},
141
- "use_case_temperature_fits": {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
 
1
  {
2
+ "format": "d1a-mlx",
3
+ "format_version": 1,
4
+ "base": "google/gemma-4-E2B",
5
+ "base_revision": "d29ff6b45f081a49ee2733a859c9c9c2d95d1a6f",
6
+ "source": "JohnP1/d1a-e2b",
7
+ "source_revision": "5517e8213504de567175e0b644b9c674c91af771",
8
+ "adapter_sha256": "247f222314c8ceee158140d38a0be1c304da81719034ef6e71ee02506e334c1b",
9
+ "lora": 16,
10
+ "head_dim": 256,
11
+ "hidden_size": 1536,
12
+ "temperature": 1.447269237440378,
13
+ "leading_ids": [
14
+ 2
15
+ ],
16
+ "bos_id": 2,
17
+ "delimiter_ids": [
18
+ 6,
19
+ 7,
20
+ 8,
21
+ 9,
22
+ 10
23
+ ],
24
+ "pad_id": 0,
25
+ "dtype": "bfloat16",
26
+ "quantization": {
27
+ "group_size": 64,
28
+ "bits": 8,
29
+ "mode": "affine",
30
+ "language_model.model.embed_tokens_per_layer": {
31
+ "group_size": 64,
32
+ "bits": 4,
33
+ "mode": "affine"
34
+ },
35
+ "embeddings": true
36
+ },
37
+ "head": "head.safetensors",
38
+ "temperature_fit": {
39
+ "rows": [
40
+ "cal/rows.json",
41
+ "calpr/rows.json"
42
+ ],
43
+ "n": 3178,
44
+ "method": "min micro mean NLL over a 121-point log grid 0.25..4",
45
+ "cross_validation": {
46
+ "raw": {
47
+ "n": 3178,
48
+ "ece": 0.0505561988092814,
49
+ "brier": 0.2952905648331223,
50
+ "nll": 0.5648973549274169,
51
+ "confident_error_rate": 0.02957835116425425,
52
+ "coverage_at_5pct_error": 0.5613593455003146
53
+ },
54
+ "out_of_fold": {
55
+ "n": 3178,
56
+ "ece": 0.023704548579686884,
57
+ "brier": 0.2896952220920997,
58
+ "nll": 0.5324486179012022,
59
+ "confident_error_rate": 0.017935808684707365,
60
+ "coverage_at_5pct_error": 0.5556954059156702
61
+ },
62
+ "ece_ci95": {
63
+ "raw": [
64
+ 0.04102750015575881,
65
+ 0.06377306530700594
66
+ ],
67
+ "out_of_fold": [
68
+ 0.016511069955034523,
69
+ 0.03860363764230206
70
+ ],
71
+ "delta": [
72
+ -0.04016350379193325,
73
+ -0.010727297381358629
74
+ ]
75
+ },
76
+ "separated": true,
77
+ "temperatures": [
78
+ 1.447269237440378,
79
+ 1.447269237440378,
80
+ 1.4142135623730947,
81
+ 1.4810975522865641,
82
+ 1.447269237440378
83
+ ],
84
+ "folds": 5,
85
+ "seed": 0,
86
+ "samples": 1000,
87
+ "groups": 1670,
88
+ "unit": "source-stratified (source, group); sibling questions and variants stay together"
89
+ },
90
+ "interval": {
91
+ "level": 0.9,
92
+ "samples": 2000,
93
+ "seed": 0,
94
+ "lower": 1.381912879967776,
95
+ "upper": 1.5157165665103978,
96
+ "questions": 3178
97
+ },
98
+ "fit_rows": [
99
+ {
100
+ "rows": "cal/rows.json",
101
+ "suite": "evals/v7/decision-v7",
102
+ "split": "calibration",
103
+ "questions": 1148
104
+ },
105
+ {
106
+ "rows": "calpr/rows.json",
107
+ "suite": "evals/d1a/pr-labels",
108
+ "split": "development",
109
+ "questions": 2030
110
+ }
111
+ ],
112
+ "training_suites": [
113
+ "evals/devtools-v1",
114
+ "evals/documents-v1",
115
+ "evals/hard-v1",
116
+ "evals/v7/decision-v7"
117
  ],
118
+ "training_partitions": [
119
+ "evals/d1a/ja-jglue:train",
120
+ "evals/d1a/pr-labels:train",
121
+ "evals/d1a/pr-labels:train-blast",
122
+ "evals/d1a/pr-labels:train-ja",
123
+ "evals/d1a/routing:factory-train",
124
+ "evals/d1a/routing:generic-train"
125
  ],
126
+ "same_corpus": [
127
+ "calpr/rows.json: SAME CORPUS: evals/d1a/pr-labels:development is an eval partition of evals/d1a/pr-labels, whose train partitions ['evals/d1a/pr-labels:train', 'evals/d1a/pr-labels:train-blast', 'evals/d1a/pr-labels:train-ja'] the checkpoint trained on"
128
+ ],
129
+ "in_distribution": {
130
+ "allowed": true,
131
+ "problems": [
132
+ "cal/rows.json: evals/v7/decision-v7 is training data of the checkpoint",
133
+ "cal/rows.json: it pools 12 training source(s) ['agnews', 'amazon', 'banking77', 'boolq', 'compositional', 'dbpedia14', 'imdb', 'legacy_policy'] ...",
134
+ "cal/rows.json: it reads the calibration partition of evals/v7/decision-v7, a training corpus",
135
+ "calpr/rows.json: SAME CORPUS: evals/d1a/pr-labels:development is an eval partition of evals/d1a/pr-labels, whose train partitions ['evals/d1a/pr-labels:train', 'evals/d1a/pr-labels:train-blast', 'evals/d1a/pr-labels:train-ja'] the checkpoint trained on",
136
+ "cannot list the sources of --data data/train-e2b-v06.jsonl (outside evals/, no sidecar train-e2b-v06.jsonl.json naming its sources), training data of d1"
137
+ ]
138
+ }
139
+ },
140
+ "use_case_temperatures": {
141
+ "routing": 0.9548416039104165
142
+ },
143
+ "use_case_temperature_fits": {
144
+ "routing": {
145
+ "rows": [
146
+ "e2b-v06/gate/suites/routing_generic-development/head/rows.json",
147
+ "e2b-v06/gate/suites/routing_handlabelled-45/head/rows.json"
148
+ ],
149
+ "n": 315,
150
+ "method": "min micro mean NLL over a 121-point log grid 0.25..4",
151
+ "cross_validation": {
152
+ "raw": {
153
+ "n": 315,
154
+ "ece": 0.018499680832099685,
155
+ "brier": 0.03799074208801305,
156
+ "nll": 0.06040660176682812,
157
+ "confident_error_rate": 0.0,
158
+ "coverage_at_5pct_error": 1.0
159
  },
160
+ "out_of_fold": {
161
+ "n": 315,
162
+ "ece": 0.013612898878925516,
163
+ "brier": 0.03937697895309676,
164
+ "nll": 0.06225521527784288,
165
+ "confident_error_rate": 0.0031746031746031746,
166
+ "coverage_at_5pct_error": 1.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  },
168
+ "ece_ci95": {
169
+ "raw": [
170
+ 0.01077328946933042,
171
+ 0.034931159728294615
172
+ ],
173
+ "out_of_fold": [
174
+ 0.0067492580757402216,
175
+ 0.03106535692064003
176
+ ],
177
+ "delta": [
178
+ -0.010430770740017884,
179
+ 0.002236456299991558
180
+ ]
181
  },
182
+ "separated": false,
183
+ "temperatures": [
184
+ 1.0,
185
+ 0.8705505632961241,
186
+ 0.9771599684342458,
187
+ 0.8705505632961241,
188
+ 1.0
 
 
 
 
 
 
 
 
 
 
 
 
189
  ],
190
+ "folds": 5,
191
+ "seed": 0,
192
+ "samples": 1000,
193
+ "groups": 315,
194
+ "unit": "source-stratified (source, group); sibling questions and variants stay together"
195
+ },
196
+ "interval": {
197
+ "level": 0.9,
198
+ "samples": 2000,
199
+ "seed": 0,
200
+ "lower": 0.7405487761432822,
201
+ "upper": 1.1224620483093728,
202
+ "questions": 315
203
+ },
204
+ "fit_rows": [
205
+ {
206
+ "rows": "e2b-v06/gate/suites/routing_generic-development/head/rows.json",
207
+ "suite": "evals/d1a/routing",
208
+ "split": "generic-development",
209
+ "questions": 270
210
+ },
211
+ {
212
+ "rows": "e2b-v06/gate/suites/routing_handlabelled-45/head/rows.json",
213
+ "suite": "evals/d1a/routing",
214
+ "split": "handlabelled-45",
215
+ "questions": 45
216
  }
217
+ ],
218
+ "training_suites": [
219
+ "evals/devtools-v1",
220
+ "evals/documents-v1",
221
+ "evals/hard-v1",
222
+ "evals/v7/decision-v7"
223
+ ],
224
+ "training_partitions": [
225
+ "evals/d1a/ja-jglue:train",
226
+ "evals/d1a/pr-labels:train",
227
+ "evals/d1a/pr-labels:train-blast",
228
+ "evals/d1a/pr-labels:train-ja",
229
+ "evals/d1a/routing:factory-train",
230
+ "evals/d1a/routing:generic-train"
231
+ ],
232
+ "same_corpus": [
233
+ "e2b-v06/gate/suites/routing_generic-development/head/rows.json: SAME CORPUS: evals/d1a/routing:generic-development is an eval partition of evals/d1a/routing, whose train partitions ['evals/d1a/routing:factory-train', 'evals/d1a/routing:generic-train'] the checkpoint trained on",
234
+ "e2b-v06/gate/suites/routing_handlabelled-45/head/rows.json: SAME CORPUS: evals/d1a/routing:handlabelled-45 is an eval partition of evals/d1a/routing, whose train partitions ['evals/d1a/routing:factory-train', 'evals/d1a/routing:generic-train'] the checkpoint trained on"
235
+ ],
236
+ "in_distribution": {
237
+ "allowed": true,
238
+ "problems": [
239
+ "e2b-v06/gate/suites/routing_generic-development/head/rows.json: SAME CORPUS: evals/d1a/routing:generic-development is an eval partition of evals/d1a/routing, whose train partitions ['evals/d1a/routing:factory-train', 'evals/d1a/routing:generic-train'] the checkpoint trained on",
240
+ "e2b-v06/gate/suites/routing_handlabelled-45/head/rows.json: SAME CORPUS: evals/d1a/routing:handlabelled-45 is an eval partition of evals/d1a/routing, whose train partitions ['evals/d1a/routing:factory-train', 'evals/d1a/routing:generic-train'] the checkpoint trained on",
241
+ "cannot list the sources of --data data/train-e2b-v06.jsonl (outside evals/, no sidecar train-e2b-v06.jsonl.json naming its sources), training data of routing-temp-v061/stub/d1a-e2b"
242
+ ]
243
+ }
244
+ }
245
+ }
246
  }