samatv256 commited on
Commit
02acc03
Β·
1 Parent(s): 6d142c6

Update README and model card for mini-Jev baseline

Browse files
Files changed (1) hide show
  1. README.md +182 -50
README.md CHANGED
@@ -4,50 +4,125 @@ base_model:
4
  - Qwen/Qwen3-0.6B
5
  library_name: pytorch
6
  tags:
 
 
 
7
  - agent
8
  - agentic-ai
9
- - decision-model
10
  - tool-selection
11
- - system-one
 
 
 
 
12
  - open-weights
13
  - qwen
14
  ---
15
 
16
- # ODM Mini v1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- **Open-weight local Choice decision head for agent tool selection, built on frozen Qwen3-0.6B.**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- ODM Mini takes an agent state plus candidate action descriptions and directly ranks the candidates. It produces candidate scores, grouped-softmax probabilities, a selected action, confidence, decision margin, and measured latency. It does **not** generate text.
21
 
22
- ## Model architecture
 
 
23
 
24
  ```text
25
- Frozen Qwen3-0.6B
26
- β†’ candidate-description mean pooling
27
- β†’ Linear(1024,256)
28
- β†’ GELU
29
- β†’ Linear(256,1)
30
- β†’ grouped softmax
31
  ```
32
 
33
- Only description-token hidden states are pooled. The candidate ID, prompt headers, state tokens, and padding are excluded from the pooling mask. The Qwen backbone remains frozen.
 
 
 
 
 
 
 
34
 
35
- ## Size and required backbone
36
 
