divy123's picture
Add files using upload-large-folder tool
d977783 verified
|
Raw History Blame Contribute Delete
12.1 kB
metadata
license: other
license_name: mixed-see-licenses
pretty_name: Sequential Router v2
task_categories:
  - text-generation
language:
  - en
tags:
  - llm-routing
  - model-selection
  - benchmark
size_categories:
  - 10M<n<100M
configs:
  - config_name: queries
    data_files: queries/queries_20k.parquet
    default: true
  - config_name: responses
    data_files: dataset/responses.parquet
  - config_name: response_features
    data_files: dataset/response_features.parquet
  - config_name: states
    data_files: dataset/states.parquet
  - config_name: candidates
    data_files: dataset/candidates.parquet

Sequential Router v2: a response-aware sequential multi-LLM routing dataset

Sequential Router v2 records, for 20,000 queries and 20 language models, every model's independent answer, a task-specific quality score, and the measured inference cost. On top of that matrix it provides routing states (query only, one, two or three models already called) with the offline outcome of every remaining candidate model:

delta_Q(M_j | S_t) = Q(R_j) - Q_best(S_t), positive_gain = max(0, delta_Q) (signed delta_Q is kept).

It is built for training and evaluating routers that decide, given the query and the responses observed so far, which model to call next or whether to STOP. Router-visible columns (feat_*) are computed only from the already-called models' responses; candidate responses and every quality value are label_* outcomes.

Contents

file description
queries/queries_20k.parquet the 20,000 generation queries (prompt, task family, source, split, gold payload, license tier)
queries/master_queries.parquet the 30,000-query curated master pool; 10,000 queries have no responses (expansion pool)
dataset/responses.parquet one row per (query, model): raw text, reasoning trace if separated, token counts, latency, GPU-seconds, log-prob statistics, quality Q, scorer provenance, label confidence
dataset/states.parquet 777,403 routing states with feat_* (router-visible) and label_* columns, oracle actions for lambda in [0.0, 0.1, 0.25, 0.5, 1.0, 2.0]
dataset/candidates.parquet 14,313,247 (state, candidate model) rows with label_Q, label_delta_Q, label_positive_gain, cost
dataset/response_features.parquet per-response router-visible features
manifests/ models, raw-source commits and hashes, splits, nested scaling subsets, waves, cost calibration, judge reliability
reports/dataset_report.md audit gates and descriptive statistics
code/ all construction scripts

Splits

Query-level 70/15/15 (train/val/test), stratified by task family and source dataset and grouped so related items (same passage, table, sentence pair, MBPP task, ...) never straddle splits. Splits are defined on the 30k master and inherited by the 20k subset. Nested train subsets (manifests/scaling_train_N_ids.json) are stratified; validation and test are fixed.

States

k states per query candidates
0 1 (query only, Q_best = 0) all 20 models
1 20 (complete) the other 19 (full one-model candidate matrix)
2 12 sampled ordered pairs (sample_stratum in random / weak / contains_best) remaining 18
3 6 sampled ordered triples remaining 17

Use sample_stratum == 'random' for analyses that need an unbiased state distribution.

Cost

gpu_seconds is a token-based allocation of measured wave GPU-time (8 x A100-80GB, vLLM continuous batching): rate = measured GPU-seconds per (completion + 0.1 x prompt) token for each model; latency_s is the measured per-request latency under saturated batching. cost_norm divides by the median training cost of the task family. See DATA_CARD for caveats.

Status

Audit verdict at build time: DATASET READY FOR ROUTER TRAINING: YES (see reports/dataset_report.md).

Usage

Each table has its own schema, so each is a separate config: queries, responses, response_features, states, candidates. Nothing is split by train/val/test at the file level; use the split column.

Load with datasets

from datasets import load_dataset

