CoolFace
Modelpublic

mghafiri/qwen3.5-0.8B-decision-model

sourceHugging Faceapache-2.0updated 4d agoView on Hugging Face
1likes49downloads
Model Card

qwen3.5-0.8B-decision-model

A decision model fine-tuned from Qwen/Qwen3.5-0.8B-Base. It answers typed questions about a state and returns calibrated probability distributions, not generated text:

typequestionanswer
Choicepick one option from a set you definechoice, probabilities, confidence
Scorepick a position on ordered levels you describescore (= Σ i·pᵢ), legend, probabilities, confidence
Noulyes/nonoul = P(yes)

The interface follows the publicly documented request/response shape of TypeSafe's System One API (docs). This is an independent open model. It is not affiliated with or endorsed by TypeSafe, and it is not Jev.

Head to head: TypeSafe Jev vs this model on unseen scenarios

We sent the same 150 held-out scenarios (714 questions) to both models, as identical POST /v1/systemone requests. None of these scenarios was used to train, select or calibrate this model.

  • —Jev: jev-1.13.0 through TypeSafe's hosted API.
  • —This model (0.8B parameters): ran locally on a MacBook Pro (Apple M2 Max, 64 GB), not on a GPU server.
TypeSafe Jev (`jev-1.13.0`)this model (0.8B, MacBook Pro (Apple M2 Max, 64 GB))
Accuracy (top answer = label's top answer)93.1%81.1%
Accuracy: Choice / Noul / Score93.9% / 94.1% / 90.3%81.2% / 81.6% / 80.0%
Brier (lower is better)0.0420.158
Log-loss vs the soft labels (lower is better)¹0.9570.615
Calibration error, ECE: Choice / Noul / Score¹0.088 / 0.018 / 0.1180.037 / 0.026 / 0.059
Choice answers with confidence ≥ 0.7: share automated, accuracy91% at 97%55% at 93%
Choice answers with confidence ≥ 0.9: share automated, accuracy83% at 100%4% at 100%
Latency per request, p50 / p951.3 s / 2.3 s (hosted API, incl. network)1.7 s / 5.2 s (local, no network)
Cost for the whole test set$0.005 (128k input tokens)$0, offline, on your own machine

What this means:

  • —Head to head: on questions where only one model was right, Jev was right 103 times and this model 17. The two models agree on 82.5% of top answers.
  • —Jev is the stronger model on accuracy, Brier and confidence-gated automation.
  • —This model is a small open alternative that runs fully offline. On a GPU it answers in about 50 ms per request (see the evaluation section below).
  • —This model is under-confident. Its average top probability is 0.75, while the labels average 0.87, so it automates fewer decisions at high confidence thresholds.
  • —¹ Read log-loss and ECE with care. The labels are soft probabilities written with this project's rubric, and this model was trained on the same labelling style. Jev often answers with near-certainty (42% of its top probabilities are ≥ 0.99), which log-loss penalises whenever the labels spread some probability to other options. Accuracy and Brier are the fairer comparison.

The comparison script and a guide to reproduce it with your own TypeSafe API key are in the project repository (scripts/compare_jev.py, docs/compare_jev.md).

How it works

  • —Logit readout. Each question is rendered after the state and ends in Answer:. The probabilities are a softmax of the next-token logits restricted to single-token labels: A… Z/ a… z for options and levels, and yes/ no for Noul. Every answer is a valid distribution over exactly the options you declared, from one forward pass per question, with no JSON parsing.
  • —Confidence is (K·p_max − 1)/(K − 1), the definition published at docs.typesafe.ai/confidence.
  • —Training objective (RLCD-inspired). Because the output is a distribution, the expected log-score reward equals negative cross-entropy. We therefore minimise CE(target, p) + 0.5·Brier(target, p), two strictly proper scoring rules, against soft expert-agreement targets. TypeSafe has not published RLCD's actual objective, so this is an approximation, not a reproduction.
  • —Post-hoc temperature per primitive, fitted on the validation set: choice T=1.3, noul T=1.5, score T=1.2. It is stored in calibration.json and applied by the bundled jevlite package.

Usage

python
from huggingface_hub import snapshot_download
import sys

path = snapshot_download("mghafiri/qwen3.5-0.8B-decision-model")
sys.path.insert(0, path)              # bundled jevlite/ package
from jevlite.model import SystemOne

engine = SystemOne(path)              # applies calibration.json automatically
print(engine.system_one(
    state="Help! My payouts have been failing for 3 days.",
    questions={
        "is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"},
        "department": {"type": "choice", "instructions": "Which team should handle this?",
                        "criteria": {"billing": "Payments, invoicing, refunds",
                                      "technical": "Bugs, outages, integrations",
                                      "sales": "Pricing, upgrades, new accounts"}},
        "frustration": {"type": "score", "instructions": "How frustrated is the customer?",
                         "criteria": ["Calm", "Frustrated", "Very angry"]},
    },
))