37
- The ODM-specific trained DecisionHead is approximately **1.1 MB**. The complete runnable model is substantially larger because it additionally requires the separately downloaded [`Qwen/Qwen3-0.6B`](https://huggingface.co/Qwen/Qwen3-0.6B) backbone. This repository does not redistribute Qwen weights.
38
 
39
- ## Installation and usage
40
 
41
  ```bash
42
  pip install torch transformers safetensors huggingface_hub
43
  ```
44
 
45
- The code below downloads this five-file release, imports its deterministic loader without `trust_remote_code=True`, separately obtains Qwen3-0.6B, and performs a Choice:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  ```python
48
  import sys
49
  from pathlib import Path
50
-
51
  from huggingface_hub import snapshot_download
52
 
53
  release_dir = Path(
@@ -66,7 +141,7 @@ sys.path.insert(0, str(release_dir))
66
 
67
  from odm_mini import ODMMiniModel
68
 
69
- model = ODMMiniModel.from_pretrained("samatv256/mini-Jev")
70
 
71
  state = {
72
  "user_request": "Find the current weather in Boston.",
@@ -88,28 +163,69 @@ candidates = [
88
  ]
89
 
90
  choice = model.predict_choice(state=state, candidates=candidates)
91
- print("selected candidate:", choice.selected)
92
- print("probabilities:", choice.probabilities)
93
- print("confidence:", choice.confidence)
94
- print("decision margin:", choice.decision_margin)
95
- print("latency (ms):", choice.latency_ms)
96
  ```
97
 
98
- `ODMMiniModel.from_pretrained()` accepts either the Hub model ID or a local snapshot directory. On CUDA it defaults to BF16 backbone inference; on CPU it defaults to FP32. The DecisionHead is always evaluated in FP32.
 
 
99
 
100
- ## Training
101
 
102
- - 50,000 synthetic training decisions
103
- - frozen `Qwen/Qwen3-0.6B` backbone
104
- - DecisionHead-only training
105
- - grouped cross-entropy objective
106
- - selected seed: **41**
107
 
108
- The selected head is the seed-41 epoch-4 checkpoint. Temperature remains at `1.0`; its maximum grouped-softmax output is reported as confidence, not as a universally calibrated probability.
 
 
 
 
109
 
110
- ## Evaluation
111
 
112
- Synthetic held-out evaluation:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
  | Metric | Result |
115
  |---|---:|
@@ -117,29 +233,45 @@ Synthetic held-out evaluation:
117
  | Stress Choice accuracy | **67.64%** |
118
  | Counterfactual pair consistency | **67.12%** |
119
 
120
- Performance measurements used an NVIDIA GH200, BF16 backbone inference, and the shared-prefix KV-cache serving path. For short and medium contexts of approximately 256–1,024 state tokens, total latency was approximately **76–85 ms** for **3–16 candidates** (measured range: 76.11–82.36 ms). Offline representation extraction reached **831.3 candidates/second** at candidate batch size 512 while caching 430,072 candidates. These local measurements are hardware- and workload-specific and are not a direct speed comparison with Jev or any hosted service.
 
 
121
 
122
- ## Limitations and intended use
123
 
124
- > **ODM Mini v1 is a research/hackathon prototype and is not ready for unmonitored production agent control.**
 
125
 
126
- In a real shadow-agent evaluation covering **75 multi-step trajectories and 243 decisions**, ODM Mini achieved:
127
 
128
- - action accuracy: **27.98%**
129
- - controller agreement: **26.34%**
130
 
131
- The major known failure is **high-confidence premature completion on intermediate multi-step trajectories**. After partial progress, the model can over-index on successful receipts and choose `control.finish` before remaining steps have been completed. Training used synthetic, static decision snapshots, so the published metrics should not be assumed to transfer to arbitrary tools, domains, or agent loops.
132
 
133
- Recommended uses are research, offline evaluation, single-step Choice experiments, and shadow-mode analysis with an independent controller. Do not use this checkpoint as the sole decision-maker for consequential actions or autonomous production control.
134
 
135
- ## Released files
 
 
 
136
 
137
- - `model.safetensors` β€” ODM Mini DecisionHead tensors only
138
- - `config.json` β€” architecture and backbone reference
139
- - `odm_mini.py` β€” inference-only loader
140
- - `README.md` β€” model card and working example
141
- - `LICENSE` β€” Apache License 2.0
 
 
 
142
 
143
- ## License
 
 
 
 
 
 
 
 
144
 
145
- ODM Mini-specific code and weights in this repository are released under Apache-2.0. The separately downloaded Qwen backbone is governed by its own repository terms.
 
4
  - Qwen/Qwen3-0.6B
5
  library_name: pytorch
6
  tags:
7
+ - jev
8
+ - mini-jev
9
+ - decision-model
10
  - agent
11
  - agentic-ai
 
12
  - tool-selection
13
+ - tool-routing
14
+ - model-routing
15
+ - function-calling
16
+ - agent-control
17
+ - local-inference
18
  - open-weights
19
  - qwen
20
  ---
21
 
22
+ # mini-Jev
23
+
24
+ **A Qwen3-0.6B-based decision model for tool selection, routing, and agent-control experiments.**
25
+
26
+ mini-Jev is an experimental decision model designed to make structured control decisions inside an agent loop:
27
+
28
+ ```text
29
+ state + available candidates β†’ probabilities + selected decision
30
+ ```
31
+
32
+ The current release:
33
+ - Uses [Qwen3-0.6B](https://huggingface.co/Qwen/Qwen3-0.6B) as a backbone.
34
+ - Keeps the Qwen backbone frozen.
35
+ - Adds a lightweight trained decision head (~1.1 MB) to score candidate actions directly.
36
+ - Performs candidate scoring and selection; it is not designed for text generation.
37
+ - Serves as an experimental baseline and demo for fast, structured agent decision-making.
38
+
39
+ > **Note on naming:** The model implementation was originally developed under the internal name **ODM Mini v1**. That name remains in class names (`ODMMiniModel`), loader files (`odm_mini.py`), and `config.json` for backwards compatibility.
40
 
41
+ ---
42
+
43
+ ## 1. What is mini-Jev?
44
+
45
+ AI agents frequently encounter situations where they must make small, structured decisions rather than generate free-form text. Common examples include:
46
+
47
+ - **Tool selection:** Deciding which tool or external integration to invoke.
48
+ - **Function routing:** Selecting the specific API or method to execute next.
49
+ - **Next-action prediction:** Choosing between continuing investigation, asking for clarification, or concluding.
50
+ - **Continue / finish decisions:** Deciding whether an assigned task is satisfied or requires another step.
51
+ - **Model routing:** Directing incoming tasks to appropriate candidate downstream models.
52
+
53
+ Rather than invoking a large generative language model for every routing and control decision, mini-Jev explores using a small, specialized decision model to evaluate candidate options directly over agent state.
54
+
55
+ *mini-Jev is an experimental baseline and is not intended for unmonitored production use.*
56
+
57
+ ---
58
 
59
+ ## 2. Current model
60
 
61
+ **Current release: Qwen3-0.6B-based mini-Jev v1**
62
+
63
+ ### Architecture
64
 
65
  ```text
66
+ Frozen Qwen3-0.6B β†’ candidate representation β†’ lightweight decision head β†’ grouped softmax
 
 
 
 
 
67
  ```
68
 
69
+ 1. **Backbone:** The base model is [`Qwen/Qwen3-0.6B`](https://huggingface.co/Qwen/Qwen3-0.6B), which remains completely frozen. The weights in this repository contain only the trained decision head; the Qwen backbone is downloaded separately by the loader.
70
+ 2. **Representation pooling:** State text and candidate descriptions are passed through the model. Only candidate-description tokens are mean-pooled. Candidate IDs, prompt formatting headers, state tokens, and padding tokens are excluded from the pooling mask.
71
+ 3. **Decision head:** A lightweight two-layer MLP:
72
+ - `Linear(1024, 256)`
73
+ - `GELU`
74
+ - `Linear(256, 1)`
75
+ - Total head parameters: **262,657** (~1.1 MB).
76
+ 4. **Scoring:** The resulting scalar logits are normalized across candidate options using a grouped softmax to yield probabilities, a selected candidate, confidence, and decision margin.
77
 
78
+ ---
79
 
80
+ ## 3. Quick start
81
 
82
+ ### Installation
83
 
84
  ```bash
85
  pip install torch transformers safetensors huggingface_hub
86
  ```
87
 
88
+ Download the loader module:
89
+
90
+ ```bash
91
+ hf download samatv256/mini-Jev odm_mini.py --local-dir .
92
+ ```
93
+
94
+ ### Basic usage
95
+
96
+ ```python
97
+ from odm_mini import ODMMiniModel
98
+
99
+ model = ODMMiniModel.from_pretrained("samatv256/mini-Jev")
100
+
101
+ choice = model.predict_choice(
102
+ state={"user_request": "Find the weather in Boston."},
103
+ candidates=[
104
+ {
105
+ "id": "weather.lookup",
106
+ "description": "Look up the current weather.",
107
+ },
108
+ {
109
+ "id": "calendar.list",
110
+ "description": "List calendar events.",
111
+ },
112
+ ],
113
+ )
114
+
115
+ print("Selected:", choice.selected)
116
+ print("Probabilities:", choice.probabilities)
117
+ ```
118
+
119
+ ### Full snapshot download and usage
120
+
121
+ You can also download all repository files to a local directory before loading:
122
 
123
  ```python
124
  import sys
125
  from pathlib import Path
 
126
  from huggingface_hub import snapshot_download
127
 
128
  release_dir = Path(
 
141
 
142
  from odm_mini import ODMMiniModel
143
 
144
+ model = ODMMiniModel.from_pretrained(release_dir)
145
 
146
  state = {
147
  "user_request": "Find the current weather in Boston.",
 
163
  ]
164
 
165
  choice = model.predict_choice(state=state, candidates=candidates)
166
+ print("Selected candidate:", choice.selected)
167
+ print("Probabilities:", choice.probabilities)
168
+ print("Confidence:", choice.confidence)
169
+ print("Decision margin:", choice.decision_margin)
170
+ print("Latency (ms):", choice.latency_ms)
171
  ```
172
 
173
+ `ODMMiniModel.from_pretrained()` accepts either the Hugging Face repo ID or a local directory path. CUDA runs in BF16 by default; CPU runs in FP32.
174
+
175
+ ---
176
 
177
+ ## 4. Example use cases
178
 
179
+ mini-Jev can be used for several structured agent-control patterns:
 
 
 
 
180
 
181
+ - **Tool selection:** Choosing the right tool from a list of available integrations.
182
+ - **Function routing:** Determining which endpoint or handler to call.
183
+ - **Next-action prediction:** Selecting intermediate steps in a reasoning or execution plan.
184
+ - **Agent-control research:** Investigating small-footprint models for local agent decision-making.
185
+ - **Model-routing experiments:** Evaluating routing policies between different candidate models. *(Note: Model routing is a conceptual application of the candidate-selection interface, not a validated production routing capability.)*
186
 
187
+ ### Conceptual example
188
 
189
+ ```text
190
+ State:
191
+ User wants to find the weather in Boston.
192
+
193
+ Candidates:
194
+ - web_search
195
+ - weather_tool
196
+ - calculator
197
+ - finish
198
+
199
+ Decision:
200
+ weather_tool
201
+ ```
202
+
203
+ ---
204
+
205
+ ## 5. Jev Decisions v1
206
+
207
+ Researchers interested in training and evaluating decision models can explore the [Jev Decisions v1 dataset](https://huggingface.co/datasets/samatv256/jev-decisions-v1).
208
+
209
+ - **Dataset card:** [https://huggingface.co/datasets/samatv256/jev-decisions-v1](https://huggingface.co/datasets/samatv256/jev-decisions-v1)
210
+ - **Description:** A public dataset containing nearly 12 million canonical agent-decision records (over 6.2M choice-eligible decisions across 1.06M task trajectories) with explicit candidate sets, chosen actions, and eligibility flags.
211
+
212
+ > **Important:** The current mini-Jev Qwen3-0.6B baseline was **NOT trained on Jev Decisions v1**. It is provided as an open project resource for community research.
213
+
214
+ ---
215
+
216
+ ## 6. Current verified results
217
+
218
+ The results below reflect the public Qwen3-0.6B baseline checkpoint:
219
+
220
+ ### Training configuration
221
+
222
+ - **Training data:** 50,000 synthetic decision examples
223
+ - **Backbone:** Frozen `Qwen/Qwen3-0.6B`
224
+ - **Trained components:** DecisionHead weights only (grouped cross-entropy objective)
225
+ - **Checkpoint:** Seed 41, epoch 4
226
+ - **Temperature:** Fixed at 1.0; maximum softmax output is reported as confidence.
227
+
228
+ ### Synthetic held-out evaluation
229
 
230
  | Metric | Result |
231
  |---|---:|
 
233
  | Stress Choice accuracy | **67.64%** |
234
  | Counterfactual pair consistency | **67.12%** |
235
 
236
+ - **Latency measurements:** On an NVIDIA GH200 using BF16 backbone inference and a shared-prefix KV-cache path, total latency was approximately **76–85 ms** for contexts of 256–1,024 state tokens across 3–16 candidates (measured range: 76.11–82.36 ms). Candidate representation extraction reached 831.3 candidates/second at batch size 512.
237
+
238
+ ### Real shadow-agent evaluation
239
 
240
+ In an offline evaluation on real agent executions across **75 multi-step trajectories and 243 decisions**, the baseline achieved:
241
 
242
+ - **Action accuracy:** **27.98%**
243
+ - **Controller agreement:** **26.34%**
244
 
245
+ These metrics are reported to transparently show the significant transfer gap between synthetic single-step decisions and dynamic, multi-step agent trajectories.
246
 
247
+ ---
 
248
 
249
+ ## 7. Limitations
250
 
251
+ > **mini-Jev v1 is an experimental research prototype and is not ready for unmonitored production agent control.**
252
 
253
+ - **Limited real-agent transfer:** While performance on synthetic single-step benchmarks is moderate (~73%), accuracy drops substantially (~28%) in real multi-step agent environments.
254
+ - **Premature completion:** The model exhibits a known failure mode of high-confidence premature `finish` decisions. After making partial progress, it frequently over-indexes on successful intermediate receipts and chooses `control.finish` before completing remaining steps.
255
+ - **Uncalibrated confidence:** Grouped softmax probabilities indicate relative preference among the provided candidates, not calibrated real-world uncertainty.
256
+ - **No autonomous control:** Do not use this baseline as the sole decision-maker for consequential actions or mission-critical workflows without a human or supervising controller in the loop.
257
 
258
+ ---
259
+
260
+ ## 8. Public project links
261
+
262
+ - **Dataset:** [Jev Decisions v1](https://huggingface.co/datasets/samatv256/jev-decisions-v1)
263
+ - **Collection:** [mini-Jev Hugging Face Collection](https://huggingface.co/collections/samatv256/mini-jev-small-decision-models-for-ai-agents-6ab3e559bed2124120973013)
264
+
265
+ Future work will continue exploring improved decision models and training on larger real agent/tool-use datasets.
266
 
267
+ ---
268
+
269
+ ## Released files and license
270
+
271
+ - `model.safetensors` β€” Trained DecisionHead weights only (262,657 parameters, ~1.1 MB)
272
+ - `config.json` β€” Architecture specification and backbone reference
273
+ - `odm_mini.py` β€” Inference loader module
274
+ - `README.md` β€” Model card and usage documentation
275
+ - `LICENSE` β€” Apache License 2.0
276
 
277
+ The mini-Jev decision head and loader code are released under the Apache-2.0 License. The separately downloaded Qwen3-0.6B backbone is governed by its own license terms from the Qwen team.