train-a-router-bbeh / README.md
svonava's picture
Publish BBEH routing release
86dd749 verified
|
Raw History Blame Contribute Delete
8.71 kB
---
language:
- en
license: cc-by-4.0
task_categories:
- text-classification
tags:
- model-routing
- bbeh
- cost-quality
- lora
- embeddings
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: train
path: tables/train.jsonl
- split: development
path: tables/development.jsonl
- split: calibration
path: tables/calibration.jsonl
- split: test
path: tables/test.jsonl
---
# Train a router on Big-Bench Extra Hard
This release accompanies the self-contained [SIE train-a-router example](https://github.com/superlinked/sie/tree/codex/odsc-routing-course-20261018/examples/train-a-router). It contains the questions, observed answer-model outcomes, fixed embeddings, trained decision models and measurements needed to reproduce its cost–quality comparisons.
**On 975 held-out questions, an embedding classifier with learned cost estimates saved 16.7% with a 0.9-point accuracy loss; another preselected policy saved 39.7% with a 6.1-point loss. Both savings figures include the Cloud encoder fee.** These are held-out results from policies frozen before final answers were collected. The full curves are supplied so users can choose their own spending/accuracy tradeoff.
## Data and labels
The source is [Google DeepMind's Big-Bench Extra Hard](https://github.com/google-deepmind/bbeh/tree/80d12ca916b7158f22293fcf3144f4d3d854d4be), revision `80d12ca916b7158f22293fcf3144f4d3d854d4be`. Source-only duplicate, family and conflicting-reference checks retain 3,918 questions from 23 tasks. Identified source/context families never cross splits.
| Split | Questions | Use |
|---|---:|---|
| train | 1,969 | Fit correctness and cost predictors |
| development | 589 | Select model settings and training duration |
| calibration | 385 | Choose routing policies |
| test | 975 | Evaluate frozen policies |
Both `gpt-6-luna` and `gpt-6.1-sol` answered every retained question independently with medium reasoning, a 16,384-output-token limit and the same exact-answer format. The first terminal response is retained; truncated answers count as incorrect. Correctness comes from checking actual generated answers against BBEH references, not from a teacher guessing a route. Source-validated answer-format normalization and the original official grading result are preserved.
Each JSONL row has `id`, `task`, `family`, `question`, `reference_answer`, `luna_correct`, `sol_correct`, `luna_usd` and `sol_usd`. The richer artifacts bind model identities, selected responses, usage, source revision, grading code, feature hashes and training choices. Their immutable SHA-256 values are listed in `manifest.json`.
```python
# Load the public question/outcome tables with the Hugging Face datasets library.
from datasets import load_dataset
data = load_dataset("superlinked/train-a-router-bbeh")
```
Use the example's pinned `release.json` and `router.py fetch` for the exact published experiment rather than following the moving dataset branch.
## Compared recipes
- **Unchanged Laya:** a roughly 421-million-parameter ModernBERT decision model, queried separately about Luna and Sol correctness.
- **Laya with LoRA:** rank-16 attention updates and the existing decision head. Development selected three training passes; the model was then restarted and fitted on train + development.
- **Embedding neighbors:** average observed outcomes of 32 similar training questions.
- **Embedding classifiers:** two regularized logistic regressions on fixed 2,560-dimensional Qwen3-Embedding-4B vectors.
- **Cost variants:** each quality predictor is also evaluated with shared text/length predictors of per-model answer cost.
- **Controls:** text/length, text-predicted task, true task metadata, always-Luna, always-Sol and random routing. True task metadata is explicitly marked as metadata-assisted.
Laya is pinned to `convaiinnovations/laya` revision `aa8c91ca088ec597df95a0d1c76b3063cb2ae5e8`. Qwen is pinned to `Qwen/Qwen3-Embedding-4B` revision `5cf2132abc99cad020ac570b19d031efec650f2b`. The Qwen encoder stays fixed; its weights are not included here. Original Laya and merged adapted weights are included.
## Results and interpretation
| Method | Answer accuracy | Accuracy loss | Answer cost / 10k | Answer-cost savings |
|---|---:|---:|---:|---:|
| Always Sol | 80.8% | 0.0 points | $70.77 | 0.0% |
| Always Luna | 55.6% | 25.2 points | $12.23 | 82.7% |
| Unchanged Laya | 68.6% | 12.2 points | $41.82 | 40.9% |
| Laya + LoRA | 78.3% | 2.6 points | $56.80 | 19.7% |
| Embedding neighbors | 76.3% | 4.5 points | $53.80 | 24.0% |
| Embedding classifier | 76.8% | 4.0 points | $54.41 | 23.1% |
| LoRA + learned cost | 79.0% | 1.8 points | $57.63 | 18.6% |
| Embedding classifier + learned cost | 79.9% | 0.9 points | $58.16 | 17.8% |
| Text/length + learned cost | 79.0% | 1.8 points | $55.28 | 21.9% |
| Text-predicted task + learned cost | 80.1% | 0.7 points | $58.31 | 17.6% |
All router rows use a rule fixed before final collection: select the highest calibration accuracy under an **80% calibration answer-cost cap** relative to always-Sol. It is an illustrative spending level, not a required quality threshold or a guarantee of 20% test savings. The table reports final-test answer costs; add **$0.81 per 10,000 requests** for the Cloud encoder on embedding routes. For embedding + learned cost, that changes $58.16 to **$58.97**, or **16.7% savings** versus always-Sol at $70.77. Native and application hosting are separate. Every method, both cost variants and all preselected spending levels remain in the full report.
Answer costs use measured selected-response token usage and the price schedule pinned on 2026-10-21. The report separately shows projected SIE Cloud singleton encoder fees validated against 245 batches and 91 singleton calls; observed acquisition charges are retained separately. Native serving and application hosting are not treated as free; measured latency and an explicitly separate busy-resource hosting scenario are included. One-time acquisition/training costs are separate from per-request serving cost.
The final report includes all saved calibration candidates, 2,000 family-within-task bootstrap draws for pointwise uncertainty intervals, and random-routing comparisons. No final-test threshold or model selection is performed. A source-format sensitivity check removes two questions flagged before final collection and replays the same policies on 973 questions.
This tests new questions within the observed 23-task mixture, not unseen reasoning tasks. Public benchmark contamination in answer-model pretraining is not ruled out. Test labels are now public: a replay or refit using this release is a reproduction, not a new blind evaluation. A teacher-labeled deployment needs independently checked evaluation labels; teacher accuracy was not established by this experiment.
## Artifact groups
- `core`: questions, references, outcome labels, embeddings, small fitted heads, routing policies, reports and provenance.
- `weights`: the original and adapted Laya model trees.
- `recordings`: sanitized paired answer collection records, including selected response usage and retained transport-attempt accounting.
All runnable code lives in the [example folder](https://github.com/superlinked/sie/tree/codex/odsc-routing-course-20261018/examples/train-a-router); the dataset stores large evidence and trained artifacts. The [one-page instructions](https://github.com/superlinked/sie/blob/codex/odsc-routing-course-20261018/examples/train-a-router/QUICKSTART.md) give the execution sequence.
## Attribution and licenses
BBEH's source software is Apache-2.0; its other materials are CC-BY-4.0. This dataset preserves the upstream README, citations and license under `source/provenance/`. Please credit the BBEH authors and consult that README for the paper citation and task-specific attribution. The tabular data and derived question/outcome artifacts are distributed with that attribution under CC-BY-4.0.
Laya and Qwen model cards declare Apache-2.0. The original Laya model tree and its license notices are retained, and the LoRA adaptation is identified as a modification. Model cards, exact revisions and a component-level attribution record are under `metadata/licenses/` and `metadata/attribution.json`. The Laya weights retain their Apache-2.0 license; the dataset-card license does not replace component licenses.
Answer recordings contain model-generated outputs, not human-written reference answers. Credentials, environment dumps and provider-encrypted reasoning are excluded. This release contains public benchmark material and synthetic model responses; it contains no user production queries.