devops-thiago commited on
Commit
e45600b
Β·
verified Β·
1 Parent(s): 559ff5a

Add standalone model card

Browse files
Files changed (1) hide show
  1. README.md +143 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.5-4B
4
+ tags:
5
+ - decision-model
6
+ - system-1
7
+ - rlcd
8
+ - proper-scoring-rules
9
+ - gemma
10
+ - classone
11
+ - classification
12
+ pipeline_tag: text-classification
13
+ ---
14
+
15
+ # classone-qwen3.5-4b β€” ClassOne System 1 Decision Model
16
+
17
+ **[devops-thiago/classone-qwen3.5-4b](https://huggingface.co/devops-thiago/classone-qwen3.5-4b)** is an open-source **System 1 decision model** using the [ClassOne architecture](https://github.com/devops-thiago/class-one). The full fine-tuned backbone ships directly in this repository β€” it loads as a single model, with no adapter and no separate base-model download.
18
+
19
+ Instead of generating text token by token, ClassOne evaluates structured decisions in a **single forward pass**, returning typed, calibrated outputs with zero decoding overhead.
20
+
21
+ ## Benchmark Results
22
+
23
+ ### 1. JevBench Public Multi-Tier Benchmark (231 Public Tasks)
24
+
25
+ Evaluated across all 231 public tasks in [fstandhartinger/jevbench](https://github.com/fstandhartinger/jevbench):
26
+
27
+ | Tier | Tasks | Accuracy | ECE | Brier Score | Median Latency (p50) |
28
+ |---|---|---|---|---|---|
29
+ | **Easy** | 48 | **100.0%** (48/48) | **0.0001** | **0.0000** | **63.4 ms** |
30
+ | **Original** | 72 | **95.8%** (69/72) | **0.0458** | **0.0377** | **61.1 ms** |
31
+ | **Hard** | 111 | **40.5%** (45/111) | 0.4825 | 0.4504 | **184.5 ms** |
32
+ | **Overall Aggregate** | **231** | **70.1%** (162/231) | β€” | β€” | **61.1 ms** |
33
+
34
+ - **Original Tier Sub-Breakdown:** Choice accuracy: **97.2%** (35/36); Score rubrics: **100.0%** (12/12); Noul accuracy: **91.7%** (22/24).
35
+ - **Easy Tier Sub-Breakdown:** Choice accuracy: **100.0%** (36/36); Noul policy accuracy: **100.0%** (12/12).
36
+
37
+ ### 2. RLCDAlignBench Alignment & Safety Evaluation (100 Instances)
38
+
39
+ | Failure Mode / Axis | Samples (N) | AUROC | Accuracy (%) | ECE | Latency (p50) |
40
+ |---|---|---|---|---|---|
41
+ | **Power Seeking** | 6 | **0.778** | **83.3%** | 0.1475 | 441.5 ms |
42
+ | **Faithfulness** | 9 | **0.850** | **66.7%** | 0.1956 | 433.4 ms |
43
+ | **Refusal (Jailbreaks)** | 11 | **0.733** | **72.7%** | **0.0753** | 570.5 ms |
44
+ | **Honesty (Deception)** | 11 | **0.733** | **72.7%** | 0.2583 | 453.5 ms |
45
+ | **Overall AUROC** | **100** | **0.604** | **55.3%** | **0.2553** | **410.9 ms** |
46
+
47
+ ### 3. Edge vs Cloud Latency (ClassOne vs TypeSafe Jev API)
48
+
49
+ Measured against TypeSafe AI's Jev (v1.13) cloud API:
50
+ - **ClassOne (Local RTX 5060 Ti):** **52.49 ms** mean latency (19.1 req/s, $0.00 inference cost, 100% private)
51
+ - **TypeSafe Jev (Cloud API):** **329.90 ms** mean latency (3.0 req/s)
52
+ - **Edge Speedup:** **6.3Γ— faster** than cloud API round-trip latency
53
+
54
+ ## Decision Primitives
55
+
56
+ - **`Noul`** β€” Boolean check returning a calibrated probability P(true) ∈ [0, 1]
57
+ - **`Choice`** β€” Categorical selection over 2–255 dynamic options with full probability distribution
58
+ - **`Score`** β€” Continuous ordinal rubric rating over 2–10 levels (expected value)
59
+
60
+ All outputs are calibrated with a combined NLL + normalized Brier loss.
61
+ Post-hoc temperature calibration achieves **ECE = 0.034** (down from 0.178).
62
+
63
+ ## Quickstart
64
+
65
+ ```bash
66
+ pip install classone
67
+ ```
68
+
69
+ ```python
70
+ import torch
71
+ from huggingface_hub import hf_hub_download
72
+ from transformers import AutoTokenizer
73
+
74
+ from classone.modeling.modeling_classone import ClassOneModel
75
+ from classone.schemas import NoulQuestion, ChoiceQuestion, ScoreQuestion
76
+ from classone.tokenizer import ClassOnePromptBuilder
77
+
78
+ REPO_ID = "devops-thiago/classone-qwen3.5-4b"
79
+
80
+ # 1. Load the ClassOne model (weights + tokenizer are fully self-contained here)
81
+ tokenizer = AutoTokenizer.from_pretrained(REPO_ID)
82
+ builder = ClassOnePromptBuilder(tokenizer)
83
+ model = ClassOneModel.from_backbone(
84
+ base_model_name_or_path=REPO_ID,
85
+ tokenizer=tokenizer,
86
+ device="cuda",
87
+ torch_dtype=torch.float16,
88
+ )
89
+
90
+ # 2. Load the trained decision heads
91
+ heads = torch.load(hf_hub_download(REPO_ID, "classone_heads.pt"), map_location="cuda")
92
+ model.noul_head.load_state_dict(heads["noul_head"])
93
+ model.choice_head.load_state_dict(heads["choice_head"])
94
+ model.score_head.load_state_dict(heads["score_head"])
95
+ model.eval()
96
+
97
+ # 3. Pack state + questions and run a single forward pass
98
+ packed = builder.pack(
99
+ state={"customer": "Alex", "message": "I was charged twice for order #123."},
100
+ questions={
101
+ "refund": NoulQuestion(instructions="Is the user requesting a refund?"),
102
+ "dept": ChoiceQuestion(
103
+ instructions="Route to team:",
104
+ criteria={"billing": "Payment issues", "tech": "Technical bugs"}
105
+ ),
106
+ "anger": ScoreQuestion(
107
+ instructions="Dissatisfaction level:",
108
+ criteria=["satisfied", "neutral", "dissatisfied", "churning"]
109
+ ),
110
+ }
111
+ )
112
+ results = model.evaluate_packed(packed)
113
+
114
+ print("Refund P(true):", results["refund"].noul)
115
+ print("Department: ", results["dept"].choice, "β€”", results["dept"].probabilities)
116
+ print("Anger score: ", results["anger"].score)
117
+ ```
118
+
119
+ ## Repository Files
120
+
121
+ | File | Description |
122
+ |---|---|
123
+ | `model.safetensors` (sharded) | Merged ClassOne backbone weights |
124
+ | `config.json` | Model configuration |
125
+ | `tokenizer.json`, `tokenizer_config.json` | Tokenizer, including ClassOne delimiter tokens |
126
+ | `classone_heads.pt` | Trained Noul / Choice / Score head weights + calibrated temperatures |
127
+ | `lora_backbone/` | LoRA adapter (r=16, Ξ±=32) that produced the merged weights |
128
+
129
+ ## Citation
130
+
131
+ ```bibtex
132
+ @misc{classone2026,
133
+ title={ClassOne: A Fast Single-Pass Decision Architecture for Language Models},
134
+ author={Thiago Gonzaga},
135
+ year={2026},
136
+ url={https://github.com/devops-thiago/class-one},
137
+ }
138
+ ```
139
+
140
+ ## Attribution & Legal
141
+
142
+ - Derived from [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) (Google) β€” Apache License 2.0
143
+ - Architecture & training code: [devops-thiago/class-one](https://github.com/devops-thiago/class-one) β€” Apache 2.0