File size: 17,836 Bytes
f039f41 335e669 a642242 f039f41 a642242 9a43027 f039f41 9ddbe3c cc249f3 3bbb0bf cc249f3 9ddbe3c 48e6368 9ddbe3c 48e6368 9ddbe3c cc249f3 f039f41 a642242 f039f41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | ---
license: apache-2.0
pretty_name: Shiftedx Bench
task_categories:
- text-generation
- question-answering
- visual-question-answering
tags:
- evaluation
- long-context
- mlx
- mtplx
- tool-calling
---
# Shiftedx Bench
Shiftedx Bench is a reproducible qualification suite for local language-model deployments. It measures model quality, effective long-context use, tool protocol reliability, multi-turn agent behavior, vision, and runtime performance without collapsing them into a single “intelligence” score.
The project is designed for quantization and speculative-decoding decisions on Apple Silicon, but its API runner works with any OpenAI-compatible chat endpoint.
## What it evaluates
- **Quality:** 50 procedurally varied reasoning, transformation, algorithm, and executable-code cases in the release configuration.
- **Long context:** exact rendered-token prompts from 4,096 through 260,096 tokens, seven evidence positions, multiple seeds, before/after query placement, and six task families.
- **Tools:** 30 procedurally varied release cases with strict protocol-level function and argument comparison, including parallel calls and correct refusal to perform underspecified destructive actions.
- **Agentic behavior:** multi-turn inspect/patch/test, failed-search recovery, false-error handling, and repair loops with deterministic tool environments.
- **Vision:** deterministic OCR, chart, spatial, and multi-image fixtures.
- **MTPLX parity:** paired AR, D1, D2, and D3 runs with quality deltas, throughput, and native acceptance telemetry.
Every long-context prompt is built against the model's own tokenizer and chat template. The runner refuses to count a result if the server-reported prompt length differs from the requested rendered-token count.
## Status
Version `0.5.1` exposes immutable Hugging Face model and benchmark revision flags on the general suite and context runners so expanded agentic and Shiftedx Agent Harness results can satisfy the same post-publication provenance gate as the lightweight quant gate.
Version `0.5.0` adds a frozen 30-case expanded agentic matrix, four disposable-repository repairs with hidden tests, declared JSON key/type contracts, grounded receipt projection, and repeat-trial summaries. The lightweight six-case quant gate remains unchanged. The optional **Shiftedx Agent Harness** receives no hidden expected values, uses the public profile identifier `shiftedx-harness-v1`, and never replaces the default baseline. Version 0.3's fail-closed post-publication provenance, model-card rendering, and safe routine gate through 131,072 prompt tokens remain intact. Maximum-window qualification is an explicit, separately configured run. Public leaderboard claims additionally require the release suite, rotating holdout seeds, a sanitized per-case ledger, and the policy in [docs/leaderboard-policy.md](docs/leaderboard-policy.md).
This benchmark does not claim to replace RULER, HELM Long Context, NoLiMa, LiveCodeBench, BFCL, SWE-bench, or broad academic evaluations. Its distinctive purpose is paired local-deployment qualification across quality, context, multimodality, and runtime acceleration.
See the [changelog](CHANGELOG.md) for versioned changes and [Hugging Face release procedure](docs/hugging-face-release.md) for the immutable publication workflow.
## Published comparisons
- [AEON Hybrid with and without Shiftedx Agent Harness](results/aeon-hybrid-shiftedx-harness-v1/README.md): three complete paired trials covering the 30-case expanded matrix and four disposable-repository repairs, with sanitized per-case ledgers and revision-pinned manifests.
## Install
```bash
python -m venv .venv
.venv/bin/pip install -e '.[tokenizers,vision,test]'
.venv/bin/pytest
```
## Inspect the workload
```bash
.venv/bin/shiftedx-bench plan-context \
--config configs/context-smoke-v1.json \
--output context-plan.json
```
The smoke context suite contains 19 cases and approximately 1.51 million requested input tokens. The release context suite contains 312 cases and approximately 39.53 million requested input tokens per model variant.
After the release grid, verify that the runtime rejects an input beyond its declared boundary instead of silently truncating it:
```bash
.venv/bin/shiftedx-bench probe-boundary \
--tokenizer '<local-model-or-tokenizer-directory>' \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/context-boundary.json
```
Add `--include-positive` to repeat the maximum usable prompt as part of the boundary probe.
## Run a context smoke test
```bash
.venv/bin/shiftedx-bench run-context \
--config configs/context-smoke-v1.json \
--tokenizer '<local-model-or-tokenizer-directory>' \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/context-smoke.jsonl \
--stream
```
The context generator defaults to thinking enabled with medium reasoning effort. Set `--thinking off` or change `--reasoning-effort` only when the same fields are applied to the server request; these template controls are part of the token-count contract.
## Fast quant-comparison gate
Use the first-class quant gate for every candidate before spending hours on the smoke or release tiers:
```bash
.venv/bin/shiftedx-bench run-quant-gate \
--tokenizer '<local-model-or-tokenizer-directory>' \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--hf-repo '<owner/public-model-repo>' \
--hf-revision '<full-published-commit-sha>' \
--benchmark-revision '<full-shiftedx-bench-commit-sha>' \
--profile vision \
--label '<stable-candidate-label>' \
--output-dir 'results/<stable-candidate-label>'
```
The gate runs 15 exact-token context cases totaling 372,736 prompt tokens, 10 quality cases, 6 tool cases, 2 deterministic agentic cases, and 4 vision cases. It covers six context task families, evidence at 10/50/90%, before/after query placement, and capacity sentinels at 65,536 and 131,072 prompt tokens. Thinking remains enabled at medium reasoning effort by default so quant comparisons do not silently trade away the model's normal reasoning behavior.
Run each quant against the same endpoint contract and use a unique label. Compare their raw rows with an explicit parent rather than relying on alphabetical ordering:
```bash
.venv/bin/shiftedx-bench summarize \
results/parent/*.jsonl results/candidate/*.jsonl \
--baseline parent \
--output results/quant-comparison.json
```
The comparison reports paired quality delta, speed ratio, improvements, regressions, and a strict `zero_regression_gate`. Promote only candidates with no critical regression; use `context-smoke-v1.json` for finalists and `context-release-v1.json` only for publication-grade qualification.
### Optional maximum-window sentinel
The 260,096-token sentinel is deliberately excluded from the routine quant gate. Run it only on a host with sufficient memory headroom, or as a separately qualified runtime candidate with KV-cache quantization:
```bash
.venv/bin/shiftedx-bench run-context \
--config configs/context-max-window-v1.json \
--tokenizer '<local-model-or-tokenizer-directory>' \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/context-max-window.jsonl \
--stream
```
Always report host memory, KV-cache precision, active runtime features, and concurrent workloads with a maximum-window result. A host watchdog, allocation failure, or out-of-memory termination is an operability result, not a model-quality failure. Do not compare a q8 or q4 KV-cache run with an unquantized-KV run as though only the model weights changed.
On the 64 GiB Apple Silicon reference host, the AEON 27B vision-plus-MTPLX deployment passed the 131,072-token sentinel with unquantized KV cache. Its 260,096-token attempt ended in a WindowServer watchdog during system memory pressure, so this project makes no 260K quality claim for that host/runtime combination. The release grid retains 260,096 for suitably provisioned systems; only that grid characterizes position sensitivity throughout the full window.
## Post-publish Hugging Face model card
Use a two-revision release. First publish and verify the weights, then serve the exact immutable Hugging Face revision and run the gate above. Record that revision with `--hf-repo` and `--hf-revision`; the model-card exporter refuses runs whose manifests do not match it.
After every required row and manifest exists, render the standardized block into a clean copy of the public README:
```bash
.venv/bin/shiftedx-bench render-model-card \
--run-dir 'results/<stable-candidate-label>' \
--readme '<downloaded-public-README.md>' \
--output '<staged-updated-README.md>' \
--variant '<stable-candidate-label>' \
--profile vision \
--model-repo '<owner/public-model-repo>' \
--model-revision '<full-published-commit-sha>' \
--benchmark-revision '<full-shiftedx-bench-commit-sha>' \
--host 'Apple Silicon model, unified-memory capacity' \
--runtime 'MTPLX version and frozen request contract' \
--kv-cache off \
--mtp-depth 3 \
--max-window-status not-run
```
Use `--profile text` for a text-only artifact; it omits the vision lane but retains the other four. Upload only the staged README in a metadata-only second commit, then verify anonymously that the card is public and the weight-file LFS hashes are unchanged. The generated block contains separate category scores, context coverage, performance telemetry, exact model and benchmark revisions, host/runtime/KV declarations, and no composite intelligence score.
For the reference 64 GiB AEON deployment, use `--max-window-status host-limited`. Do not copy the interrupted 260K request into the score denominator and do not publish raw model responses in the card.
Results are appended as JSONL and resume by `(case_id, variant)`. API keys are read only from a named environment variable using `--api-key-env`; token values are never accepted as command-line arguments.
## Run qualification lanes
```bash
.venv/bin/shiftedx-bench run-suite \
--suite quality \
--config configs/suites-smoke-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/quality.jsonl
.venv/bin/shiftedx-bench run-suite \
--suite tools \
--config configs/suites-smoke-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/tools.jsonl
```
The other suite names are `agentic` and `vision`.
### Optional Shiftedx Agent Harness
The **Shiftedx Agent Harness** is an optional, model-agnostic inference-time execution layer inside Shiftedx Bench. Its first public profile, `shiftedx-harness-v1`, tests whether explicit receipt-grounded state improves tool-use reliability without changing model weights or the serving runtime. It classifies structured tool receipts, blocks identical calls within an unchanged state epoch, preserves unresolved verification failures across investigation, requires verification after successful mutations, and allows at most two correction turns for malformed or unsupported final JSON. When a model repeats an already successful call and the evidence is sufficient, the harness disables tools for the next request and asks it to finalize. It never invents a tool result or reads hidden expected values.
See [docs/shiftedx-agent-harness.md](docs/shiftedx-agent-harness.md) for the trust boundary, state machine, telemetry, and reporting contract.
Run it as a paired experiment against the unchanged baseline:
```bash
.venv/bin/shiftedx-bench run-suite \
--suite agentic \
--config configs/suites-smoke-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--label '<model>-shiftedx-harness-v1' \
--thinking on \
--reasoning-effort medium \
--agentic-control-profile shiftedx-harness-v1 \
--output results/agentic-shiftedx-harness-v1.jsonl
```
The profile is disabled by default. It never reads scenario `expected_final` values or required-call sets while steering; those remain grader-only data. Report baseline and controlled accuracy separately along with emitted calls, dispatched calls, blocked duplicates, correction turns, total wall time, and decode throughput. A controller result is not a claim that the underlying quant became more intelligent.
For broader qualification, select the 30-case deterministic matrix or the four disposable-repository repairs:
```bash
# Stale evidence, status payloads, repairs, recovery, parallel reads, and safety refusals.
.venv/bin/shiftedx-bench run-suite \
--suite agentic --agentic-set expanded \
--config configs/suites-smoke-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--thinking on --reasoning-effort medium \
--agentic-control-profile shiftedx-harness-v1 \
--label '<model>-shiftedx-harness-expanded' \
--output results/agentic-expanded.jsonl
# Temporary source trees with actual writes and resource-limited hidden tests.
.venv/bin/shiftedx-bench run-suite \
--suite agentic --agentic-set repo \
--config configs/suites-smoke-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--thinking on --reasoning-effort medium \
--agentic-control-profile shiftedx-harness-v1 \
--label '<model>-shiftedx-harness-repo' \
--output results/agentic-repo.jsonl
```
Use `--case-id <id>` for a targeted diagnostic, not for a promotion claim. Summarize complete repeated runs without copying raw responses:
```bash
.venv/bin/shiftedx-bench summarize-agentic \
results/baseline-*.jsonl results/shiftedx-harness-*.jsonl \
--output results/agentic-trials.json
```
Receipt projection is deliberately narrow: a successful structured receipt may be projected only when it contains every declared output key with the declared JSON type, and a green `N passed` verification may produce the declared `{status, tests}` object. It cannot infer missing values or bypass a failed verification.
Before attaching results to a public model card, export a sanitized ledger and manifest. This command removes model responses, transcripts, raw errors, local paths, request/session identifiers, and host-environment details while retaining per-case outcomes, public-safe telemetry, immutable revisions, and the declared request contract:
```bash
.venv/bin/shiftedx-bench export-public-results \
results/agentic-expanded.jsonl \
--output public/agentic-expanded.public.jsonl \
--manifest results/agentic-expanded.manifest.json \
--manifest-output public/agentic-expanded.manifest.public.json
```
Keep the raw JSONL as private audit evidence. Run `validate-release` against the clean public tree, not the working results directory.
## Compare AR with MTPLX depths
Pass the frozen variant file to the quality, context, tool, or vision runner:
```bash
.venv/bin/shiftedx-bench run-suite \
--suite quality \
--config configs/suites-release-v1.json \
--variants configs/mtplx-parity-v1.json \
--base-url '<openai-compatible-base-url>/v1' \
--model '<served-model-id>' \
--output results/quality-parity.jsonl
```
AR is the parent lane. D1, D2, or D3 is promotable only when it has no critical regression and meets a speed threshold declared before the run.
For a context parity run using `configs/mtplx-parity-v1.json`, also pass `--thinking off`. The runner rejects a tokenizer-template mode that disagrees with the variant request rather than accepting a shifted token grid.
## Summarize
```bash
.venv/bin/shiftedx-bench summarize \
results/context-smoke.jsonl results/quality.jsonl results/tools.jsonl \
--output results/summary.json
```
The summary contains category scorecards, bootstrap confidence intervals, length/position heatmap cells, worst-cell context accuracy, effective context length, and paired variant deltas.
## Public-release check
```bash
.venv/bin/shiftedx-bench validate-release --root .
```
The check rejects access-token patterns, private keys, user-specific absolute paths, and loopback URLs accidentally captured in public artifacts. Raw outputs must be copied into a clean release tree and scanned before publication.
For an official comparison, derive rotating holdout seeds from a private environment value rather than checking them into source:
```bash
.venv/bin/shiftedx-bench make-holdout \
--template configs/context-release-v1.json \
--release-id '<release-id>' \
--master-key-env SHIFTEDX_BENCH_HOLDOUT_KEY \
--output '<private-output-directory>/context-holdout.json'
```
## Repository map
```text
configs/ frozen smoke, release, and MTPLX contracts
docs/ methodology and leaderboard policy
schemas/ versioned result and context schemas
src/shiftedx_bench/ generators, runner, scorers, sandbox, summaries
tests/ generator, scorer, mutation, resume, and privacy tests
```
## Methodology influences
The context design incorporates position sensitivity demonstrated by [Lost in the Middle](https://arxiv.org/abs/2307.03172), task diversity from [RULER](https://github.com/NVIDIA/RULER), and non-literal retrieval motivation from [NoLiMa](https://github.com/adobe-research/NoLiMa). Tool evaluation uses strict structured-call comparison in the spirit of [BFCL](https://gorilla.cs.berkeley.edu/leaderboard). These external datasets are not redistributed here; consult their licenses before combining them with Shiftedx Bench.
## License
Shiftedx Bench's original code, configurations, and procedurally generated fixtures are licensed under Apache-2.0. Model outputs retain any rights or restrictions imposed by the evaluated model and its source license.
|