Instructions to use MSGEncrypted/ocf-typed-decisions-mbert-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MSGEncrypted/ocf-typed-decisions-mbert-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="MSGEncrypted/ocf-typed-decisions-mbert-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MSGEncrypted/ocf-typed-decisions-mbert-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
OCF typed-decisions CE smoke
Browse files- README.md +103 -0
- config.json +17 -0
- model.pt +3 -0
- recipe.json +27 -0
- temperatures.json +5 -0
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- text-classification
|
| 6 |
+
- system-1
|
| 7 |
+
- typed-decisions
|
| 8 |
+
- modernbert
|
| 9 |
+
- ocf
|
| 10 |
+
datasets:
|
| 11 |
+
- LocalLLaMA/typed-decisions
|
| 12 |
+
base_model: answerdotai/ModernBERT-base
|
| 13 |
+
pipeline_tag: text-classification
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# OCF typed-decisions CE smoke (ModernBERT-base)
|
| 17 |
+
|
| 18 |
+
**Not a foundation classifier. Not RLCD. No Jev comparison.**
|
| 19 |
+
|
| 20 |
+
Open Classification Foundation (OCF) **specialist smoke**: non-autoregressive System-1
|
| 21 |
+
decision head on [`answerdotai/ModernBERT-base`](https://huggingface.co/answerdotai/ModernBERT-base),
|
| 22 |
+
fine-tuned with **cross-entropy** on `LocalLLaMA/typed-decisions` train, temperature-calibrated
|
| 23 |
+
on a held-out **train** slice (`cal_frac=0.1`).
|
| 24 |
+
|
| 25 |
+
## Architecture
|
| 26 |
+
|
| 27 |
+
```text
|
| 28 |
+
ModernBERT-base (bidirectional)
|
| 29 |
+
+ 2-layer decision Transformer head
|
| 30 |
+
+ OptionScorer at each option [MASK]
|
| 31 |
+
→ softmax(/T) over options
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
| Knob | Value |
|
| 35 |
+
| --- | --- |
|
| 36 |
+
| Params | ~164M |
|
| 37 |
+
| `max_len` | 640 |
|
| 38 |
+
| Option token budget | 48 / option |
|
| 39 |
+
| Primitives | `choice` / `score` / `noul` |
|
| 40 |
+
|
| 41 |
+
## Training
|
| 42 |
+
|
| 43 |
+
| Field | Value |
|
| 44 |
+
| --- | --- |
|
| 45 |
+
| Objective | CE on teacher-argmax labels (soft teachers in dataset) |
|
| 46 |
+
| Epochs / eff. batch | 4 / 8 |
|
| 47 |
+
| LR encoder / head | 2.5e-5 / 1e-4 |
|
| 48 |
+
| Seed (this upload) | **1** (best of 0/1/2; mean acc 0.731, SD 0.028) |
|
| 49 |
+
| Temperatures (shipped) | choice 1.5 · score 1.25 · noul 1.5 |
|
| 50 |
+
|
| 51 |
+
## Evaluation (`LocalLLaMA/typed-decisions` test, 2,000 decisions)
|
| 52 |
+
|
| 53 |
+
| Arm | acc | NLL | ECE as-run | ECE after equal crossfit |
|
| 54 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 55 |
+
| Laya typed-decisions (reference) | 0.767 | 0.707 | 0.214 | 0.021 |
|
| 56 |
+
| **This checkpoint (s1)** | **0.751** | **0.629** | 0.044 | 0.030 |
|
| 57 |
+
| OCF stub (prior, ~8M) | ≈0.61 | ≈0.90 | ≈0.04 | — |
|
| 58 |
+
|
| 59 |
+
Latency (warm, RTX 3050 Laptop): **p50 59.6 ms / p95 87.8 ms** per question (n=200).
|
| 60 |
+
Not a cross-vendor claim.
|
| 61 |
+
|
| 62 |
+
Full board: see source-repo snapshot `results-snapshot-2026-09-28-ocf-typed-decisions-mbert.md`.
|
| 63 |
+
|
| 64 |
+
## Files
|
| 65 |
+
|
| 66 |
+
- `config.json` — `ClassifierConfig` (includes temperatures)
|
| 67 |
+
- `temperatures.json` — fitted per-type T
|
| 68 |
+
- `model.pt` — full `ClassifierBundle` state_dict
|
| 69 |
+
- `recipe.json` — train hyperparams + acc
|
| 70 |
+
|
| 71 |
+
## How to run
|
| 72 |
+
|
| 73 |
+
Requires the OCF stack from the source repository (`packages.classify` + `models_ai.classify`):
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from classify import load
|
| 77 |
+
|
| 78 |
+
agent = load("path/to/this/repo") # config.json + model.pt + temperatures.json
|
| 79 |
+
out = agent.predict(
|
| 80 |
+
{"subject": "Refund", "body": "Billed twice"},
|
| 81 |
+
{
|
| 82 |
+
"department": {
|
| 83 |
+
"type": "choice",
|
| 84 |
+
"instructions": "Which department?",
|
| 85 |
+
"criteria": {"billing": "invoices", "tech": "bugs", "other": "else"},
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Not a drop-in for the external `laya` package.
|
| 92 |
+
|
| 93 |
+
## Concurrent baseline
|
| 94 |
+
|
| 95 |
+
[Laya](https://huggingface.co/convaiinnovations/laya) — open System-1 concurrent (ModernBERT-large).
|
| 96 |
+
Matched estimand only; not a dependency.
|
| 97 |
+
|
| 98 |
+
## Non-claims
|
| 99 |
+
|
| 100 |
+
- Not a foundation / zero-shot System-1 model
|
| 101 |
+
- Not RLCD-trained
|
| 102 |
+
- Does not claim to beat TypeSafe Jev or Laya
|
| 103 |
+
- Soft teacher labels; teachers disagree on ~41% of test decisions
|
config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"vocab_size": 4096,
|
| 3 |
+
"d_model": 128,
|
| 4 |
+
"n_heads": 4,
|
| 5 |
+
"n_layers": 2,
|
| 6 |
+
"head_layers": 2,
|
| 7 |
+
"max_len": 640,
|
| 8 |
+
"dropout": 0.1,
|
| 9 |
+
"temperatures": {
|
| 10 |
+
"choice": 1.5,
|
| 11 |
+
"score": 1.25,
|
| 12 |
+
"noul": 1.5
|
| 13 |
+
},
|
| 14 |
+
"backbone": "answerdotai/ModernBERT-base",
|
| 15 |
+
"head_heads": 0,
|
| 16 |
+
"gradient_checkpointing": true
|
| 17 |
+
}
|
model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8455d5f88af89d8b4ff136fd52fff28cce6eeabb859eab0491a1c07637947dbb
|
| 3 |
+
size 655191779
|
recipe.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"seed": 1,
|
| 3 |
+
"preset": "modernbert-base-4gb",
|
| 4 |
+
"hp": {
|
| 5 |
+
"backbone": "answerdotai/ModernBERT-base",
|
| 6 |
+
"tag": "mbert-base",
|
| 7 |
+
"steps": 0,
|
| 8 |
+
"epochs": 4,
|
| 9 |
+
"micro_batch": 4,
|
| 10 |
+
"grad_accum": 2,
|
| 11 |
+
"lr_head": 0.0001,
|
| 12 |
+
"lr_encoder": 2.5e-05,
|
| 13 |
+
"schedule": "linear",
|
| 14 |
+
"max_len": 640,
|
| 15 |
+
"head_layers": 2,
|
| 16 |
+
"bf16": true,
|
| 17 |
+
"grad_ckpt": true,
|
| 18 |
+
"adam8": true
|
| 19 |
+
},
|
| 20 |
+
"opt_steps": 2700,
|
| 21 |
+
"cal_frac": 0.1,
|
| 22 |
+
"n_params": 163782913,
|
| 23 |
+
"train_seconds": 2339,
|
| 24 |
+
"peak_gib": 2.13,
|
| 25 |
+
"device": "cuda",
|
| 26 |
+
"acc": 0.7515
|
| 27 |
+
}
|
temperatures.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"choice": 1.5,
|
| 3 |
+
"score": 1.25,
|
| 4 |
+
"noul": 1.5
|
| 5 |
+
}
|