Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
| 3 |
language:
|
|
@@ -14,106 +15,100 @@ tags:
|
|
| 14 |
|
| 15 |
# PabJev-4b
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
>
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
| 项目 | 发布值 |
|
| 24 |
-
|---|---|
|
| 25 |
-
| checkpoint | short150 best,step 150 |
|
| 26 |
-
| 基础模型展示名称 | **qwen3.5 4b** |
|
| 27 |
-
| backbone | merged、BF16、不量化,3 个 safetensors 分片 / 723 个张量 |
|
| 28 |
-
| pointer head | FP32,4 个张量,head_dim=256 |
|
| 29 |
-
| backbone 结构 | 32 层:8 层 full attention + 24 层 Gated DeltaNet linear attention |
|
| 30 |
-
| 注意力语义 | full-attention 层双向;linear-attention/GDN 层保持因果 recurrent |
|
| 31 |
-
| 读出 | 每个 `</opt>` 与最终 `<decide>` 的 hidden states,经 pointer head + softmax |
|
| 32 |
-
| 温度 | **T=1.0**;独立校准后仍选择 raw,不应用拟合温度 |
|
| 33 |
-
| 典型硬件 | 单张 NVIDIA A800-SXM4-80GB,tensor_parallel_size=1 |
|
| 34 |
-
| 参考运行时 | Python 3.12、PyTorch 2.13.0+cu130、Transformers 5.19.0、vLLM 0.30.0 |
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
## 2.
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
|
| 47 |
|---|---:|
|
| 48 |
-
| **Overall Accuracy** | **0.883117
|
| 49 |
-
| choice Accuracy | 0.892086
|
| 50 |
-
| noul Accuracy | 0.864865
|
| 51 |
-
| score Accuracy
|
| 52 |
| easy / standard / hard / judge Accuracy | 1.000000 / 0.972222 / 0.808511 / 0.588235 |
|
| 53 |
-
|
|
| 54 |
-
|
|
| 55 |
-
|
|
| 56 |
-
| 请求阶段 wall time / QPS | 16.311 s / 14.1621 |
|
| 57 |
-
| 相对训练日志的 Accuracy、三题型 Accuracy、Intelligence 差值 | 均为 0 |
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
| 62 |
|
| 63 |
```text
|
| 64 |
PabJev-4b/
|
| 65 |
-
├── backbone/ # BF16 config + 3
|
| 66 |
├── tokenizer/ # tokenizer.json/config + chat template
|
| 67 |
├── pointer_head.safetensors # FP32 q/k pointer head
|
| 68 |
-
├── model_manifest.json #
|
| 69 |
-
├── service/ #
|
| 70 |
-
├── jevbench/ #
|
| 71 |
-
├── examples/ #
|
| 72 |
-
├── reference_results/ #
|
| 73 |
-
├── docs/ #
|
| 74 |
-
├── wheels/ #
|
| 75 |
├── requirements.txt / setup_env.sh
|
| 76 |
-
└── SHA256SUMS #
|
| 77 |
```
|
| 78 |
|
| 79 |
-
merged
|
| 80 |
|
| 81 |
-
|
| 82 |
|
| 83 |
-
|
| 84 |
|
| 85 |
```bash
|
| 86 |
-
export HF_REPO_ID="
|
| 87 |
python3.12 -m pip install "huggingface_hub==2.2.0"
|
| 88 |
hf download "$HF_REPO_ID" --local-dir PabJev-4b
|
| 89 |
cd PabJev-4b
|
| 90 |
```
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
```bash
|
| 95 |
-
git lfs install
|
| 96 |
-
git clone "https://huggingface.co/$HF_REPO_ID"
|
| 97 |
-
cd PabJev-4b
|
| 98 |
-
```
|
| 99 |
|
| 100 |
-
## 5.
|
| 101 |
|
| 102 |
-
###
|
| 103 |
|
| 104 |
-
- Linux x86_64
|
| 105 |
-
- NVIDIA
|
| 106 |
-
-
|
| 107 |
-
-
|
| 108 |
|
| 109 |
-
|
| 110 |
|
| 111 |
```bash
|
| 112 |
bash setup_env.sh
|
| 113 |
source .venv/bin/activate
|
| 114 |
```
|
| 115 |
|
| 116 |
-
|
| 117 |
|
| 118 |
```bash
|
| 119 |
python3.12 -m venv .venv
|
|
@@ -129,63 +124,65 @@ python service/verify_bundle.py --full
|
|
| 129 |
python service/selftest.py
|
| 130 |
```
|
| 131 |
|
| 132 |
-
`verify_bundle.py --full`
|
| 133 |
|
| 134 |
-
|
| 135 |
|
| 136 |
```bash
|
| 137 |
USE_BUNDLED_WHEELS=0 bash setup_env.sh
|
| 138 |
```
|
| 139 |
|
| 140 |
-
|
| 141 |
|
| 142 |
-
|
|
|
|
|
|
|
| 143 |
|
| 144 |
-
|
| 145 |
|
| 146 |
```bash
|
| 147 |
GPU_ID=0 bash service/start.sh
|
| 148 |
```
|
| 149 |
|
| 150 |
-
|
| 151 |
|
| 152 |
-
-
|
| 153 |
-
-
|
| 154 |
-
-
|
| 155 |
|
| 156 |
-
|
| 157 |
|
| 158 |
```bash
|
| 159 |
GPU_ID=0 \
|
| 160 |
JEV_PORT=18100 VLLM_PORT=30000 \
|
| 161 |
-
GPU_UTIL=0.
|
| 162 |
bash service/start.sh
|
| 163 |
```
|
| 164 |
|
| 165 |
-
- `GPU_ID`
|
| 166 |
-
- `JEV_HEAD_DEVICE`
|
| 167 |
-
- `logs/vllm.log`
|
| 168 |
-
-
|
| 169 |
|
| 170 |
-
|
| 171 |
|
| 172 |
```bash
|
| 173 |
bash service/stop.sh
|
| 174 |
-
#
|
| 175 |
JEV_PORT=18102 VLLM_PORT=30002 bash service/stop.sh
|
| 176 |
```
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
```bash
|
| 181 |
JEV_HOST=0.0.0.0 GPU_ID=0 bash service/start.sh
|
| 182 |
```
|
| 183 |
|
| 184 |
-
|
| 185 |
|
| 186 |
-
## 7.
|
| 187 |
|
| 188 |
-
###
|
| 189 |
|
| 190 |
```bash
|
| 191 |
curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
@@ -193,7 +190,7 @@ curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
| 193 |
-d @examples/choice.json
|
| 194 |
```
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
```bash
|
| 199 |
curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
@@ -201,7 +198,7 @@ curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
| 201 |
-d @examples/all_types.json
|
| 202 |
```
|
| 203 |
|
| 204 |
-
### Python
|
| 205 |
|
| 206 |
```bash
|
| 207 |
python service/request.py examples/choice.json
|
|
@@ -209,7 +206,7 @@ python service/request.py examples/all_types.json \
|
|
| 209 |
--endpoint http://127.0.0.1:18100/v1/systemone
|
| 210 |
```
|
| 211 |
|
| 212 |
-
|
| 213 |
|
| 214 |
```json
|
| 215 |
{
|
|
@@ -218,7 +215,10 @@ python service/request.py examples/all_types.json \
|
|
| 218 |
"move": {
|
| 219 |
"type": "choice",
|
| 220 |
"choice": "left",
|
| 221 |
-
"probabilities": {
|
|
|
|
|
|
|
|
|
|
| 222 |
}
|
| 223 |
},
|
| 224 |
"usage": {
|
|
@@ -229,36 +229,38 @@ python service/request.py examples/all_types.json \
|
|
| 229 |
}
|
| 230 |
```
|
| 231 |
|
| 232 |
-
###
|
| 233 |
|
| 234 |
```json
|
| 235 |
{
|
| 236 |
"model": "PabJev-4b",
|
| 237 |
-
"state": "
|
| 238 |
"questions": {
|
| 239 |
"question_id": {
|
| 240 |
"type": "choice | noul | score",
|
| 241 |
-
"instructions": "
|
| 242 |
-
"criteria": "
|
| 243 |
}
|
| 244 |
}
|
| 245 |
}
|
| 246 |
```
|
| 247 |
|
| 248 |
-
|
|
| 249 |
|---|---|---|
|
| 250 |
-
| choice |
|
| 251 |
-
| noul |
|
| 252 |
-
| score |
|
| 253 |
|
| 254 |
-
-
|
| 255 |
-
- state
|
| 256 |
-
-
|
| 257 |
-
-
|
| 258 |
|
| 259 |
-
|
| 260 |
|
| 261 |
-
|
|
|
|
|
|
|
| 262 |
|
| 263 |
```bash
|
| 264 |
python service/evaluate.py \
|
|
@@ -266,13 +268,9 @@ python service/evaluate.py \
|
|
| 266 |
--out outputs/jevbench.json
|
| 267 |
```
|
| 268 |
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
```bash
|
| 272 |
-
python service/evaluate.py --max-items 2 --out outputs/smoke_eval.json
|
| 273 |
-
```
|
| 274 |
|
| 275 |
-
|
| 276 |
|
| 277 |
```bash
|
| 278 |
python service/evaluate.py \
|
|
@@ -282,7 +280,7 @@ python service/evaluate.py \
|
|
| 282 |
--out outputs/jevbench.external.json
|
| 283 |
```
|
| 284 |
|
| 285 |
-
|
| 286 |
|
| 287 |
```bash
|
| 288 |
python service/evaluate.py \
|
|
@@ -290,9 +288,9 @@ python service/evaluate.py \
|
|
| 290 |
--out outputs/jevbench.c4.json
|
| 291 |
```
|
| 292 |
|
| 293 |
-
|
| 294 |
|
| 295 |
-
|
| 296 |
|
| 297 |
```bash
|
| 298 |
python service/evaluate.py --concurrency 1 --out outputs/jevbench.repeat.json
|
|
@@ -301,9 +299,11 @@ python service/compare_results.py \
|
|
| 301 |
--out outputs/jevbench.compare.json
|
| 302 |
```
|
| 303 |
|
| 304 |
-
|
|
|
|
|
|
|
| 305 |
|
| 306 |
-
|
| 307 |
|
| 308 |
```bash
|
| 309 |
python service/evaluate.py \
|
|
@@ -314,7 +314,7 @@ python service/evaluate.py \
|
|
| 314 |
--out outputs/test.json
|
| 315 |
```
|
| 316 |
|
| 317 |
-
|
| 318 |
|
| 319 |
```bash
|
| 320 |
python service/evaluate.py \
|
|
@@ -323,42 +323,34 @@ python service/evaluate.py \
|
|
| 323 |
--out outputs/custom.json
|
| 324 |
```
|
| 325 |
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
原 JevBench 复测不要加 `--no-pseudo-sealed`;普通自定义数据建议加上。其他目录即使恰好有 231 条,也不会误套原 JevBench 的训练 parity。
|
| 329 |
-
|
| 330 |
-
## 10. 温度校准结果
|
| 331 |
|
| 332 |
-
**
|
| 333 |
|
| 334 |
-
|
| 335 |
-
|---|---:|---:|---:|---:|---:|
|
| 336 |
-
| **raw T=1(最终)** | 0.928301 | 0.225644 | **0.105183** | **0.023519** | **95.4508** |
|
| 337 |
-
| global | 0.928301 | 0.217776 | 0.106195 | 0.026693 | 95.0431 |
|
| 338 |
-
| per-type | 0.928301 | **0.215359** | 0.106267 | 0.027746 | 94.9723 |
|
| 339 |
|
| 340 |
-
|
| 341 |
|
| 342 |
-
|
| 343 |
|
| 344 |
-
|
| 345 |
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
|
|
|
| 350 |
|
| 351 |
-
|
| 352 |
-
hf upload "$HF_REPO_ID" . --repo-type model
|
| 353 |
-
```
|
| 354 |
|
| 355 |
-
|
| 356 |
|
| 357 |
-
##
|
| 358 |
|
| 359 |
-
- **
|
| 360 |
-
-
|
| 361 |
-
-
|
| 362 |
-
-
|
| 363 |
|
| 364 |
-
|
|
|
|
|
|
| 1 |
+
```markdown
|
| 2 |
---
|
| 3 |
license: cc-by-nc-4.0
|
| 4 |
language:
|
|
|
|
| 15 |
|
| 16 |
# PabJev-4b
|
| 17 |
|
| 18 |
+
Base Model: **qwen3.5 4b**. This repository contains the complete backbone, FP32 pointer head, tokenizer/processor, bidirectional attention runtime, HTTP inference service, JevBench evaluation dataset, and evaluation harnesses.
|
| 19 |
|
| 20 |
+
> This is a **decision/pooling model**, not a generative language model. It takes `state + choice/noul/score questions` as input and returns complete probability distributions over candidate options. It does not expose a `/v1/chat/completions` endpoint and should **not** be used within standard autoregressive text generation pipelines.
|
| 21 |
|
| 22 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
## 1. Model Specifications & Release Contract
|
| 25 |
|
| 26 |
+
| Item | Specification |
|
| 27 |
+
|---|---|
|
| 28 |
+
| Checkpoint | short150 best (step 150) |
|
| 29 |
+
| Base Model Identifier | **qwen3.5 4b** |
|
| 30 |
+
| Backbone | Merged, BF16, unquantized, 3 safetensors shards / 723 tensors |
|
| 31 |
+
| Pointer Head | FP32, 4 tensors, `head_dim=256` |
|
| 32 |
+
| Backbone Architecture | 32 layers: 8 full-attention layers + 24 Gated DeltaNet linear-attention layers |
|
| 33 |
+
| Attention Semantics | Full-attention layers are bidirectional; linear-attention/GDN layers remain causal/recurrent |
|
| 34 |
+
| Readout Strategy | Hidden states extracted at each `</opt>` and final `<decide>`, routed through pointer head + softmax |
|
| 35 |
+
| Temperature | **T=1.0**; retained raw after calibration (fitted temperatures rejected) |
|
| 36 |
+
| Reference Hardware | 1× NVIDIA A800-SXM4-80GB, `tensor_parallel_size=1` |
|
| 37 |
+
| Reference Runtime | Python 3.12, PyTorch 2.13.0+cu130, Transformers 5.19.0, vLLM 0.30.0 |
|
| 38 |
+
|
| 39 |
+
At startup, `vllm_plugin.py` verifies the 8+24 layer architecture and asserts that all 8 full-attention layers enter the `ENCODER_ONLY` bidirectional path. To prevent silent semantic drift, the service enforces: BF16 precision, no KV/weight quantization, chunked prefill disabled, prefix caching disabled, `use_non_causal=true`, and T=1.0. Alternative engines or modified runtime configurations will not guarantee parity with this README.
|
| 40 |
|
| 41 |
+
---
|
| 42 |
|
| 43 |
+
## 2. Reference Results (JevBench - 231 Items)
|
| 44 |
|
| 45 |
+
Tested on a single A800, concurrency 1, 231/231 valid probabilities, 0 invalid requests, 0 timeouts:
|
| 46 |
|
| 47 |
+
| Metric | Score |
|
| 48 |
|---|---:|
|
| 49 |
+
| **Overall Accuracy** | **0.883117 (204/231)** |
|
| 50 |
+
| choice Accuracy | 0.892086 (124/139) |
|
| 51 |
+
| noul Accuracy | 0.864865 (64/74) |
|
| 52 |
+
| score Accuracy (argmax) | 0.888889 (16/18) |
|
| 53 |
| easy / standard / hard / judge Accuracy | 1.000000 / 0.972222 / 0.808511 / 0.588235 |
|
| 54 |
+
| ECE / Fidelity | 0.071062 / 0.886139 |
|
| 55 |
+
| Request-phase wall time / QPS | 16.311 s / 14.1621 |
|
| 56 |
+
| Discrepancy vs. Training Logs (Overall, 3-Type Acc, Intelligence) | Exact match (0 delta) |
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
Across two full evaluations at concurrency 1, predicted labels and probability distributions match identically (`probability_max_abs=0.0`). At concurrency 4, reference throughput reaches 23.3873 QPS, though a single boundary case flips; strict benchmark reproduction requires concurrency 1. See `docs/CALIBRATION.md`, `docs/VALIDATION.md`, and `reference_results/` for details.
|
| 59 |
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 3. Repository Layout
|
| 63 |
|
| 64 |
```text
|
| 65 |
PabJev-4b/
|
| 66 |
+
├── backbone/ # BF16 config + 3 merged weight shards + processor configuration
|
| 67 |
├── tokenizer/ # tokenizer.json/config + chat template
|
| 68 |
├── pointer_head.safetensors # FP32 q/k pointer head
|
| 69 |
+
├── model_manifest.json # Step metadata, LoRA lineage, dtype, attention & temperature contract
|
| 70 |
+
├── service/ # Startup, client, evaluation, selftest, and step-150 checkpoint_state.json
|
| 71 |
+
├── jevbench/ # 231 evaluation items across easy/hard/original JSONL files
|
| 72 |
+
├── examples/ # Request JSON and three custom JSONL examples
|
| 73 |
+
├── reference_results/ # Baseline validation and temperature calibration artifacts
|
| 74 |
+
├── docs/ # Specifications for data format, calibration, and validation
|
| 75 |
+
├── wheels/ # Optional pre-compiled kernel wheels matching ABI + licenses
|
| 76 |
├── requirements.txt / setup_env.sh
|
| 77 |
+
└── SHA256SUMS # Cryptographic release checksums
|
| 78 |
```
|
| 79 |
|
| 80 |
+
The merged weights are self-contained: **no** upstream base weights, LoRA adapters, optimizer states, scheduler states, RNG states, or external training codebases are required. This bundle follows a custom runtime layout—please use the included serving stack rather than standard Hugging Face pipeline loaders.
|
| 81 |
|
| 82 |
+
---
|
| 83 |
|
| 84 |
+
## 4. Download from Hugging Face
|
| 85 |
|
| 86 |
```bash
|
| 87 |
+
export HF_REPO_ID="roudone/PabJev-4b"
|
| 88 |
python3.12 -m pip install "huggingface_hub==2.2.0"
|
| 89 |
hf download "$HF_REPO_ID" --local-dir PabJev-4b
|
| 90 |
cd PabJev-4b
|
| 91 |
```
|
| 92 |
|
| 93 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
+
## 5. Environment Setup & Verification
|
| 96 |
|
| 97 |
+
### Recommended Environment
|
| 98 |
|
| 99 |
+
- Linux x86_64; Python/CPython **3.12**
|
| 100 |
+
- NVIDIA Driver compatible with **CUDA 13.0**; target GPU: A800 80GB
|
| 101 |
+
- At least 10GB disk space for model weights, plus additional space for dependencies
|
| 102 |
+
- Installation requires internet access. The bundled wheels target `CPython 3.12 + Linux x86_64 + PyTorch 2.13 + CUDA 13 ABI`.
|
| 103 |
|
| 104 |
+
Automated setup (creates `.venv`, installs locked dependencies, checks GPU/weights, and executes CPU selftests):
|
| 105 |
|
| 106 |
```bash
|
| 107 |
bash setup_env.sh
|
| 108 |
source .venv/bin/activate
|
| 109 |
```
|
| 110 |
|
| 111 |
+
Equivalent manual setup:
|
| 112 |
|
| 113 |
```bash
|
| 114 |
python3.12 -m venv .venv
|
|
|
|
| 124 |
python service/selftest.py
|
| 125 |
```
|
| 126 |
|
| 127 |
+
`verify_bundle.py --full` inspects the 3 shards, index/header, 723 backbone tensors, 4 FP32 pointer tensors, tokenizer/processor configs, step-150 metadata, 8+24 bidirectional attention assertions, and core SHA256 checksums.
|
| 128 |
|
| 129 |
+
To build kernels from source for other ABIs:
|
| 130 |
|
| 131 |
```bash
|
| 132 |
USE_BUNDLED_WHEELS=0 bash setup_env.sh
|
| 133 |
```
|
| 134 |
|
| 135 |
+
*Note: Requires compatible nvcc/build tools. Numerical behavior and latency across different CUDA versions, GPUs, custom kernels, or dependency variations may deviate from the reference baseline. Do not apply quantization or lower precision when aiming to reproduce reference metrics.*
|
| 136 |
|
| 137 |
+
---
|
| 138 |
+
|
| 139 |
+
## 6. Serving & Deployment
|
| 140 |
|
| 141 |
+
Activate the environment from the repository root:
|
| 142 |
|
| 143 |
```bash
|
| 144 |
GPU_ID=0 bash service/start.sh
|
| 145 |
```
|
| 146 |
|
| 147 |
+
Default endpoints:
|
| 148 |
|
| 149 |
+
- **Inference API**: `http://127.0.0.1:18100/v1/systemone` (alias: `/predict`)
|
| 150 |
+
- **Health Check**: `http://127.0.0.1:18100/health`
|
| 151 |
+
- **Internal vLLM Pooling**: `127.0.0.1:30000` (loopback only, do not expose externally)
|
| 152 |
|
| 153 |
+
The startup script verifies weights, starts vLLM and the SystemOne API, runs a full-distribution smoke test, and warms up short-context, long-context, score, and multi-question paths. Common runtime options:
|
| 154 |
|
| 155 |
```bash
|
| 156 |
GPU_ID=0 \
|
| 157 |
JEV_PORT=18100 VLLM_PORT=30000 \
|
| 158 |
+
GPU_UTIL=0.92 MAX_NUM_SEQS=64 MAX_BATCHED_TOKENS=32768 \
|
| 159 |
bash service/start.sh
|
| 160 |
```
|
| 161 |
|
| 162 |
+
- `GPU_ID` must specify a single card; reference numbers are obtained on an idle 80GB A800.
|
| 163 |
+
- `JEV_HEAD_DEVICE` defaults to `cuda`; the pointer head runs in FP32.
|
| 164 |
+
- Inspect `logs/vllm.log`, `logs/server.log`, `run/startup.json`, and `run/smoke.json` for troubleshooting.
|
| 165 |
+
- The startup script checks ports before binding; it will not overwrite or kill external processes.
|
| 166 |
|
| 167 |
+
To stop the service (pass custom ports if overridden):
|
| 168 |
|
| 169 |
```bash
|
| 170 |
bash service/stop.sh
|
| 171 |
+
# or
|
| 172 |
JEV_PORT=18102 VLLM_PORT=30002 bash service/stop.sh
|
| 173 |
```
|
| 174 |
|
| 175 |
+
To expose externally:
|
| 176 |
|
| 177 |
```bash
|
| 178 |
JEV_HOST=0.0.0.0 GPU_ID=0 bash service/start.sh
|
| 179 |
```
|
| 180 |
|
| 181 |
+
---
|
| 182 |
|
| 183 |
+
## 7. Inference & API Usage
|
| 184 |
|
| 185 |
+
### Via cURL
|
| 186 |
|
| 187 |
```bash
|
| 188 |
curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
|
|
| 190 |
-d @examples/choice.json
|
| 191 |
```
|
| 192 |
|
| 193 |
+
Multi-question query covering all three supported types:
|
| 194 |
|
| 195 |
```bash
|
| 196 |
curl -sS -X POST http://127.0.0.1:18100/v1/systemone \
|
|
|
|
| 198 |
-d @examples/all_types.json
|
| 199 |
```
|
| 200 |
|
| 201 |
+
### Via Python
|
| 202 |
|
| 203 |
```bash
|
| 204 |
python service/request.py examples/choice.json
|
|
|
|
| 206 |
--endpoint http://127.0.0.1:18100/v1/systemone
|
| 207 |
```
|
| 208 |
|
| 209 |
+
Example response (probabilities are illustrative; JSON schema is fixed):
|
| 210 |
|
| 211 |
```json
|
| 212 |
{
|
|
|
|
| 215 |
"move": {
|
| 216 |
"type": "choice",
|
| 217 |
"choice": "left",
|
| 218 |
+
"probabilities": {
|
| 219 |
+
"left": 0.9999983,
|
| 220 |
+
"forward": 0.0000017
|
| 221 |
+
}
|
| 222 |
}
|
| 223 |
},
|
| 224 |
"usage": {
|
|
|
|
| 229 |
}
|
| 230 |
```
|
| 231 |
|
| 232 |
+
### Request Schema & Constraints
|
| 233 |
|
| 234 |
```json
|
| 235 |
{
|
| 236 |
"model": "PabJev-4b",
|
| 237 |
+
"state": "Text or stringified JSON payload",
|
| 238 |
"questions": {
|
| 239 |
"question_id": {
|
| 240 |
"type": "choice | noul | score",
|
| 241 |
+
"instructions": "Instruction prompt",
|
| 242 |
+
"criteria": "Per-type criteria specification"
|
| 243 |
}
|
| 244 |
}
|
| 245 |
}
|
| 246 |
```
|
| 247 |
|
| 248 |
+
| Type | Criteria Format | Key Response Fields |
|
| 249 |
|---|---|---|
|
| 250 |
+
| `choice` | Object mapping candidate names to descriptions: `{candidate: description}` | Selected `choice` and full `probabilities` distribution |
|
| 251 |
+
| `noul` | Optional, or limited to `false`/`true` keys | Float scalar `noul` ($P(\text{true})$), plus `false`/`true` probabilities |
|
| 252 |
+
| `score` | Ordered array of criteria labels (minimum 2 buckets) | Expected bucket index `score` (0-indexed), `legend`, and per-bucket probabilities |
|
| 253 |
|
| 254 |
+
- **Batching per request**: 1 to 16 questions. Multi-question requests expand `state + question` branches and aggregate them into a single response.
|
| 255 |
+
- **Token Limits**: `state` ≤ 8,192 tokens; full single branch ≤ 12,288 tokens; expanded total tokens per batch ≤ 32,768.
|
| 256 |
+
- **Multimodal (Vision)**: Supports single PNG/JPEG input per request, limited to a single question. Image limits: 8 MiB, 16 MP, 1,024 visual tokens. Use base64 data URIs for remote requests; local file paths only resolve locally on the server.
|
| 257 |
+
- **Unsupported Features**: Free-form generation, `think_mode`, and autoregressive completion parameters are rejected with HTTP 422.
|
| 258 |
|
| 259 |
+
---
|
| 260 |
|
| 261 |
+
## 8. JevBench Evaluation
|
| 262 |
+
|
| 263 |
+
Once the service is active, run the benchmark from the repository root:
|
| 264 |
|
| 265 |
```bash
|
| 266 |
python service/evaluate.py \
|
|
|
|
| 268 |
--out outputs/jevbench.json
|
| 269 |
```
|
| 270 |
|
| 271 |
+
By default, this evaluates the included 231 items across `jevbench/{easy,hard,original}.jsonl`, applying the training-consistent scoring IDs and 113/118 pseudo-sealed split mapping.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
+
Evaluate an external JevBench directory:
|
| 274 |
|
| 275 |
```bash
|
| 276 |
python service/evaluate.py \
|
|
|
|
| 280 |
--out outputs/jevbench.external.json
|
| 281 |
```
|
| 282 |
|
| 283 |
+
Throughput testing:
|
| 284 |
|
| 285 |
```bash
|
| 286 |
python service/evaluate.py \
|
|
|
|
| 288 |
--out outputs/jevbench.c4.json
|
| 289 |
```
|
| 290 |
|
| 291 |
+
Evaluation outputs aggregate accuracy across tier/family/type, Intelligence, Calibration, ECE, Fidelity, reliability diagram bins, latency/QPS, and per-item outputs saved alongside `*.rows.jsonl`. New runs overwrite `--out` atomically.
|
| 292 |
|
| 293 |
+
Reproducibility comparison check:
|
| 294 |
|
| 295 |
```bash
|
| 296 |
python service/evaluate.py --concurrency 1 --out outputs/jevbench.repeat.json
|
|
|
|
| 299 |
--out outputs/jevbench.compare.json
|
| 300 |
```
|
| 301 |
|
| 302 |
+
---
|
| 303 |
+
|
| 304 |
+
## 9. Evaluating Custom Datasets
|
| 305 |
|
| 306 |
+
For custom datasets (e.g., `my_data/test.jsonl`), set `--tiers` to match the file basename (`test`):
|
| 307 |
|
| 308 |
```bash
|
| 309 |
python service/evaluate.py \
|
|
|
|
| 314 |
--out outputs/test.json
|
| 315 |
```
|
| 316 |
|
| 317 |
+
Evaluate the bundled custom examples:
|
| 318 |
|
| 319 |
```bash
|
| 320 |
python service/evaluate.py \
|
|
|
|
| 323 |
--out outputs/custom.json
|
| 324 |
```
|
| 325 |
|
| 326 |
+
Multiple tiers can be passed as comma-separated values: `--tiers dev,test`. Required row schema includes `id`, `state`, `question`, and `expected` (choice candidate key, boolean string `yes`/`no` or `true`/`false`, or integer bucket index). For complete specifications, see **[docs/DATA_FORMAT.md](docs/DATA_FORMAT.md)**.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
|
| 328 |
+
Do **not** use `--no-pseudo-sealed` when replicating original JevBench splits. Always include `--no-pseudo-sealed` for generic custom datasets.
|
| 329 |
|
| 330 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
|
| 332 |
+
## 10. Temperature Calibration
|
| 333 |
|
| 334 |
+
**The deployed serving temperature is fixed at $T = 1.0$.**
|
| 335 |
|
| 336 |
+
Post-training calibration sweeps fitted candidate values of global $T=1.2778$, choice $T=1.4339$, noul $T=1.2720$, and score $T=0.9909$. However, these candidates were rejected: while they reduced validation NLL, they degraded Brier score and overall Calibration metrics, failing the strict "no-regression across all three metrics" deployment rule.
|
| 337 |
|
| 338 |
+
| Calibration Candidate (Domain-Macro) | Accuracy | NLL ↓ | Brier ↓ | ECE ↓ | Calibration ↑ |
|
| 339 |
+
|---|---:|---:|---:|---:|---:|
|
| 340 |
+
| **Raw $T=1.0$ (Deployed)** | **0.928301** | 0.225644 | **0.105183** | **0.023519** | **95.4508** |
|
| 341 |
+
| Global Scaling | 0.928301 | 0.217776 | 0.106195 | 0.026693 | 95.0431 |
|
| 342 |
+
| Per-Type Scaling | 0.928301 | **0.215359** | 0.106267 | 0.027746 | 94.9723 |
|
| 343 |
|
| 344 |
+
On the held-out test split, raw test scores were: Accuracy=0.928121, NLL=0.187029, Brier=0.090812, ECE=0.017322, Calibration=96.1804. *(Note: The calibration split is distinct from the 231-item JevBench evaluation set).* Complete calibration analysis and reliability diagrams are documented in **[docs/CALIBRATION.md](docs/CALIBRATION.md)**.
|
|
|
|
|
|
|
| 345 |
|
| 346 |
+
---
|
| 347 |
|
| 348 |
+
## 11. Licenses & Disclaimers
|
| 349 |
|
| 350 |
+
- **Model Weights & Derivative Weights**: **CC BY-NC 4.0 (Non-Commercial Use Only)**. Refer to `LICENSE` for the complete license text. Upstream attributions and commercial licensing instructions are preserved in `NOTICE`. Commercial deployment requires separate licensing.
|
| 351 |
+
- **Service Stack, Evaluation Harnesses, & Vendored Runtime**: **Apache-2.0**, provided under `licenses/Apache-2.0` and `third_party/`.
|
| 352 |
+
- **Bundled JevBench Dataset**: Line-by-line provenance provided under **MIT**, detailed in `jevbench/LICENSE` and `NOTICE.md`.
|
| 353 |
+
- **Precompiled Wheels**: Respective licenses and source origins are documented under `wheels/licenses/`.
|
| 354 |
|
| 355 |
+
*These benchmarks reflect performance exclusively on JevBench under the documented software/hardware stack and step-150 checkpoint; they do not imply uniform dominance across arbitrary domains. Floating-point variations in BF16 may occur across different GPU microarchitectures, kernel implementations, or dynamic batch compositions. Users must perform independent validation regarding safety, access controls, data governance, and license compliance before hosting public-facing endpoints.*
|
| 356 |
+
```
|