spectral-arbiter 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spectral_arbiter-1.0.0/LICENSE +190 -0
- spectral_arbiter-1.0.0/PKG-INFO +433 -0
- spectral_arbiter-1.0.0/README.md +405 -0
- spectral_arbiter-1.0.0/arbiter/__init__.py +10 -0
- spectral_arbiter-1.0.0/arbiter/configuration_arbiter.py +57 -0
- spectral_arbiter-1.0.0/arbiter/modeling_arbiter.py +636 -0
- spectral_arbiter-1.0.0/pyproject.toml +42 -0
- spectral_arbiter-1.0.0/setup.cfg +4 -0
- spectral_arbiter-1.0.0/spectral_arbiter.egg-info/PKG-INFO +433 -0
- spectral_arbiter-1.0.0/spectral_arbiter.egg-info/SOURCES.txt +17 -0
- spectral_arbiter-1.0.0/spectral_arbiter.egg-info/dependency_links.txt +1 -0
- spectral_arbiter-1.0.0/spectral_arbiter.egg-info/requires.txt +20 -0
- spectral_arbiter-1.0.0/spectral_arbiter.egg-info/top_level.txt +1 -0
- spectral_arbiter-1.0.0/tests/test_arbiter_inference.py +236 -0
- spectral_arbiter-1.0.0/tests/test_arbiter_parity.py +327 -0
- spectral_arbiter-1.0.0/tests/test_batch_inference.py +140 -0
- spectral_arbiter-1.0.0/tests/test_build_80k.py +73 -0
- spectral_arbiter-1.0.0/tests/test_finetuning.py +123 -0
- spectral_arbiter-1.0.0/tests/test_selection.py +36 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Seif Attoui and contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spectral-arbiter
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: ARBITER: Attentive Relational Bidirectional Impartial Typed Encoder for Reasoning
|
|
5
|
+
Author: Ichrak Mokhtari, Seif Attoui
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: torch>=2.0.0
|
|
11
|
+
Requires-Dist: transformers>=5.19.0
|
|
12
|
+
Requires-Dist: safetensors>=0.4.0
|
|
13
|
+
Provides-Extra: finetuning
|
|
14
|
+
Requires-Dist: datasets>=3.0.0; extra == "finetuning"
|
|
15
|
+
Requires-Dist: tensorboard>=2.15.0; extra == "finetuning"
|
|
16
|
+
Requires-Dist: nbformat>=5.9.0; extra == "finetuning"
|
|
17
|
+
Requires-Dist: jupyterlab>=4.0.0; extra == "finetuning"
|
|
18
|
+
Provides-Extra: benchmark
|
|
19
|
+
Requires-Dist: scipy>=1.10.0; extra == "benchmark"
|
|
20
|
+
Requires-Dist: numpy>=1.24.0; extra == "benchmark"
|
|
21
|
+
Requires-Dist: sentence-transformers>=3.0.0; extra == "benchmark"
|
|
22
|
+
Requires-Dist: datasets>=3.0.0; extra == "benchmark"
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
25
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
26
|
+
Requires-Dist: nbformat>=5.9; extra == "dev"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# ARBITER: Attentive Relational Bidirectional Impartial Typed Encoder for Reasoning
|
|
30
|
+
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
[](https://ai.google.dev/gemma/terms)
|
|
33
|
+
[](#)
|
|
34
|
+
[-purple.svg)](#)
|
|
35
|
+
|
|
36
|
+
**ARBITER** is a compact encoder by **Spectral AI Lab** (*Where intelligence emerges*), designed for **decision-making, routing, and relational structured reasoning** in autonomous AI agents and enterprise production systems.
|
|
37
|
+
|
|
38
|
+
Built upon the **ARBITER** relational architecture (Inter-Candidate Set-Attention & Dynamic HyperFiLM Modulation), ARBITER jointly encodes context, instructions, and candidate options, allowing competing choices to attend to one another rather than being evaluated in isolation.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Key Features
|
|
43
|
+
|
|
44
|
+
* **Set-Attention Over Candidates**: Candidates attend to each other via a multi-head self-attention mechanism before decision projection, enabling relational ranking and order robustness.
|
|
45
|
+
* **Dynamic Context & Task HyperFiLM**: Affine modulation conditioned on context embeddings and task type embeddings (`choice`, `noul`, `score`).
|
|
46
|
+
* **Multi-Format Native Inference**:
|
|
47
|
+
* **`choice`**: Polytomous classification and categorical routing.
|
|
48
|
+
* **`noul`**: Strict boolean factuality and claim verification.
|
|
49
|
+
* **`score`**: Ordinal regression grading and severity scoring.
|
|
50
|
+
* **Order & Permutation Robustness**: 82.8% decision consistency across candidate permutations, reducing position-0 bias to 22.6% (compared to 56.6% in standard pointwise classifiers).
|
|
51
|
+
* **High Efficiency & Compactness**: Native **BF16 export of 544 MB** (`model.safetensors`), peak allocated VRAM of **759 MiB** (1,562 MiB reserved), median GPU latency of **15.36 ms** (RTX 5090).
|
|
52
|
+
* **Autonomous Loading**: Self-contained weights and tokenizer; no external Hugging Face downloads required at runtime.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
From PyPI:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install spectral-arbiter
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or from source for development:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
git clone https://github.com/spectral-ai-lab/arbiter.git
|
|
68
|
+
cd arbiter
|
|
69
|
+
python3.11 -m venv .venv
|
|
70
|
+
source .venv/bin/activate
|
|
71
|
+
python -m pip install --upgrade pip
|
|
72
|
+
python -m pip install -e .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Requires Python >=3.11, PyTorch >=2.0, Transformers >=5.19 and safetensors >=0.4.
|
|
76
|
+
The tested environment is recorded in [development instructions](CONTRIBUTING.md).
|
|
77
|
+
Install a CUDA-enabled PyTorch build to use a GPU; the first example also runs on CPU.
|
|
78
|
+
|
|
79
|
+
### Obtain the weights
|
|
80
|
+
|
|
81
|
+
Git contains the code, configuration and tokenizer, **not the model weights**.
|
|
82
|
+
Place the complete release package in `checkpoints/arbiter-272m/` before running
|
|
83
|
+
local examples. It must contain `model.safetensors`, `config.json`, `tokenizer.json`
|
|
84
|
+
and `tokenizer_config.json` from the same release.
|
|
85
|
+
|
|
86
|
+
Once you have access to the HF release, download it using its exact commit:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
hf download spectral-ai-lab/arbiter-272m --revision <release-commit> --local-dir checkpoints/arbiter-272m
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Replace `<release-commit>` with the published release SHA. This repository does not
|
|
93
|
+
yet record an accessible public release revision; a private repository requires
|
|
94
|
+
`hf auth login` and access. A 404 can mean unavailable or unauthorized weights.
|
|
95
|
+
After downloading the complete package, local inference requires no network access.
|
|
96
|
+
The library wheel contains inference only; fine-tuning and benchmark commands below
|
|
97
|
+
run from this Git checkout.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Quickstart
|
|
102
|
+
|
|
103
|
+
### 1. High-Level Decision (`model.decide`)
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from arbiter import ArbiterModel
|
|
107
|
+
|
|
108
|
+
# Load the official 272M model in native BF16 from the local checkpoint
|
|
109
|
+
model = ArbiterModel.from_pretrained("checkpoints/arbiter-272m", device="cpu", local_files_only=True)
|
|
110
|
+
|
|
111
|
+
# Route a customer support ticket to the appropriate service
|
|
112
|
+
result = model.decide(
|
|
113
|
+
context="My package was marked as delivered yesterday, but I never received it. The courier is unresponsive.",
|
|
114
|
+
instruction="Which customer support team must handle this claim?",
|
|
115
|
+
criteria={
|
|
116
|
+
"delivery": "Lost parcel investigation and courier disputes",
|
|
117
|
+
"billing": "Payment errors, refunds, and invoice questions",
|
|
118
|
+
"technical": "Mobile application login or website bugs"
|
|
119
|
+
},
|
|
120
|
+
question_type="choice"
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
print("Selected Department :", result["selected_key"])
|
|
124
|
+
print("Confidence :", f"{result['confidence']:.2%}")
|
|
125
|
+
print("Class Probabilities :", result["probabilities"])
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2. Multi-Question Dictionary Interface (`model.predict`)
|
|
129
|
+
|
|
130
|
+
ARBITER natively integrates into agent loops and multi-step evaluation pipelines:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
results = model.predict(
|
|
134
|
+
state="Customer has been waiting 14 days for a replacement item under warranty.",
|
|
135
|
+
questions={
|
|
136
|
+
"intent": {
|
|
137
|
+
"instructions": "Identify the primary customer intent",
|
|
138
|
+
"type": "choice",
|
|
139
|
+
"criteria": {
|
|
140
|
+
"warranty_claim": "Warranty replacement request",
|
|
141
|
+
"general_inquiry": "General question"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"dissatisfied": {
|
|
145
|
+
"instructions": "Is the customer dissatisfied with the resolution time?",
|
|
146
|
+
"type": "noul"
|
|
147
|
+
},
|
|
148
|
+
"urgency": {
|
|
149
|
+
"instructions": "Rate urgency level on our incident scale",
|
|
150
|
+
"type": "score",
|
|
151
|
+
"criteria": ["P4 Low", "P3 Medium", "P2 High", "P1 Critical Outage"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
print(results["answers"])
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Workflows
|
|
162
|
+
|
|
163
|
+
- [Native batch inference](docs/batching.md): `decide_batch()` and `predict_batch()`.
|
|
164
|
+
- [Fine-tuning commands](finetuning/README.md): build data, validate, train, resume and evaluate.
|
|
165
|
+
- [Guided notebook](notebooks/finetuning_arbiter.ipynb): the same workflow, cell by cell.
|
|
166
|
+
- [Benchmark reproduction](benchmark/README.md): ARBITER and baseline comparisons.
|
|
167
|
+
- [Development and tests](CONTRIBUTING.md).
|
|
168
|
+
|
|
169
|
+
## Repository Structure
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
arbiter/ # Installable inference library
|
|
173
|
+
finetuning/ # Dataset builder, trainer, verifier and guided notebook
|
|
174
|
+
benchmark/ # Frozen requests, metrics and comparator adapters
|
|
175
|
+
hf_pipeline/ # Untrained EmbeddingGemma baseline, not the ARBITER loader
|
|
176
|
+
checkpoints/ # Local downloaded model packages (Git-ignored)
|
|
177
|
+
tests/ # Unit and real-weight integration tests
|
|
178
|
+
docs/ # Batching, data recipe and validation reports
|
|
179
|
+
examples/ # Runnable inference measurements
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Benchmark Results
|
|
183
|
+
|
|
184
|
+
ARBITER achieves the highest micro accuracy on both evaluated protocol aggregates,
|
|
185
|
+
with particularly strong intent routing and probability quality. Tables use a fixed
|
|
186
|
+
set of model variants throughout; **bold marks the best reported result in each row**
|
|
187
|
+
(including ties). Accuracy is in percent; ↓ means lower is better. These are local
|
|
188
|
+
protocol comparisons, not a claim of leadership on every task.
|
|
189
|
+
|
|
190
|
+
### Intent Routing & Classification
|
|
191
|
+
|
|
192
|
+
| Benchmark / metric | ARBITER | Laya | Laya Multilingual | Laya Typed | GLiNER Decide | GLiNER Multi | EmbeddingGemma |
|
|
193
|
+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
194
|
+
| MASSIVE Intent · 14 languages | **91.33%** | 33.95% | 46.69% | 34.43% | 42.29% | 49.52% | 73.79% |
|
|
195
|
+
| MASSIVE Scenario · 14 languages | **89.40%** | 30.10% | 44.74% | 28.43% | 36.98% | 45.26% | 58.07% |
|
|
196
|
+
| Banking77 · 77 intents | **87.34%** | 37.44% | 35.94% | 37.31% | 65.29% | 58.90% | 85.55% |
|
|
197
|
+
| TREC · question classification | **94.60%** | 88.20% | 90.40% | 85.40% | 32.60% | 36.20% | 47.40% |
|
|
198
|
+
| SST-2 · sentiment | 86.93% | **90.02%** | 84.98% | 89.79% | 87.96% | 78.78% | 83.26% |
|
|
199
|
+
|
|
200
|
+
### Typed Decisions & Natural Language Inference
|
|
201
|
+
|
|
202
|
+
| Benchmark / metric | ARBITER | Laya | Laya Multilingual | Laya Typed | GLiNER Decide | GLiNER Multi | EmbeddingGemma |
|
|
203
|
+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
204
|
+
| Typed Decisions | 65.50% | 36.20% | 35.25% | **76.75%** | 50.35% | 45.95% | 40.85% |
|
|
205
|
+
| XNLI · 15 languages | 68.87% | 54.38% | **73.82%** | 55.64% | 38.24% | 38.38% | 33.56% |
|
|
206
|
+
| Fast Decisions Single · micro | 43.35% | 52.96% | 46.77% | 54.92% | **64.42%** | 59.38% | 41.73% |
|
|
207
|
+
| Fast Decisions Single · macro | 43.97% | 53.80% | 46.66% | 55.66% | **66.30%** | 60.63% | 42.60% |
|
|
208
|
+
| Fast Decisions Multi · exact match | **4.67% (14/300)** | 2.33% (7/300) | 1.00% (3/300) | 3.67% (11/300) | 1.33% (4/300) | 4.00% (12/300) | 0.33% (1/300) |
|
|
209
|
+
| Fast Decisions Multi · micro F1 | 51.37% | 51.72% | 45.50% | **56.41%** | 51.74% | 48.41% | 31.22% |
|
|
210
|
+
|
|
211
|
+
### Overall Protocol Results
|
|
212
|
+
|
|
213
|
+
| Benchmark / metric | ARBITER | Laya | Laya Multilingual | Laya Typed | GLiNER Decide | GLiNER Multi | EmbeddingGemma |
|
|
214
|
+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
215
|
+
| Historical · micro accuracy | **74.47%** | 48.30% | 56.86% | 52.66% | 46.58% | 47.84% | 51.25% |
|
|
216
|
+
| Historical · suite macro accuracy | **77.03%** | 47.18% | 57.89% | 48.33% | 44.61% | 47.33% | 52.45% |
|
|
217
|
+
| Public · micro accuracy | **69.68%** | 53.92% | 51.18% | 52.25% | 62.86% | 57.85% | 59.87% |
|
|
218
|
+
|
|
219
|
+
Historical: 21,915 decisions across 60 suites. Public: 9,252 decisions across 23 suites.
|
|
220
|
+
Micro averages weight decisions equally; suite macro averages weight suites equally.
|
|
221
|
+
Language variants count as separate suites. These aggregates reflect this task mixture.
|
|
222
|
+
Column names are abbreviated: GLiNER refers to GLiNER2.5, Laya to ConvAI base,
|
|
223
|
+
and EmbeddingGemma to the EmbeddingGemma-2 baseline pipeline.
|
|
224
|
+
|
|
225
|
+
### Probability Quality
|
|
226
|
+
|
|
227
|
+
Measured on the same 21,915 historical decisions. GLiNER's reconstructed adapter
|
|
228
|
+
probabilities are reported separately below and do not enter this comparison.
|
|
229
|
+
|
|
230
|
+
| Benchmark / metric | ARBITER | Laya | Laya Multilingual | Laya Typed | GLiNER Decide | GLiNER Multi | EmbeddingGemma |
|
|
231
|
+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
232
|
+
| Brier score ↓ | **0.3395** | 0.7974 | 0.6788 | 0.6527 | — | — | 0.7106 |
|
|
233
|
+
| NLL ↓ | **0.6761** | 4.3655 | 2.3747 | 1.8325 | — | — | 1.5450 |
|
|
234
|
+
| Suite-weighted ECE · 15 bins ↓ | **0.0674** | 0.3214 | 0.2769 | 0.2166 | — | — | 0.2947 |
|
|
235
|
+
|
|
236
|
+
Brier is the mean squared error of probability vectors against one-hot targets;
|
|
237
|
+
NLL is mean negative log probability of the target. ECE is computed per suite with
|
|
238
|
+
15 bins, then weighted by suite size (it differs from pooled ECE). ARBITER has
|
|
239
|
+
**48% lower Brier and 63% lower NLL than Laya Typed** in this protocol.
|
|
240
|
+
ARBITER and Laya use their native decision probabilities; EmbeddingGemma uses
|
|
241
|
+
cosine-similarity softmax. Application thresholds require separate validation.
|
|
242
|
+
|
|
243
|
+
<details>
|
|
244
|
+
<summary>GLiNER adapter probability metrics</summary>
|
|
245
|
+
|
|
246
|
+
| Metric | GLiNER Decide | GLiNER Multi |
|
|
247
|
+
| :--- | ---: | ---: |
|
|
248
|
+
| Brier ↓ | 0.6611 | 0.6664 |
|
|
249
|
+
| NLL ↓ | 1.5762 | 1.5555 |
|
|
250
|
+
| Suite-weighted ECE ↓ | 0.1098 | 0.1379 |
|
|
251
|
+
|
|
252
|
+
These distributions are reconstructed by the benchmark adapter, not native
|
|
253
|
+
full-candidate GLiNER distributions. A dash above means excluded from the comparable
|
|
254
|
+
probability table, not that the model cannot produce confidence scores.
|
|
255
|
+
|
|
256
|
+
</details>
|
|
257
|
+
|
|
258
|
+
### Inference Efficiency
|
|
259
|
+
|
|
260
|
+
**Accuracy–memory trade-off:** ARBITER combines **74.47% historical micro accuracy**
|
|
261
|
+
with **759 MiB peak allocated GPU memory**, the lowest measured footprint among
|
|
262
|
+
these pipeline configurations. Its **15.36 ms median latency is 28% lower than the
|
|
263
|
+
EmbeddingGemma baseline** (21.36 ms). Compared with Laya Multilingual, it delivers
|
|
264
|
+
**+17.61 accuracy points with 53% less allocated GPU memory**, at higher median
|
|
265
|
+
latency (15.36 vs 9.44 ms). These comparisons apply to the evaluated task mixture
|
|
266
|
+
and loading formats below.
|
|
267
|
+
|
|
268
|
+
| Benchmark / metric | ARBITER | Laya | Laya Multilingual | Laya Typed | GLiNER Decide | GLiNER Multi | EmbeddingGemma |
|
|
269
|
+
| :--- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
270
|
+
| Median latency · ms ↓ | 15.36 ms | 12.07 ms | 9.44 ms | 11.91 ms | 15.32 ms | **7.97 ms** | 21.36 ms |
|
|
271
|
+
| Peak allocated VRAM · MiB ↓ | **759.0 MiB** | 2,415.8 MiB | 1,600.4 MiB | 2,438.6 MiB | 3,237.4 MiB | 3,823.4 MiB | 862.6 MiB |
|
|
272
|
+
|
|
273
|
+
Historical protocol, NVIDIA GeForce RTX 5090, single-request inference. ARBITER
|
|
274
|
+
and EmbeddingGemma use BF16; Laya variants use FP32; GLiNER uses its default loading
|
|
275
|
+
configuration. These are measured pipeline configurations, not equal-dtype kernel
|
|
276
|
+
comparisons. Latency includes each adapter's execution path. These measurements
|
|
277
|
+
predate the native batch API and do not measure batched throughput.
|
|
278
|
+
|
|
279
|
+
### Protocol Notes
|
|
280
|
+
|
|
281
|
+
- **MASSIVE Intent:** 20 candidates (correct intent plus 19 distractors), 4,200 test
|
|
282
|
+
decisions across 14 languages; this is not full 60-intent classification.
|
|
283
|
+
Scenario uses 18 candidates and 4,200 decisions across the same languages.
|
|
284
|
+
- **Banking77:** 3,080 test examples with all 77 intents. **TREC:** 500 test examples,
|
|
285
|
+
six coarse classes. **SST-2:** 872 validation examples.
|
|
286
|
+
- **XNLI:** 4,500 decisions across 15 languages. **Typed Decisions:** 2,000 decisions.
|
|
287
|
+
**Fast Single:** 2,600 decisions. **Fast Multi:** 300 multi-question cases;
|
|
288
|
+
exact match requires every decision in a case to be correct, whereas micro F1
|
|
289
|
+
measures the pooled binary decisions. Public micro accuracy counts those binary
|
|
290
|
+
decisions individually, not the 300 exact-match outcomes.
|
|
291
|
+
- **Supervision:** Banking77, TREC, SST-2 and MASSIVE training splits were included
|
|
292
|
+
in ARBITER's adaptation mixture. These results demonstrate supervised capability,
|
|
293
|
+
not zero-shot evaluation on unseen task families.
|
|
294
|
+
- **Adapters:** comparisons use the repository's model-specific adapters. GLiNER's
|
|
295
|
+
adapter classifies the state against labels without the separate instruction;
|
|
296
|
+
results characterize these evaluated pipelines. Failed cases remain in denominators.
|
|
297
|
+
- **Statistics:** bold denotes the highest observed score, not statistical significance.
|
|
298
|
+
Exploratory paired McNemar tests: TREC vs Laya Multilingual p=0.0019;
|
|
299
|
+
Banking77 vs EmbeddingGemma p=0.0068. These assume independent examples and are
|
|
300
|
+
unadjusted for multiple comparisons.
|
|
301
|
+
|
|
302
|
+
<details>
|
|
303
|
+
<summary>Additional reasoning and long-context evaluations</summary>
|
|
304
|
+
|
|
305
|
+
These auxiliary evaluations have a narrower comparator set than the main tables.
|
|
306
|
+
Tasksource Long is an existing project validation set, not a certified unseen-domain test.
|
|
307
|
+
|
|
308
|
+
| Evaluation Benchmark | Domain | Items | ARBITER-272M | Baseline Comparison | Note |
|
|
309
|
+
| :--- | :--- | :---: | :---: | :---: | :--- |
|
|
310
|
+
| **Tasksource Long** | Long context (up to 4,096 tokens) | 2,373 | **58.45%** | Laya-Typed 32.91% | Observed advantage on long-context criteria matching (+25.5 pts). |
|
|
311
|
+
| **ARC-Easy** | Elementary science reasoning | 2,376 | **48.48%** | Laya-Typed 48.48% | Tied with Laya-Typed (48.48%), outperforms Laya-Base (47.26%). |
|
|
312
|
+
| **ARC-Challenge** | Hard science reasoning | 1,172 | **33.79%** | Laya-Typed 31.57% | McNemar test p = 0.2180 (observed gain; not statistically significant). |
|
|
313
|
+
| **HellaSwag** | Common-sense inference | 1,000 | **41.80%** | Laya-Base 35.90% | Outperforms Laya-Base (+5.9 pts) and GLiNER (29.80%, +12.0 pts). |
|
|
314
|
+
|
|
315
|
+
</details>
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Reproducing Empirical Benchmarks
|
|
320
|
+
|
|
321
|
+
The frozen evaluation harness and evaluation request suites are packaged within [`benchmark/`](benchmark/):
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Install benchmark dependencies
|
|
325
|
+
pip install -e .[benchmark]
|
|
326
|
+
|
|
327
|
+
# Run the 23 public requested suites (9,252 decisions: SST-2, TREC, Banking77, Fast Decisions)
|
|
328
|
+
python benchmark/run.py --model arbiter-272m \
|
|
329
|
+
--data benchmark/data/public_requested_v1/cases.jsonl \
|
|
330
|
+
--device cuda:0 --output results/public_benchmark
|
|
331
|
+
|
|
332
|
+
# Run the 60 historical suites (21,915 decisions: MASSIVE, Typed Decisions, etc.)
|
|
333
|
+
python benchmark/run.py --model arbiter-272m \
|
|
334
|
+
--data benchmark/data/cases.jsonl \
|
|
335
|
+
--device cuda:0 --output results/historical_benchmark
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Testing & Numerical Parity
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
python -m pip install -e '.[dev,finetuning,benchmark]'
|
|
344
|
+
# No weights or GPU required:
|
|
345
|
+
CUDA_VISIBLE_DEVICES='' python -m pytest tests benchmark/tests -m 'not integration' -q
|
|
346
|
+
# After obtaining the complete release package:
|
|
347
|
+
CUDA_VISIBLE_DEVICES='' python -m pytest tests benchmark/tests -q
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
The optional `tests/test_arbiter_parity.py` script compares an internal reference
|
|
351
|
+
checkpoint with the export. It additionally requires the original training repository
|
|
352
|
+
and reference weights; it is not the public installation check. See
|
|
353
|
+
[development instructions](CONTRIBUTING.md) for release validation.
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Licensing & Provenance
|
|
358
|
+
|
|
359
|
+
* **Source Code (`arbiter/`)**: Released under the **Apache-2.0 License**. See [LICENSE](LICENSE) for details.
|
|
360
|
+
* **Model Weights (`checkpoints/arbiter-272m/model.safetensors`)**: Derived from `google/embeddinggemma-2` and fine-tuned on relational decision data. Weights are subject to the **Gemma Terms of Use**.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Authors & Contributors
|
|
365
|
+
|
|
366
|
+
* **Ichrak Mokhtari** (Equal contribution)
|
|
367
|
+
* **Seif Attoui** (Equal contribution)
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Citation
|
|
372
|
+
|
|
373
|
+
```bibtex
|
|
374
|
+
@misc{arbiter2026,
|
|
375
|
+
title={ARBITER: Attentive Relational Bidirectional Impartial Typed Encoder for Reasoning},
|
|
376
|
+
author={Mokhtari, Ichrak and Attoui, Seif},
|
|
377
|
+
year={2026},
|
|
378
|
+
note={Equal contribution},
|
|
379
|
+
howpublished={\url{https://huggingface.co/spectral-ai-lab/arbiter-272m}},
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Native batching
|
|
384
|
+
|
|
385
|
+
`decide_batch()` and `predict_batch()` support length-based batching with token and attention budgets. `predict()` batches its questions automatically. See [batching, examples and deployment limits](docs/batching.md).
|
|
386
|
+
|
|
387
|
+
## Targeted fine-tuning
|
|
388
|
+
|
|
389
|
+
Start with the [command-line fine-tuning guide](finetuning/README.md) or the [guided notebook](notebooks/finetuning_arbiter.ipynb). Both support building an 80k training / 8k validation mixture from pinned public sources, data checks, training, TensorBoard and resume. Data is generated locally rather than bundled in Git. See the [dataset recipe](docs/build_80k.md) for scope and limitations; no benchmark improvement is claimed before evaluation.
|
|
390
|
+
|
|
391
|
+
### Adapt on your own data in 5 lines
|
|
392
|
+
|
|
393
|
+
You can easily adapt ARBITER to your custom enterprise data (support tickets, intent routing, policy triage) by converting any CSV or DataFrame into the ARBITER JSONL format:
|
|
394
|
+
|
|
395
|
+
```python
|
|
396
|
+
import pandas as pd, json
|
|
397
|
+
|
|
398
|
+
# 1. Your tabular data
|
|
399
|
+
df = pd.DataFrame([
|
|
400
|
+
{"context": "Cannot reset my 2FA password.", "label": "auth"},
|
|
401
|
+
{"context": "Charged twice for subscription.", "label": "billing"}
|
|
402
|
+
])
|
|
403
|
+
criteria = {"auth": "Login and 2FA issues", "billing": "Invoice and charge errors"}
|
|
404
|
+
|
|
405
|
+
# 2. Format into ARBITER decision contract
|
|
406
|
+
rows = [{
|
|
407
|
+
"id": f"row_{i}", "group_id": f"grp_{i}", "family": "custom/support",
|
|
408
|
+
"source": "internal", "source_revision": "v1", "source_split": "train",
|
|
409
|
+
"license": "proprietary", "context": r["context"],
|
|
410
|
+
"instruction": "Classify the ticket category",
|
|
411
|
+
"question_type": "choice", "criteria": criteria,
|
|
412
|
+
"target": {c: 1.0 if c == r["label"] else 0.0 for c in criteria}
|
|
413
|
+
} for i, r in df.iterrows()]
|
|
414
|
+
|
|
415
|
+
# 3. Save to JSONL
|
|
416
|
+
with open("train.jsonl", "w") as f:
|
|
417
|
+
for row in rows: f.write(json.dumps(row) + "\n")
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Then train with:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
python -m finetuning.train \
|
|
424
|
+
--model checkpoints/arbiter-272m \
|
|
425
|
+
--train train.jsonl --validation val.jsonl \
|
|
426
|
+
--heldout benchmark/data/cases.jsonl \
|
|
427
|
+
--output results/my-custom-model \
|
|
428
|
+
--epochs 3 --batch-size 4 --accumulation 8
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## ARBITER Typed specialist
|
|
432
|
+
|
|
433
|
+
The Typed specialist reaches 76.45% on Typed Decisions versus 65.50% for the base. See the [reproduction instructions](finetuning/TYPED_SPECIALIST.md) and [specialist model card](docs/model_card_typed.md).
|