README.md CHANGED
@@ -16,35 +16,31 @@ tags:
16
  **CueReflex-E4B** is a fast, calibrated System-1 decision model fine-tuned from [`google/gemma-4-E4B-it`](https://huggingface.co/google/gemma-4-E4B-it).
17
  Given a structured or unstructured state, a decision question, and bounded criteria/options, it returns a calibrated probability distribution over the options in a single forward pass without text generation.
18
 
19
- ## Release Goal
20
 
21
  This initial release aims to establish a reproducible baseline for independent
22
  evaluation and future improvements, rather than claim state-of-the-art performance.
23
  The reported JevBench public results are local diagnostics, not official leaderboard
24
- scores. Use the standalone inference runtime and its reproduction instructions
25
- in the accompanying `inference/` package.
26
  Future improvements will be released as separately versioned checkpoints.
27
 
28
  ## Model Summary
29
 
30
  - **Developed by:** OidLabs Team
31
  - **Base model:** `google/gemma-4-E4B-it`
32
- - **Architecture:** LoRA adapter (`r=32`, `alpha=64`) + frozen answer-letter readout derived from the base model's output embeddings, with logit softcapping (`30.0`); standalone inference does not require `decision_head.pt`.
33
  - **Supported decision types:**
34
  - `choice`: Categorical selection over 2 to 16 options
35
  - `noul`: Binary verification (`no` / `yes`)
36
  - `score`: Ordinal grading across ordered rubric levels (`0` .. `K-1`)
37
- - **Max sequence length:** 8,192 prompt tokens; longer inputs are rejected without truncation.
38
- - **Prompt format:** `sandwich` (Question, State, Question, Options)
39
  - **Max options:** 16 (`A`–`P`)
40
- - **Temperature calibration:** `choice: 1.1179879425954602`, `noul: 1.032166582952106`, `score: 1.2266572045932158`, fitted on 5,000 validation decisions with a no-sharpening `T >= 1.0` policy.
41
- - **Serving calibration:** Temperatures are stored in `inference_config.json`; standalone inference does not load `calibration.json`, which retains the fitting provenance.
42
- - **NOUL commit band:** Enabled by default in this release's `inference_config.json`. Set `"noul_commit_band": false` to retain temperature-scaled probabilities without this adjustment. After temperature scaling, yes probabilities in `(0.20, 0.50)` become `0.199` and those in `[0.50, 0.80)` become `0.801`. The runtime defaults to disabled if the setting is omitted.
43
  - **License:** Apache-2.0
44
 
45
  ## Training & Contamination Disclosure
46
 
47
- - **Training data:** Fine-tuned on curated, commercial-friendly structured decision examples covering `choice`, `noul`, and `score` tasks.
48
  - **External benchmark evaluation:**
49
  The 231 public JevBench items were used for external diagnostic evaluation, not included in training or used to fit model parameters or temperature calibration.
50
 
@@ -52,24 +48,18 @@ Future improvements will be released as separately versioned checkpoints.
52
 
53
  Local diagnostic results on the 231 public JevBench items (`original.jsonl`, `easy.jsonl`, `hard.jsonl`):
54
 
55
- The v0.2 results were measured through the standalone HTTP inference endpoint,
56
- using the release temperatures and enabled NOUL commit band. Accuracy is local
57
- argmax accuracy, not an official leaderboard score. The zero-shot results are
58
- the historical offline baseline; ECE uses 10 bins for that baseline and 15 bins
59
- for the endpoint, so those ECE values are not directly comparable.
60
-
61
- | Metric | Zero-Shot (`gemma-4-E4B-it`) | **CueReflex-E4B v0.2** |
62
- | --------------- | ---------------------------: | ---------------------: |
63
- | **Accuracy** | 64.94% (150 / 231) | **79.22% (183 / 231)** |
64
- | **Log Loss** | 1.1725 | **0.5918** |
65
- | **Brier Score** | 0.5639 | **0.3042** |
66
- | **ECE** | 0.2569 | **0.1243** |
67
- | **Coverage** | 100.0% | **100.0%** |
68
 
69
  ### Accuracy by Public Tier
70
 
71
- | Tier | Items | Zero-Shot | **CueReflex-E4B v0.2** |
72
- | ------------ | ----: | ----------------: | ---------------------: |
73
- | **Easy** | 48 | 48 / 48 (100.00%) | **48 / 48 (100.00%)** |
74
- | **Original** | 72 | 65 / 72 (90.28%) | **70 / 72 (97.22%)** |
75
- | **Hard** | 111 | 37 / 111 (33.33%) | **65 / 111 (58.56%)** |
 
16
  **CueReflex-E4B** is a fast, calibrated System-1 decision model fine-tuned from [`google/gemma-4-E4B-it`](https://huggingface.co/google/gemma-4-E4B-it).
17
  Given a structured or unstructured state, a decision question, and bounded criteria/options, it returns a calibrated probability distribution over the options in a single forward pass without text generation.
18
 
19
+ ## v0.1 Release Goal
20
 
21
  This initial release aims to establish a reproducible baseline for independent
22
  evaluation and future improvements, rather than claim state-of-the-art performance.
23
  The reported JevBench public results are local diagnostics, not official leaderboard
24
+ scores. The inference runtime and reproduction instructions are forthcoming.
 
25
  Future improvements will be released as separately versioned checkpoints.
26
 
27
  ## Model Summary
28
 
29
  - **Developed by:** OidLabs Team
30
  - **Base model:** `google/gemma-4-E4B-it`
31
+ - **Architecture:** LoRA adapter (`r=32`, `alpha=64`) + frozen answer-letter readout (`decision_head.pt`) with logit softcapping (`30.0`)
32
  - **Supported decision types:**
33
  - `choice`: Categorical selection over 2 to 16 options
34
  - `noul`: Binary verification (`no` / `yes`)
35
  - `score`: Ordinal grading across ordered rubric levels (`0` .. `K-1`)
36
+ - **Max sequence length:** 4,096 tokens
 
37
  - **Max options:** 16 (`A`–`P`)
38
+ - **Temperature calibration:** Identity (`T = 1.0` across `choice`, `noul`, and `score`, selected on held-out validation with a no-sharpening `T >= 1.0` policy)
 
 
39
  - **License:** Apache-2.0
40
 
41
  ## Training & Contamination Disclosure
42
 
43
+ - **Training data:** Fine-tuned on 76,800 curated, commercial-friendly structured decision examples covering `choice`, `noul`, and `score` tasks.
44
  - **External benchmark evaluation:**
45
  The 231 public JevBench items were used for external diagnostic evaluation, not included in training or used to fit model parameters or temperature calibration.
46
 
 
48
 
49
  Local diagnostic results on the 231 public JevBench items (`original.jsonl`, `easy.jsonl`, `hard.jsonl`):
50
 
51
+ | Metric | Zero-Shot (`gemma-4-E4B-it`) | **CueReflex-E4B** |
52
+ | ---------------- | ---------------------------: | ---------------------: |
53
+ | **Accuracy** | 64.94% (150 / 231) | **80.52% (186 / 231)** |
54
+ | **Log Loss** | 1.1725 | **0.4738** |
55
+ | **Brier Score** | 0.5639 | **0.2607** |
56
+ | **ECE (10-bin)** | 0.2569 | **0.0684** |
57
+ | **Coverage** | 100.0% | **100.0%** |
 
 
 
 
 
 
58
 
59
  ### Accuracy by Public Tier
60
 
61
+ | Tier | Items | Zero-Shot | **CueReflex-E4B** |
62
+ | ------------ | ----: | ----------------: | --------------------: |
63
+ | **Easy** | 48 | 48 / 48 (100.00%) | **48 / 48 (100.00%)** |
64
+ | **Original** | 72 | 65 / 72 (90.28%) | **72 / 72 (100.00%)** |
65
+ | **Hard** | 111 | 37 / 111 (33.33%) | **66 / 111 (59.46%)** |
adapter_config.json CHANGED
@@ -30,7 +30,7 @@
30
  "modules_to_save": null,
31
  "monteclora_config": null,
32
  "peft_type": "LORA",
33
- "peft_version": "0.21.3",
34
  "qalora_group_size": 16,
35
  "r": 32,
36
  "rank_pattern": {},
 
30
  "modules_to_save": null,
31
  "monteclora_config": null,
32
  "peft_type": "LORA",
33
+ "peft_version": "0.21.2",
34
  "qalora_group_size": 16,
35
  "r": 32,
36
  "rank_pattern": {},
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b391bf2e2177731eb6e3c3008e9916ec4278c8cd029e39164a46f94b50a0081a
3
  size 279129344
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:245a9731064bc6c2e6fd3c1f4b08d9e80f72ea463fb2055fde4460deb8618c99
3
  size 279129344
inference/README.md CHANGED
@@ -124,11 +124,6 @@ and reported by `GET /v1/version` and evaluation provenance:
124
  - `temperatures`: Per-kind softmax temperatures (`1.0..50.0`).
125
  - `enable_thinking`: JSON boolean (`true` or `false`, default `false`); strings and numbers are rejected.
126
  - `lora_scale` *(optional)*: Multiplier in `(0.0, 1.0]` applied to active LoRA adapter scaling at startup (default `1.0`).
127
- - `prompt_format` *(optional)*: `state_first` (default) or `sandwich`
128
- (Question, State, Question, Options). Use the format recorded by training;
129
- existing v0.1 weights retain `state_first`. Both serving and direct
130
- evaluation use this setting, and record it in metadata. Option order is never
131
- shuffled at inference.
132
 
133
  ## 4. Standalone Evaluation
134
 
 
124
  - `temperatures`: Per-kind softmax temperatures (`1.0..50.0`).
125
  - `enable_thinking`: JSON boolean (`true` or `false`, default `false`); strings and numbers are rejected.
126
  - `lora_scale` *(optional)*: Multiplier in `(0.0, 1.0]` applied to active LoRA adapter scaling at startup (default `1.0`).
 
 
 
 
 
127
 
128
  ## 4. Standalone Evaluation
129
 
inference/eval.py CHANGED
@@ -322,7 +322,6 @@ def main() -> None:
322
  "temperatures": runtime.temperatures,
323
  "noul_commit_band": runtime.noul_commit_band,
324
  "lora_scale": runtime.lora_scale,
325
- "prompt_format": runtime.prompt_format,
326
  "packages": {
327
  name: version(name) for name in ("torch", "transformers", "peft")
328
  },
 
322
  "temperatures": runtime.temperatures,
323
  "noul_commit_band": runtime.noul_commit_band,
324
  "lora_scale": runtime.lora_scale,
 
325
  "packages": {
326
  name: version(name) for name in ("torch", "transformers", "peft")
327
  },
inference/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
 
5
  [project]
6
  name = "cue-reflex-inference"
7
- version = "0.2.0"
8
  description = "Minimal System-1 decision inference server for CueReflex checkpoints"
9
  readme = "README.md"
10
  requires-python = ">=3.11"
 
4
 
5
  [project]
6
  name = "cue-reflex-inference"
7
+ version = "0.1.1"
8
  description = "Minimal System-1 decision inference server for CueReflex checkpoints"
9
  readme = "README.md"
10
  requires-python = ">=3.11"
inference/serve.py CHANGED
@@ -10,7 +10,7 @@ import os
10
  import time
11
  from dataclasses import dataclass
12
  from pathlib import Path
13
- from typing import Any, Literal, Protocol, runtime_checkable
14
 
15
  import torch
16
  from fastapi import FastAPI, HTTPException, Request
@@ -30,7 +30,6 @@ NOUL_COMMIT_LOW = 0.20
30
  NOUL_COMMIT_HIGH = 0.80
31
  NOUL_COMMIT_NEGATIVE = 0.199
32
  NOUL_COMMIT_POSITIVE = 0.801
33
- PromptFormat = Literal["state_first", "sandwich"]
34
 
35
 
36
  class InputValidationError(ValueError):
@@ -55,9 +54,7 @@ class PreparedQuestion:
55
  options: list[str]
56
  descriptions: list[str | None]
57
 
58
- def format_prompt(
59
- self, max_options: int, prompt_format: PromptFormat = "state_first"
60
- ) -> str:
61
  """Format state, question, and lettered options matching CueReflex training."""
62
  prompt_options = ["false", "true"] if self.kind == "noul" else self.options
63
  if not 2 <= len(prompt_options) <= max_options:
@@ -69,10 +66,6 @@ class PreparedQuestion:
69
  f"Question:\n{self.instructions}\n",
70
  "Options:",
71
  ]
72
- if prompt_format == "sandwich":
73
- lines = [f"Question:\n{self.instructions}\n", *lines]
74
- elif prompt_format != "state_first":
75
- raise InputValidationError(f"Unsupported prompt format: {prompt_format!r}")
76
  for idx, option in enumerate(prompt_options):
77
  letter = LETTERS[idx]
78
  desc = self.descriptions[idx] if self.descriptions else None
@@ -143,7 +136,6 @@ class LoadedRuntime:
143
  temperatures: dict[str, float]
144
  noul_commit_band: bool = False
145
  lora_scale: float = 1.0
146
- prompt_format: PromptFormat = "state_first"
147
 
148
 
149
  def letter_token_ids(tokenizer: Any, max_options: int) -> list[int]:
@@ -175,7 +167,6 @@ class InferenceSettings:
175
  noul_commit_band: bool
176
  lora_scale: float
177
  softcap: float | None
178
- prompt_format: PromptFormat = "state_first"
179
 
180
 
181
  def _require_number(
@@ -290,9 +281,6 @@ def load_inference_settings(model_dir: Path) -> InferenceSettings:
290
  enable_thinking = infer_cfg.get("enable_thinking", False)
291
  if type(enable_thinking) is not bool:
292
  raise ValueError("enable_thinking must be a boolean")
293
- prompt_format = infer_cfg.get("prompt_format", "state_first")
294
- if prompt_format not in ("state_first", "sandwich"):
295
- raise ValueError("prompt_format must be state_first or sandwich")
296
  noul_commit_band = infer_cfg.get("noul_commit_band", False)
297
  if type(noul_commit_band) is not bool:
298
  raise ValueError("noul_commit_band must be a boolean")
@@ -317,7 +305,6 @@ def load_inference_settings(model_dir: Path) -> InferenceSettings:
317
  noul_commit_band=noul_commit_band,
318
  lora_scale=lora_scale,
319
  softcap=softcap,
320
- prompt_format=prompt_format,
321
  )
322
 
323
 
@@ -366,8 +353,6 @@ def load_runtime(
366
  model_id += f" LoRA={settings.lora_scale:g}"
367
  if settings.noul_commit_band:
368
  model_id += " NoulCommit=0.199/0.801"
369
- if settings.prompt_format != "state_first":
370
- model_id += f" Prompt={settings.prompt_format}"
371
  return LoadedRuntime(
372
  model=decision_model,
373
  tokenizer=tokenizer,
@@ -378,7 +363,6 @@ def load_runtime(
378
  temperatures=temps,
379
  noul_commit_band=settings.noul_commit_band,
380
  lora_scale=settings.lora_scale,
381
- prompt_format=settings.prompt_format,
382
  )
383
 
384
 
@@ -517,7 +501,7 @@ def score_question(
517
  runtime: LoadedRuntime, question: PreparedQuestion
518
  ) -> tuple[dict[str, Any], int]:
519
  """Tokenize and score one prepared question, returning the answer dict and token count."""
520
- prompt = question.format_prompt(runtime.max_options, runtime.prompt_format)
521
  ids = runtime.tokenizer.apply_chat_template(
522
  [{"role": "user", "content": prompt}],
523
  tokenize=True,
@@ -651,7 +635,6 @@ def create_app(
651
  "temperatures": runtime.temperatures,
652
  "noul_commit_band": runtime.noul_commit_band,
653
  "lora_scale": runtime.lora_scale,
654
- "prompt_format": runtime.prompt_format,
655
  }
656
 
657
  @app.post("/v1/systemone")
 
10
  import time
11
  from dataclasses import dataclass
12
  from pathlib import Path
13
+ from typing import Any, Protocol, runtime_checkable
14
 
15
  import torch
16
  from fastapi import FastAPI, HTTPException, Request
 
30
  NOUL_COMMIT_HIGH = 0.80
31
  NOUL_COMMIT_NEGATIVE = 0.199
32
  NOUL_COMMIT_POSITIVE = 0.801
 
33
 
34
 
35
  class InputValidationError(ValueError):
 
54
  options: list[str]
55
  descriptions: list[str | None]
56
 
57
+ def format_prompt(self, max_options: int) -> str:
 
 
58
  """Format state, question, and lettered options matching CueReflex training."""
59
  prompt_options = ["false", "true"] if self.kind == "noul" else self.options
60
  if not 2 <= len(prompt_options) <= max_options:
 
66
  f"Question:\n{self.instructions}\n",
67
  "Options:",
68
  ]
 
 
 
 
69
  for idx, option in enumerate(prompt_options):
70
  letter = LETTERS[idx]
71
  desc = self.descriptions[idx] if self.descriptions else None
 
136
  temperatures: dict[str, float]
137
  noul_commit_band: bool = False
138
  lora_scale: float = 1.0
 
139
 
140
 
141
  def letter_token_ids(tokenizer: Any, max_options: int) -> list[int]:
 
167
  noul_commit_band: bool
168
  lora_scale: float
169
  softcap: float | None
 
170
 
171
 
172
  def _require_number(
 
281
  enable_thinking = infer_cfg.get("enable_thinking", False)
282
  if type(enable_thinking) is not bool:
283
  raise ValueError("enable_thinking must be a boolean")
 
 
 
284
  noul_commit_band = infer_cfg.get("noul_commit_band", False)
285
  if type(noul_commit_band) is not bool:
286
  raise ValueError("noul_commit_band must be a boolean")
 
305
  noul_commit_band=noul_commit_band,
306
  lora_scale=lora_scale,
307
  softcap=softcap,
 
308
  )
309
 
310
 
 
353
  model_id += f" LoRA={settings.lora_scale:g}"
354
  if settings.noul_commit_band:
355
  model_id += " NoulCommit=0.199/0.801"
 
 
356
  return LoadedRuntime(
357
  model=decision_model,
358
  tokenizer=tokenizer,
 
363
  temperatures=temps,
364
  noul_commit_band=settings.noul_commit_band,
365
  lora_scale=settings.lora_scale,
 
366
  )
367
 
368
 
 
501
  runtime: LoadedRuntime, question: PreparedQuestion
502
  ) -> tuple[dict[str, Any], int]:
503
  """Tokenize and score one prepared question, returning the answer dict and token count."""
504
+ prompt = question.format_prompt(runtime.max_options)
505
  ids = runtime.tokenizer.apply_chat_template(
506
  [{"role": "user", "content": prompt}],
507
  tokenize=True,
 
635
  "temperatures": runtime.temperatures,
636
  "noul_commit_band": runtime.noul_commit_band,
637
  "lora_scale": runtime.lora_scale,
 
638
  }
639
 
640
  @app.post("/v1/systemone")
inference_config.json CHANGED
@@ -1,16 +1,15 @@
1
  {
2
  "schema_version": 1,
3
- "model_version": "0.2.0",
4
  "base_model": "google/gemma-4-E4B-it",
5
  "max_seq_length": 8192,
6
  "max_options": 16,
7
  "enable_thinking": false,
8
- "prompt_format": "sandwich",
9
  "softcap": 30.0,
10
  "noul_commit_band": true,
11
  "temperatures": {
12
- "choice": 1.1179879425954602,
13
- "noul": 1.032166582952106,
14
- "score": 1.2266572045932158
15
  }
16
  }
 
1
  {
2
  "schema_version": 1,
3
+ "model_version": "0.1.0",
4
  "base_model": "google/gemma-4-E4B-it",
5
  "max_seq_length": 8192,
6
  "max_options": 16,
7
  "enable_thinking": false,
 
8
  "softcap": 30.0,
9
  "noul_commit_band": true,
10
  "temperatures": {
11
+ "choice": 1.0,
12
+ "noul": 1.0,
13
+ "score": 1.0
14
  }
15
  }