repo = "divy123/sequential-router-v2"
queries   = load_dataset(repo, "queries", split="train")      # 20,000 rows
responses = load_dataset(repo, "responses", split="train")    # 400,000 rows (20,000 queries x 20 models)
states    = load_dataset(repo, "states", split="train")       # 777,403 rows
# candidates is large (14.3M rows, ~49 MB parquet); stream it
candidates = load_dataset(repo, "candidates", split="train", streaming=True)

The single train split name is just the Hub default for a file; the real splits are in the split column (train / val / test).

Load with pandas

import pandas as pd

base = "hf://datasets/divy123/sequential-router-v2/"
q  = pd.read_parquet(base + "queries/queries_20k.parquet")
r  = pd.read_parquet(base + "dataset/responses.parquet")
st = pd.read_parquet(base + "dataset/states.parquet")
c  = pd.read_parquet(base + "dataset/candidates.parquet", columns=["state_id", "candidate_model", "label_Q", "label_delta_Q", "label_positive_gain", "cost_norm"])

Or download everything (about 2 GB) with huggingface_hub.snapshot_download("divy123/sequential-router-v2", repo_type="dataset").

Tables and keys

table key notes
queries query_id prompt, task_family, source_dataset, split, license_tier, gold payload / reference
responses (query_id, model_id) text, reasoning, token counts, log-prob statistics, Q (0-10), gpu_seconds, cost_norm, label_confidence
response_features (query_id, model_id) router-visible per-response feat_*
states state_id called_models (the ordered models already called), k (0-3), feat_* inputs, label_* outcomes and oracle actions per lambda
candidates (state_id, candidate_model) outcome of calling each remaining model: label_Q, label_delta_Q, label_positive_gain, cost

Join states to candidates on state_id, and either to queries on query_id. Only feat_* columns are valid router inputs; everything named label_* is an outcome and must not be fed to a router.

Example: build a training set for a next-model router

import pandas as pd

base = "hf://datasets/divy123/sequential-router-v2/"
st = pd.read_parquet(base + "dataset/states.parquet")
c  = pd.read_parquet(base + "dataset/candidates.parquet", columns=["state_id", "candidate_model", "label_positive_gain", "cost_norm"])  # 14.3M rows: select columns

st = st[st.sample_stratum.isin(["all", "random"])]       # unbiased state distribution
feat_cols = [col for col in st.columns if col.startswith("feat_")]

train = st[st.split == "train"]
rows = c.merge(train[["state_id", "task_family"] + feat_cols], on="state_id")
X = rows[feat_cols + ["candidate_model", "task_family"]]  # router-visible inputs
y = rows["label_positive_gain"]                           # target; subtract lambda * cost_norm for a cost-aware utility

Oracle actions for a cost trade-off lambda in {0.0, 0.1, 0.25, 0.5, 1.0, 2.0} are in label_oracle_action_l<lambda> (a model id or STOP) on states.

