AbdallahDev commited on
Commit
0cc0b30
·
0 Parent(s):

OpenDecision-Large-Packed 0.1.0

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: opendecision
6
+ pipeline_tag: zero-shot-classification
7
+ base_model: microsoft/deberta-v3-large
8
+ tags:
9
+ - decision
10
+ - text-classification
11
+ - intent-classification
12
+ - routing
13
+ - zero-shot-classification
14
+ - multi-label
15
+ - deberta-v3
16
+ datasets:
17
+ - fastino/fast-decisions
18
+ - stanfordnlp/snli
19
+ - fancyzhx/dbpedia_14
20
+ - mteb/banking77
21
+ ---
22
+
23
+ # OpenDecision-Large-Packed
24
+
25
+ 📄 Technical report: [*OpenDecision: Fast Schema-Conditioned Decisions with Packed Candidate Encoding*](https://github.com/tokz-labs/OpenDecision/releases/latest/download/OpenDecision.pdf) (PDF; arXiv version coming soon) · [Code](https://github.com/tokz-labs/OpenDecision)
26
+
27
+ OpenDecision-Large-Packed is the low-cost variant of
28
+ [OpenDecision-Large](https://huggingface.co/Tokz-labs/OpenDecision-Large): the same
29
+ 433.9M-parameter DeBERTa-v3-large decision model, using a **packed candidate
30
+ encoder** that scores up to 16 options in one forward pass. The input text is encoded once
31
+ per pack; attention masks and per-sequence relative positions give every option the same
32
+ view it would have alone, so answers do not depend on option order.
33
+
34
+ ## Usage
35
+
36
+ ```bash
37
+ pip install "opendecision @ git+https://github.com/tokz-labs/OpenDecision"
38
+ ```
39
+
40
+ ```python
41
+ from opendecision import OpenDecision, Choice, Bool, MultiLabel
42
+
43
+ model = OpenDecision.from_pretrained("Tokz-labs/OpenDecision-Large-Packed")
44
+ out = model.decide(
45
+ "I was charged twice for my May invoice and the app keeps logging me out.",
46
+ {
47
+ "queue": Choice(["billing", "technical", "account", "sales"]),
48
+ "tags": MultiLabel(["double_charge", "login_issue", "refund_request", "outage"]),
49
+ "urgent": Bool(),
50
+ },
51
+ )
52
+ print(out["queue"].best, out["tags"].selected, out["urgent"].policy)
53
+ ```
54
+
55
+ ## Efficiency
56
+
57
+ GPU-seconds per 1,000 decisions on the complete classification-suite test sets, one NVIDIA L4:
58
+
59
+ | Model | All five tasks | Without CLINC150 (151 options) | $ / 1k decisions (L4 list price) |
60
+ |---|---|---|---|
61
+ | **OpenDecision-Large-Packed** | 69.1 | **34.8** | 0.0153 |
62
+ | OpenDecision-Large (cross-encoder) | 77.4 | 58.9 | 0.0172 |
63
+ | Laya | 43.5 | 41.2 | 0.0097 |
64
+ | JevK5 v0.3 (4B) | 267.4 | 119.9 | 0.0594 |
65
+ | SemIf (4B) | 275.0 | 130.4 | 0.0611 |
66
+
67
+ Packing pays off for questions with up to ~16 options; with many more (CLINC150's 151 intents) the
68
+ cross-encoder is faster. Batch-size-1 latency (L4, bf16, p50): 66 ms for a short
69
+ text with 10 options; 69 ms for a 512-token text with 10 options
70
+ (cross-encoder: 248 ms).
71
+
72
+ ## Benchmarks
73
+
74
+ Classification suite, complete test sets, macro-F1 (open models, identical inputs; GLiNER2.5 with its
75
+ best interface per dataset):
76
+
77
+ | Model | AG News | CLINC150 | IMDb | Rotten Tomatoes | XNLI | Average |
78
+ |---|---|---|---|---|---|---|
79
+ | OpenDecision-Large | 87.37 | 76.38 | 94.84 | 92.03 | 88.93* | 87.91 |
80
+ | **OpenDecision-Large-Packed** | 86.70 | 75.95 | 94.59 | 89.96 | 88.97* | 87.23 |
81
+ | SemIf (Qwen3.5-4B, 4B) | 87.28 | 78.22 | 95.27 | 88.46 | 82.36 | 86.32 |
82
+ | JevK5 v0.3 (4B) | 85.45 | 79.86 | 95.06 | 87.60 | 83.40 | 86.27 |
83
+ | Laya (421M) | 92.42 | 47.57 | 92.16 | 87.99 | 87.22 | 81.47 |
84
+ | GLiFormer large-v1 (576M) | 82.88 | 59.49 | 94.19 | 84.06 | 82.03 | 80.53 |
85
+ | GLiNER2.5-Decide (340M) | 71.37 | 66.19 | 90.02 | 85.83 | 47.65 | 72.21 |
86
+
87
+ \* NLI data is in the training data: XNLI is not zero-shot.
88
+
89
+ On label sets that no training data targeted, averaged over TREC question types, Emotion and
90
+ Subjectivity, it scores 55.64 macro-F1 (OpenDecision-Large 57.00,
91
+ Laya 62.11, SemIf 64.29, JevK5 72.07); its final training
92
+ stage, which adds 15,942 LLM-invented classification tasks with these task families excluded,
93
+ raised this from 45.70. GoEmotions multi-label exact match is low
94
+ (13.30; the model selects too many labels). For a new kind of decision, fine-tune on a
95
+ few hundred labeled examples (`python -m opendecision.cli.train`).
96
+
97
+ ## Training data
98
+
99
+ Two stages from DeBERTa-v3-large (the packed stage starts from the clean cross-encoder) on LLM-generated decisions and LLM-invented classification tasks (OpenAI models), the Fast Decisions
100
+ public development split, MultiNLI, WANLI and samples of DBpedia-14, BANKING77, SNLI, WikiText-103 and
101
+ 20 Newsgroups (Mitchell 1997, CC BY 4.0). Every source allows commercial use under its license; sources
102
+ and licenses are listed in the technical report.
103
+
104
+ ## Scope and limitations
105
+
106
+ English only; inputs up to 512 tokens; options truncated to 48 tokens. Not a chat or
107
+ reasoning model. The benchmarks above were also used to select training mixtures. Most
108
+ training text was generated or labeled by OpenAI models.
109
+
110
+ ## Citation
111
+
112
+ ```bibtex
113
+ @misc{alwarawreh2026opendecision,
114
+ title = {OpenDecision: Fast Schema-Conditioned Decisions with Packed Candidate Encoding},
115
+ author = {Alwarawreh, Abdallah},
116
+ year = {2026},
117
+ note = {Tokz Labs technical report},
118
+ url = {https://github.com/tokz-labs/OpenDecision/releases/latest/download/OpenDecision.pdf}
119
+ }
120
+ ```
backbone_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "attention_probs_dropout_prob": 0.1,
3
+ "hidden_act": "gelu",
4
+ "hidden_dropout_prob": 0.1,
5
+ "hidden_size": 1024,
6
+ "initializer_range": 0.02,
7
+ "intermediate_size": 4096,
8
+ "layer_norm_eps": 1e-07,
9
+ "legacy": true,
10
+ "max_position_embeddings": 512,
11
+ "max_relative_positions": -1,
12
+ "model_type": "deberta-v2",
13
+ "norm_rel_ebd": "layer_norm",
14
+ "num_attention_heads": 16,
15
+ "num_hidden_layers": 24,
16
+ "pad_token_id": 0,
17
+ "pooler_dropout": 0,
18
+ "pooler_hidden_act": "gelu",
19
+ "pooler_hidden_size": 1024,
20
+ "pos_att_type": [
21
+ "p2c",
22
+ "c2p"
23
+ ],
24
+ "position_biased_input": false,
25
+ "position_buckets": 256,
26
+ "relative_attention": true,
27
+ "share_att_key": true,
28
+ "transformers_version": "4.57.6",
29
+ "type_vocab_size": 0,
30
+ "vocab_size": 128003
31
+ }
config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "packed",
3
+ "backbone": "microsoft/deberta-v3-large",
4
+ "max_state_tokens": 512,
5
+ "max_candidate_tokens": 48,
6
+ "max_header_tokens": 20,
7
+ "cross_candidate_tokens": 32,
8
+ "row_chunk_size": 128,
9
+ "pack_size": 16,
10
+ "pack_candidate_tokens": 3072,
11
+ "pack_cell_budget": 6000000
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7612f6e57031dd0a25fb3f18c95f91a6a1638624d84e7e900cf8025bfa514a1f
3
+ size 1735709104
tokenizer/added_tokens.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "[CAND]": 128002,
3
+ "[DEC]": 128001,
4
+ "[MASK]": 128000
5
+ }
tokenizer/special_tokens_map.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "[DEC]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ {
11
+ "content": "[CAND]",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ }
17
+ ],
18
+ "bos_token": "[CLS]",
19
+ "cls_token": "[CLS]",
20
+ "eos_token": "[SEP]",
21
+ "mask_token": "[MASK]",
22
+ "pad_token": "[PAD]",
23
+ "sep_token": "[SEP]",
24
+ "unk_token": {
25
+ "content": "[UNK]",
26
+ "lstrip": false,
27
+ "normalized": true,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ }
31
+ }
tokenizer/spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[CLS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": true,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128000": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "128001": {
44
+ "content": "[DEC]",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "128002": {
52
+ "content": "[CAND]",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ }
59
+ },
60
+ "additional_special_tokens": [
61
+ "[DEC]",
62
+ "[CAND]"
63
+ ],
64
+ "bos_token": "[CLS]",
65
+ "clean_up_tokenization_spaces": false,
66
+ "cls_token": "[CLS]",
67
+ "do_lower_case": false,
68
+ "eos_token": "[SEP]",
69
+ "extra_special_tokens": {},
70
+ "mask_token": "[MASK]",
71
+ "model_max_length": 1000000000000000019884624838656,
72
+ "pad_token": "[PAD]",
73
+ "sep_token": "[SEP]",
74
+ "sp_model_kwargs": {},
75
+ "split_by_punct": false,
76
+ "tokenizer_class": "DebertaV2Tokenizer",
77
+ "unk_token": "[UNK]",
78
+ "vocab_type": "spm"
79
+ }