Training data

The dataset has 2000 synthetic English scenarios (9716 questions), each a state plus 3–6 independent questions. It covers 32 domains: agenttoolrouting, airlinetravelops, amlkyccompliance, appmarketplacepolicy, bankingfintech, citationverification, clinicalliteraturescreening, customersupport, cybersecuritysoc, ecommerce, educationadmissions, energyutilities, entitymatching, governmentservices, healthcareadmin, hrrecruiting, insuranceclaims, ithelpdesk, legalcompliance, llmguardrails, logisticssalescrm, manufacturingqa, newsclaimverification, payrollbenefits, procurementvendorrisk, propertymanagement, ragpassagerelevance, smarthomeiot, softwareengineering, spanselectionextraction, telecomsupport, trustsafety_moderation.

  • —Question mix: noul 41%, choice 37%, score 22%.
  • —Difficulty mix: clear 39%, moderate 31%, borderline 16%, insufficient 9%, adversarial 6%.
  • —How targets were made: Claude authored them as the fraction of careful experts who would pick each option. A blind second annotator relabelled every question without seeing the originals.
  • —Agreement on the top answer: 9434/9718 = 97.1%.
  • —Where the two agreed, the target is 0.6·author + 0.4·reviewer.
  • —Borderline disagreements were averaged 50/50.
  • —The remaining disagreements were adjudicated one by one.
  • —Splits by scenario: train 1700 / val 150 / test 150.

Training

  • —Full fine-tune with frozen token embeddings, fp32 weights and bf16 autocast.
  • —AdamW, lr 1e-5, cosine schedule. Option-order shuffles were used as augmentation.
  • —Epochs run: 10 of 10 requested (completed all epochs), with 2720 optimizer steps in 48 min.
  • —The published weights are the checkpoint with the lowest validation cross-entropy: epoch 9.
epochtrain CEval CEval Brierval acc
0–0.9660.3750.562
10.7770.7430.2270.738
20.5780.7140.2110.762
30.4830.7370.2100.783
40.4570.6580.1800.786
50.4230.6690.1770.797
60.4040.6730.1740.808
70.3900.6620.1740.797
80.3810.6640.1710.803
9 (best, published)0.3760.6520.1660.803
100.3740.6570.1680.801

Evaluation (held-out test split)

Accuracy compares the predicted argmax with the target argmax. Log-loss and Brier are measured against the soft targets. ECE uses 10 bins over the top-option probability (P(yes) for Noul).

modeltypenacclog-lossBrierECEconf≥0.7 coverage / acc
base Qwen3.5-0.8B-Basechoice2610.5591.1130.4060.0770.09 / 0.92
base Qwen3.5-0.8B-Basenoul2880.5520.7230.3620.165–
base Qwen3.5-0.8B-Basescore1650.4791.1880.3990.1170.15 / 0.71
this modelchoice2610.8080.7020.1910.0340.55 / 0.93
this modelnoul2880.8120.4680.1410.028–
this modelscore1650.8000.7340.1340.0640.30 / 0.96
modeloption-permutation TVD (choice)score MAElatency p50 / p95 (ms, 1 request)
base Qwen3.5-0.8B-Base0.20100.56253 / 729
this model0.05740.25552 / 87

Limitations

  • —The targets are expert-agreement estimates written by an LLM, not real-world outcomes. Calibration here means calibration to those targets. Validate on your own labelled data before automating decisions.
  • —The test set is small (about 714 questions), so ECE is noisy.
  • —The model is English-only and text-only.
  • —Keep arithmetic, counting and date comparison in code. Ask atomic, literal questions.
  • —Use confidence to route uncertain cases to a human or a larger model.