bahree commited on
Commit
ccb26ea
·
verified ·
1 Parent(s): ad0f257

Explain model choices, measured results and how to run inference

Browse files
Files changed (1) hide show
  1. README.md +151 -26
README.md CHANGED
@@ -1,49 +1,174 @@
1
  ---
2
  license: mit
 
 
3
  base_model: Qwen/Qwen3.5-9B
4
- tags: [myjev, lora, decision-model, research]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ---
6
 
7
  # myJEV-9B
8
 
9
- **Locally validated research checkpoint. Not production validated.**
10
 
11
- This candidate preserves seed 11 by convention rather than selecting the best test seed. Compare the full three-seed study before interpreting this individual checkpoint. This artifact passed Python/CLI/HTTP/Docker equivalence and the recorded serving workloads. Consult docs/hosting.md in the source repository for tested limits and workload conditions.
12
 
13
- - Backbone revision: `c202236235762e1c871ad0ccb60c8ee5ba337b9a`.
14
- - Artifact revision: `630ca8351085fc495bd01d53eb20706591aebacbf9074acfc5f9a6c760f1ed93`.
15
- - Precision: `nf4`; nonquantized dtype: `fp32`.
16
- - Method: `continued_sft`, 4,000 initial supervised examples plus 4,000 continuation examples, BANKING77 train partition only.
17
- - Confidence: temperature-scaled selected-answer probability. Selection scores and selected-answer correctness confidence have different semantics.
18
- - Calibration revision: `558be022b546a77e44e006cb4b4410ae263b378ba978e0acfb727eec57e94a33`. Temperature uses reserved BANKING77 calibration data only.
19
- - This seed's official test accuracy: 89.35% on 3080 examples; correctness Brier: 0.0746.
20
 