Notes

  • Normalise features and fit any encoders on the train split only.
  • sample_stratum is all for the complete k=0 and k=1 states, and random / weak / contains_best for sampled k=2 and k=3 states. Use all + random for unbiased evaluation; weak and contains_best were chosen using quality outcomes.
  • Raw model outputs are also provided per model in responses/*.jsonl and responses_truncated/*.jsonl, with per-source scores under scores/.
  • manifests/ holds the splits (gen20k_*_ids.json), nested training subsets for scaling studies (scaling_train_N_ids.json), model and source license tables, cost calibration and judge reliability.
  • Responses can be filtered by license_tier through queries (see Licenses and Withheld text below) if you need only permissively licensed source text.

Licenses

Annotations produced for this release (quality scores, states, costs) are released under CC-BY-4.0. Query text, gold payloads and model responses derive from third-party datasets and models with their own terms (some source datasets are CC-BY-SA; Gemma and Llama outputs carry those models' terms), so the dataset as a whole is labelled other: every query carries source_repo, source_license and license_tier, so subsets can be filtered. See LICENSES.md and DATA_CARD.md before any redistribution or commercial use.

Acknowledgements

This dataset is built on the work of many others. Please cite the original sources when you use the corresponding data.

Source datasets (Hub repo ids; license per hub metadata, see LICENSES.md and the per-query source_repo / source_license):

  • Math and reasoning: GSM8K (openai/gsm8k), MATH (EleutherAI/hendrycks_math), MGSM (juletxara/mgsm), BIG-Bench Hard (lukaemon/bbh), CommonsenseQA (tau/commonsense_qa)
  • Knowledge and science: MMLU-Pro (TIGER-Lab/MMLU-Pro), SuperGPQA (m-a-p/SuperGPQA), ARC (allenai/ai2_arc), Global-MMLU-Lite (CohereLabs/Global-MMLU-Lite)
  • Code: HumanEval (openai/openai_humaneval), MBPP (Muennighoff/mbpp), APPS (likaixin/APPS-verified), HumanEvalPack (bigcode/humanevalpack)
  • Summarization, simplification and generation: CNN/DailyMail (abisee/cnn_dailymail), XSum (EdinburghNLP/xsum), ASSET (facebook/asset), E2E NLG (tuetschek/e2e_nlg)
  • Translation: WMT14 (wmt/wmt14)
  • Extraction and classification: CoNLL-2003 (tomaarsen/conll2003), ADE Corpus v2 (ade-benchmark-corpus/ade_corpus_v2), AG News (fancyzhx/ag_news), Emotion (dair-ai/emotion), SST-5 (SetFit/sst5), TREC (CogComp/trec)
  • Instruction following: IFEval (google/IFEval), No Robots (HuggingFaceH4/no_robots, CC-BY-NC-4.0; used as base prompts for the synthetic IFEval-style items)
  • Reading comprehension, long context and tables: DROP (ucinlp/drop), SQuAD 2.0 (rajpurkar/squad_v2), LongBench (zai-org/LongBench), TabFact (wenhu/tab_fact)
  • Planning: generated Blocksworld, Tower of Hanoi and Sudoku instances (CC0, created for this dataset)

Text from the restricted and non-commercial sources is not redistributed here; only identifiers, scores and labels are. Obtain that text from the original sources under their terms.

Models whose outputs are included: Qwen3 (0.6B to 32B), DeepSeek-R1-Distill-Qwen (7B, 14B), Ministral-3-8B, Magistral-Small-2509, Gemma 3 (4B, 12B), Phi-4 and Phi-4-mini-reasoning, Granite 3.3 (2B, 8B), Llama 3.1 8B and Llama 3.2 3B, gpt-oss-20b, OLMo 3 7B. Gemma outputs are subject to the Gemma Terms of Use; Llama outputs are subject to the Llama 3.1 / 3.2 Community Licenses (Built with Llama).

Judges and metrics: Qwen3-30B-A3B-Instruct-2507 and gemma-3-27b-it (judges), COMET-22, BERTScore, SARI (evaluate), and the IFEval instruction checkers.

Thanks to the authors and maintainers of all of the above.

Withheld text

Text is published only for queries whose source has a permissive license (license_tier == "permissive_open": 14,752 of the 20,000 generation queries, 22,122 of the 30,000 master queries). For the other tiers (restricted, unspecified or non-commercial sources) all identifiers, scores, costs, states and labels are kept, but the source and response text is set to null: prompt, payload, reference and subject in queries, text, reasoning and answer_extracted in responses, the same fields in responses/*.jsonl, responses_truncated/*.jsonl and scores/obj/*.jsonl, and the judge's raw outputs (scores/judge/raw_*.jsonl) for those queries. The ids of the affected queries are listed in manifests/text_withheld_query_ids.json. To get the source text, run code/scripts_seqroute/fetch_raw.py and build_queries.py, which rebuild queries from the original sources (pinned in manifests/raw_sources.json) under their own terms; source_id identifies the original item.