21
- The public evidence includes seeds 11, 22 and 33, [paired findings](https://github.com/bahree/myJEV/blob/main/docs/qwen-findings.md) and fixed-threshold operational uncertainty. The three-seed transfer and robustness evaluation is complete. Consult the public model comparison; 4B continued SFT with temperature is the local default recommendation. Neither a low Brier score nor a calibration empirical-error target establishes low deployment error.
22
 
23
- ## Load from Hugging Face
24
 
25
- Install the pinned myJEV environment from public source commit `c0147b69d57fbe541cdc2e1bc85c472938e4dda0` at https://github.com/bahree/myJEV. Use the custom shared loader; a generic text-generation widget does not implement this contract.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  ```python
28
  from myjev import DecisionModel
29
- from huggingface_hub import HfApi
30
- # Resolve once and retain this immutable revision in your deployment configuration.
31
- revision = HfApi().model_info("bahree/myJEV-9B").sha
32
- model = DecisionModel.load("bahree/myJEV-9B", revision=revision)
33
- result = model.score({
 
 
34
  "context": "I was charged twice.",
35
- "instructions": "Select the support route.",
36
  "candidates": [
37
- {"id": "billing", "description": "Charges and refunds"},
38
- {"id": "other", "description": "Neither listed route applies"}
 
 
 
 
 
 
 
 
 
 
39
  ]
40
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  ```
42
 
43
- This example demonstrates the request shape, not accuracy on a novel support taxonomy. The separately pinned Qwen backbone must be downloaded or cached. The package contains adapters, heads and manifest; no backbone, optimizer state or training text is included. Declared limits are 160 candidates and 4096 prompt tokens; synthetic pilot boundary tests do not establish quality or latency at those limits for this final checkpoint.
44
 
45
- ## Scope and licensing
46
 
47
- BANKING77 is one intent family. This artifact has no archive adaptation; transfer and robustness evidence must be consulted separately. The 9B configuration uses NF4, while smaller original configurations use BF16, limiting capacity-only conclusions. Request-supplied candidate descriptions are model input and can change behavior.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- The repository source code is MIT-licensed, copyright Amit Bahree. Original adapter/head contributions are MIT-licensed. The pinned Qwen backbone is Apache-2.0 and retains its separate terms; see NOTICE.md and BACKBONE_LICENSE. BANKING77 provenance and its CC BY 4.0 license are documented separately. No managed endpoint is running.
 
1
  ---
2
  license: mit
3
+ language:
4
+ - en
5
  base_model: Qwen/Qwen3.5-9B
6
+ datasets:
7
+ - PolyAI/banking77
8
+ tags:
9
+ - myjev
10
+ - intent-classification
11
+ - single-pass
12
+ - decision-model
13
+ - confidence-estimation
14
+ - custom-inference
15
+ - qlora
16
+ - temperature-scaling
17
+ model-index:
18
+ - name: myJEV-9B
19
+ results:
20
+ - task:
21
+ type: text-classification
22
+ name: Intent classification
23
+ dataset:
24
+ type: PolyAI/banking77
25
+ name: BANKING77 official test
26
+ split: test
27
+ metrics:
28
+ - type: accuracy
29
+ name: Accuracy (%) for released seed-11 checkpoint
30
+ value: 89.3506
31
  ---
32
 
33
  # myJEV-9B
34
 
35
+ The larger myJEV model for exploring how capacity changes decisions and transfer.
36
 
37
+ Give it a request and descriptions of the allowed choices. It returns the chosen ID, a score for each choice and an estimate of correctness, without generating an answer paragraph. The main training task is banking support routing. Possible workflows include choosing a support queue, selecting the next workflow branch and handing uncertain cases to a reviewer after setting a threshold on your own calibration data.
38
 
39
+ By [Amit Bahree](https://huggingface.co/bahree). [Source and study](https://github.com/bahree/myJEV) | [Training findings](https://github.com/bahree/myJEV/blob/main/docs/qwen-findings.md) | [Inference and hosting](https://github.com/bahree/myJEV/blob/main/docs/inference.md)
40
+
41
+ ## Why choose this version?
42
+
43
+ Choose this version when studying capacity or transfer to unfamiliar intent sets. It reached higher mean accuracy than 4B on the study’s distant CLINC transfer cohort, but did not improve mean BANKING77 accuracy over standard 4B and cost more memory and time. It uses four-bit backbone weights so the measured setup fits one 24 GB A30.
44
+
45
+ This is a **Qwen/Qwen3.5-9B backbone plus a small adapter, confidence heads and calibration settings**. The download here contains the learned additions; the loader also downloads the separately pinned backbone. A small adapter file does not eliminate the backbone’s memory or compute cost. Serving reads the input once and performs no autoregressive generation.
46
 
47
+ ## Results you can compare
48
 
49
+ The released checkpoint uses seed 11 by a fixed packaging convention. It was not selected for having the best test result. Accuracy and macro-F1 below use all 3,080 examples in BANKING77’s official test split. Brier measures squared error of reported correctness confidence, where lower is better.
50
 
51
+ | Evaluation | Accuracy | Macro-F1 | Correctness Brier |
52
+ |---|---:|---:|---:|
53
+ | This released checkpoint, seed 11 | 89.35% | 0.8915 | 0.0746 |
54
+ | Mean of seeds 11, 22 and 33 | 89.15% | 0.8892 | 0.0742 |
55
+
56
+ Accuracy’s sample standard deviation across those three seeds is 0.38 percentage points. The [paired analysis](https://github.com/bahree/myJEV/blob/main/results/longer-v1/paired-analysis.md) reports uncertainty for method contrasts. Three observed seeds do not establish performance across all future runs or user tasks.
57
+
58
+ For this seed, warm HTTP latency was **115.09 ms p50 / 118.64 ms p95**, using 100 requests, concurrency one and a short three-candidate request on one NVIDIA A30. The maximum allocated GPU memory observed for direct scoring across the three benchmark workloads was **11.24 GiB**. That excludes some driver/runtime allocations and is not a maximum-context memory guarantee. Startup to readiness was 19.40 seconds with cached weights, measured once. All three sizes were validated on 24 GB A30 hardware; precision here is **NF4 four-bit QLoRA**. [Full serving conditions and evidence](https://github.com/bahree/myJEV/blob/main/docs/hosting.md#completed-candidate-validation-and-local-default).
59
+
60
+ ## Run it
61
+
62
+ The reference environment is Linux, Python 3.12 and an NVIDIA GPU. The pinned requirements include PyTorch, Transformers, PEFT and the four-bit runtime. A working NVIDIA driver and a host C compiler are needed for the tested GPU path. On Debian/Ubuntu, install `gcc` and `libc6-dev` if missing.
63
+
64
+ ```bash
65
+ git clone https://github.com/bahree/myJEV.git
66
+ cd myJEV
67
+ git checkout c0147b69d57fbe541cdc2e1bc85c472938e4dda0
68
+ python3.12 -m venv .venv
69
+ source .venv/bin/activate
70
+ python -m pip install -r requirements.lock
71
+ python -m pip install --no-deps .
72
+ ```
73
+
74
+ Use the custom `DecisionModel` loader. Loading only the adapter, calling ordinary `generate()`, or using a generic classification widget does not execute this model’s complete decision interface.
75
 
76
  ```python
77
  from myjev import DecisionModel
78
+
79
+ model = DecisionModel.load(
80
+ "bahree/myJEV-9B",
81
+ revision="ad0f257ce808d26f56de537cc41bd164645f154b",
82
+ device="cuda:0",
83
+ )
84
+ request = {
85
  "context": "I was charged twice.",
86
+ "instructions": "Select the appropriate support route.",
87
  "candidates": [
88
+ {
89
+ "id": "billing",
90
+ "description": "Charges, invoices, and refunds"
91
+ },
92
+ {
93
+ "id": "technical",
94
+ "description": "Errors and configuration"
95
+ },
96
+ {
97
+ "id": "other",
98
+ "description": "Neither listed route applies"
99
+ }
100
  ]
101
+ }
102
+ result = model.score(request)
103
+ print(result["selected_id"], result["confidence"])
104
+ ```
105
+
106
+ The recorded pinned-runtime check selected `billing` with confidence approximately `0.9533` on that exact fixture. It demonstrates a working call, not a guarantee on a new support taxonomy. The immutable revision above contains the tested runtime files; subsequent card-only edits leave those files unchanged.
107
+
108
+ The same request is checked into the source repository as `examples/request.json`:
109
+
110
+ ```bash
111
+ myjev score --artifact bahree/myJEV-9B \
112
+ --revision ad0f257ce808d26f56de537cc41bd164645f154b \
113
+ --input examples/request.json
114
+
115
+ # Run the local HTTP service in a separate terminal.
116
+ myjev serve --artifact bahree/myJEV-9B \
117
+ --revision ad0f257ce808d26f56de537cc41bd164645f154b
118
+
119
+ # Once /readyz succeeds:
120
+ curl -fsS http://127.0.0.1:8000/score \
121
+ -H 'Content-Type: application/json' --data-binary @examples/request.json
122
  ```
123
 
124
+ Python, CLI and HTTP return the same response fields. Keep your artifact revision pinned in deployment configuration. Publishing this package does not start a hosted endpoint. The source repository includes tested local Docker instructions and a separate, unexecuted managed-hosting recipe.
125
 
126
+ ## What the scores mean
127
 
128
+ **Selection scores** are normalized values used to rank the supplied candidates. The selected ID is the highest-scoring choice.
129
+
130
+ **Reported confidence** is the selected option’s probability after temperature scaling on reserved BANKING77 calibration data. In this standard release it is derived from the selection scores, rather than the separate RL confidence policy. Calibration on banking intents does not establish calibration for arbitrary new tasks or candidate descriptions.
131
+
132
+ The API also returns `artifact_revision` and `calibration_revision` so callers can identify the exact behavior they used. Set acceptance/deferral thresholds using representative calibration data. An explicit `other` candidate is a classification option; confidence-based deferral is a separate decision by your application.
133
+
134
+ ## How it was trained
135
+
136
+ This model received 4,000 initial supervised updates and another 4,000 supervised updates. Continuing supervised training is a control for the extra optimization used by the reinforcement-learning variants. A single temperature was then fitted on reserved calibration data to adjust the selected-option probability. Calibration examples were not used to fit the adapter, and the official test partition was not used to choose the temperature.
137
+
138
+ The matched runs use one example per optimizer update, so the initial and continuation stages each present 4,000 training examples. Training uses the grouped training portion of BANKING77, with separate validation and calibration partitions and the official test split preserved. Candidate order is randomized. The backbone remains frozen while low-rank adapter updates and custom heads learn the task. That reduces training storage; it does not turn the large pretrained backbone into a tiny inference model.
139
+
140
+ BANKING77 supplies 77 closely related banking intents. It is one task family, not a generalist instruction mixture. CLINC150 was kept outside training and tuning for transfer and unsupported-request evaluation. These released weights have no archive adaptation. The separate blog-archive and scratch-model experiments are documented in the project rather than folded into these results.
141
+
142
+ ## The model family
143
+
144
+ Quality columns are three-seed BANKING77 means. Runtime columns are measured on the released seed-11 artifacts under the same short-request conditions described above.
145
+
146
+ | Model | Accuracy | Confidence Brier | HTTP p50 | Allocated VRAM |
147
+ |---|---:|---:|---:|---:|
148
+ | [myJEV-0.8B](https://huggingface.co/bahree/myJEV-0.8B) | 82.93% | 0.1073 | 57.48 ms | 1.55 GiB |
149
+ | [myJEV-0.8B-RL](https://huggingface.co/bahree/myJEV-0.8B-RL) | 81.36% | 0.1321 | 60.88 ms | 1.55 GiB |
150
+ | [myJEV-4B](https://huggingface.co/bahree/myJEV-4B) | 89.23% | 0.0740 | 82.18 ms | 8.18 GiB |
151
+ | [myJEV-4B-RL](https://huggingface.co/bahree/myJEV-4B-RL) | 90.27% | 0.0818 | 81.85 ms | 8.18 GiB |
152
+ | [myJEV-9B](https://huggingface.co/bahree/myJEV-9B) | 89.15% | 0.0742 | 115.09 ms | 11.24 GiB |
153
+ | [myJEV-9B-RL](https://huggingface.co/bahree/myJEV-9B-RL) | 89.34% | 0.0942 | 117.55 ms | 11.24 GiB |
154
+
155
+ The standard releases use continued supervised training and temperature scaling. `-RL` releases use exact confidence-aware reward training. The 9B models also change backbone precision to four-bit NF4, so differences cannot be attributed solely to parameter count. The study includes a separate 4B precision control.
156
+
157
+ ## Tested scope and limits
158
+
159
+ The manifest accepts 2 to 160 candidates and up to 4,096 tokenizer tokens for the entire rendered prompt. Duplicate IDs and oversized requests are rejected instead of silently truncated. Short 160-candidate smoke checks passed for every release; that is not evidence of equally good accuracy or latency at 160 choices. Candidate wording, order, missing correct options and quoted instructions can change decisions. Check the transfer and robustness results before choosing this model for a new workflow.
160
+
161
+ The reference backend has been checked for artifact reloads and Python/CLI/HTTP/Docker consistency, including pinned Hub download checks. New quantization, merged weights or optimized backends need their own equivalence and calibration measurements. No matched speed comparison with the proprietary Jev service has been performed.
162
+
163
+ ## Files, licenses and provenance
164
+
165
+ The package includes `adapter/`, `heads.safetensors`, `manifest.json`, `LICENSE`, `BACKBONE_LICENSE` and `NOTICE.md`. It does not include backbone weights, training text or optimizer state.
166
+
167
+ - Original myJEV code, adapters and heads: MIT, copyright Amit Bahree.
168
+ - Qwen backbone: Apache-2.0, with its original terms retained in `BACKBONE_LICENSE`.
169
+ - [BANKING77](https://huggingface.co/datasets/PolyAI/banking77): CC BY 4.0; Casanueva et al., *Efficient Intent Detection with Dual Sentence Encoders* (2020).
170
+ - Backbone revision: `c202236235762e1c871ad0ccb60c8ee5ba337b9a`.
171
+ - Artifact revision: `630ca8351085fc495bd01d53eb20706591aebacbf9074acfc5f9a6c760f1ed93`.
172
+ - Calibration revision: `558be022b546a77e44e006cb4b4410ae263b378ba978e0acfb727eec57e94a33`.
173
 
174
+ [Source repository](https://github.com/bahree/myJEV) | [Dataset rationale](https://github.com/bahree/myJEV/blob/main/docs/datasets/banking77.md) | [All releases and deployment notes](https://github.com/bahree/myJEV/blob/main/docs/models.md)