MTEB-lite: named reference models (models.csv), per-task calibration (calibration.csv), eng (v2) + eng-super (v3 selection with 46 reference models)
ac198e3 verified Download code/mteb_lite_release_docs.py from ADIP-QCRI/MTEB-lite: direct link, hf CLI and curl.
- Browser
- Download file 19.5 kB
-
https://huggingface.co/datasets/ADIP-QCRI/MTEB-lite/resolve/main/code/mteb_lite_release_docs.py
- Command line
-
hf download hf://datasets/ADIP-QCRI/MTEB-lite/code/mteb_lite_release_docs.py
-
curl -L -o mteb_lite_release_docs.py https://huggingface.co/datasets/ADIP-QCRI/MTEB-lite/resolve/main/code/mteb_lite_release_docs.py
19.5 kB
| """README.md / SELECTION.md of the MTEB-lite release (used by mteb_lite_release.py).""" | |
| from __future__ import annotations | |
| import numpy as np | |
| SUITE_NAME = {"eng": "MTEB(eng, v2) (41 tasks)", "ara": "Arabic MMTEB (42 test tasks)"} | |
| def _f(x, nd=3): | |
| return "-" if x is None or (isinstance(x, float) and np.isnan(x)) else f"{x:.{nd}f}" | |
| def _agg_table(rep: dict) -> str: | |
| combo = rep["choice"]["combo"] | |
| lines = ["| protocol | estimate | macro tau | macro tau (resolvable pairs) | macro Pearson | macro MAE | mean tau | mean MAE | held-out models |", | |
| "|---|---|---|---|---|---|---|---|---|"] | |
| for proto, label in (("family", "family-level LOMO"), ("distinct", "distinct-model LOMO")): | |
| A = rep["aggregate"].get(proto, {}) | |
| for key, name in ((combo, "**MTEB-lite**"), ("random", "random K (single draw)"), ("pool", "whole candidate pool")): | |
| v = A.get(key) | |
| if not v: | |
| continue | |
| lines.append(f"| {label} | {name} | {_f(v['macro']['kendall'])} | {_f(v['macro'].get('tau_resolvable'))} | " | |
| f"{_f(v['macro']['pearson'])} | {_f(v['macro']['mae'], 2)} | {_f(v['mean']['kendall'])} | " | |
| f"{_f(v['mean']['mae'], 2)} | {v['macro']['n']} |") | |
| return "\n".join(lines) | |
| def _suite(cfg: str) -> str: | |
| return "ara" if cfg.startswith("ara") else "eng" | |
| def readme(st: dict, reps: dict, mans: dict, models: list[dict], cal: dict, notes: dict) -> str: | |
| cfgs = list(mans) | |
| suites = sorted({_suite(c) for c in cfgs}) | |
| model_suites = [su for su in ("eng", "ara") if f"tasks_with_full_score_{su}" in models[0]] | |
| size_rows = [] | |
| for cfg in cfgs: | |
| s = st.get(cfg, {}) | |
| m = mans[cfg] | |
| size_rows.append(f"| `{cfg}` | {m['benchmark']} | {m['n_tasks']} | {m['K']} | {m['selection_version']} | " | |
| f"{s.get('items', '-')} | {s.get('texts', '-')} | {_f(s['tokens'] / 1e6, 2) if s else '-'}M | " | |
| f"~{_f(s.get('minutes_0.6B'), 1) if s else '-'} min |") | |
| val = "\n\n".join(f"### `{cfg}` (K = {mans[cfg]['K']}, selection {mans[cfg]['selection_version']}; chosen variant " | |
| f"{reps[cfg]['choice']['combo']})\n\n{_agg_table(reps[cfg])}" for cfg in cfgs) | |
| cal_txt = [] | |
| for cfg in cfgs: | |
| rows = cal[cfg] | |
| r = [x["fit_pearson_r"] for x in rows if x["fit_pearson_r"] == x["fit_pearson_r"]] | |
| sd = [x["fit_residual_sd"] for x in rows] | |
| cal_txt.append(f"| `{cfg}` | [`{cfg}/calibration.csv`]({cfg}/calibration.csv) | {len(rows)} | " | |
| f"{_f(float(np.median(r)))} | {_f(float(np.min(r)))} | {_f(100 * float(np.median(sd)), 2)} |") | |
| weak = [] | |
| for cfg in cfgs: | |
| w = [f"{x['task']} (r={x['fit_pearson_r']:.2f})" for x in cal[cfg] if not (x["fit_pearson_r"] >= 0.3)] | |
| if w: | |
| weak.append(f"`{cfg}`: " + ", ".join(w)) | |
| weak_txt = ("* **Weakly calibrated tasks** (in-sample fit r < 0.3; their estimates stay close to the reference-model mean, " | |
| "so they add little ranking signal). A constant subset statistic, e.g. 20 clustering items over hundreds of " | |
| "labels where every item is its own cluster, gives r = 0:\n " + "; ".join(weak)) if weak else "" | |
| role_cols = [c for c in models[0] if c.startswith("role_")] | |
| mrows = [] | |
| for x in sorted(models, key=lambda x: ({"ADIP release": 0, "Qwen base": 1, "public": 2, "ADIP merge": 3}[x["type"]], | |
| x["display_name"])): | |
| used = [c[5:] for c in role_cols if x[c].startswith("selection")] | |
| full = ", ".join(f"{su}: {x[f'tasks_with_full_score_{su}']}" for su in model_suites | |
| if x.get(f"tasks_with_full_score_{su}") not in (None, "", "0", 0)) | |
| mrows.append(f"| {x['display_name']} | `{x['internal_id']}` | {x['type']} | {x['suites_scored']} | {full or '-'} | " | |
| f"{', '.join(used) if used else 'not used'} |") | |
| ara_txt = notes.get("ara", "") | |
| eng_note = notes.get("eng", "") | |
| return f"""--- | |
| license: other | |
| license_name: per-task-source-licenses | |
| pretty_name: MTEB-lite | |
| viewer: false | |
| tags: | |
| - mteb | |
| - embeddings | |
| - benchmark | |
| - evaluation | |
| language: | |
| - en{chr(10) + '- ar' if 'ara' in suites else ''} | |
| --- | |
| # MTEB-lite | |
| **MTEB-lite** is a set of small subsets of embedding benchmarks that estimate a text-embedding model's | |
| full-benchmark scores at a small fraction of the cost: | |
| {chr(10).join(f'* `{c}`: {SUITE_NAME[_suite(c)]}, K = {mans[c]["K"]} items per task' for c in cfgs)} | |
| For every task, a fixed set of items (queries, test examples, sentence pairs, clustering items, documents, bitext | |
| pairs) was chosen from a candidate pool. The subset's statistic, after a per-task linear calibration, tracks the | |
| full-task main score across a diverse set of reference models. | |
| This repository contains **only item ids, selection weights, item-model parameters and calibration coefficients, | |
| plus code**. No text from any dataset is redistributed. `mteb_lite.py` rebuilds the selected items from the | |
| original datasets through `mteb` (dataset revisions pinned by mteb {mans[cfgs[0]]['mteb_version']}) and evaluates a model | |
| with mteb's own per-task prompts. | |
| ## Configs | |
| | config | benchmark | tasks | K (items / task) | selection | items | texts to encode | tokens | encode time, 0.6B model* | | |
| |---|---|---|---|---|---|---|---|---| | |
| {chr(10).join(size_rows)} | |
| \\* Qwen3-Embedding-0.6B at about 30k tokens/s on one GPU, the rate we measured in our full MTEB runs. Tokens are counted with the | |
| Qwen3 tokenizer, including instruction prefixes{'; Arabic texts are capped at 512 tokens, as in our Arabic MMTEB eval' if 'ara' in suites else ''}. | |
| {eng_note} | |
| Layout: `<config>/manifest.json` holds the task list, main scores, dataset paths / revisions, K, estimators, calibration | |
| and reference models. `<config>/<Task>.json` holds the selected ids plus whatever scoring needs, and `<config>/calibration.csv` | |
| the per-task calibration. `mteb_lite.py` is the loader + evaluator, `validation/<config>.{{md,json}}` the validation | |
| reports, `SELECTION.md` the selection method, `models.csv` the reference models, and `code/` the scripts used to build pools, | |
| score models, select and evaluate. | |
| ## Usage | |
| ```bash | |
| pip install "mteb==1.39.7" sentence-transformers numpy scikit-learn | |
| python mteb_lite.py --model sentence-transformers/all-MiniLM-L6-v2 --config eng-super --out result.json | |
| ``` | |
| ```python | |
| from mteb_lite import evaluate, load_task | |
| res = evaluate("BAAI/bge-small-en-v1.5", config="eng") # an mteb model name, or any mteb Encoder object | |
| res["estimated_macro"], res["estimated_mean"] # estimated benchmark macro (mean over task types) / mean (x100) | |
| res["rows"]["ArguAna"] # subset statistic + calibrated full-task estimate | |
| task = load_task("eng", "STS12") # the selected items with their texts | |
| ``` | |
| The model is called exactly as mteb calls it: `model.encode(texts, task_name=..., prompt_type=query|document|None)`. | |
| Instruction models therefore get their own per-task instructions. Pass `mteb.get_model(name)` (or just the name) for | |
| models mteb knows; wrap other models in an mteb Encoder. For the Arabic configs, set the model's max sequence length to | |
| 512 to match the reference runs. | |
| ## Calibration | |
| For every task, `full_estimate = a + b * subset_statistic`. The subset statistic is one of: | |
| * `weighted_mean`: the anchor-weighted mean of the per-item outcomes; | |
| * `pirt`: the p-IRT estimate of the pool score (observed items + item-model predictions for the rest); | |
| * `gp`: the average of the two; | |
| * `set_metric`: Spearman / weighted AP / V-measure of the selected items (STS, pair classification, clustering). | |
| `a` and `b` are least-squares fits over the config's reference models that have a full score for the task. The | |
| benchmark estimates are the **macro** (mean over task types of the mean over tasks) and the **mean** (over tasks) of the | |
| per-task estimates, x100. The coefficients are in every `<config>/<Task>.json`, in `<config>/manifest.json`, and in: | |
| | config | file | tasks | median fit r | min fit r | median residual SD (points) | | |
| |---|---|---|---|---|---| | |
| {chr(10).join(cal_txt)} | |
| The fit r and residual SD are in-sample (on the fitting models). Out-of-sample accuracy is in the validation tables below. | |
| ## What each task file contains (ids only) | |
| * **Retrieval:** the selected query ids, and per query its candidate document ids (BM25 top-30 over the full corpus + its | |
| relevant documents, at most 100) and its qrels; also the ids of the random corpus documents shared by all queries. A query is | |
| ranked against its own candidates + the shared random documents, and its nDCG@10 is the item outcome. | |
| * **Reranking:** the selected samples (row indices). Each keeps its own candidate list from the dataset. The outcome is AP | |
| (nDCG@10 for MIRACL-style main scores). | |
| * **Classification:** the selected test rows, the train rows that mteb's undersampling protocol draws (n_experiments x | |
| samples_per_label per label, seed 42) and the per-experiment row lists. The outcome is the fraction of the logistic-regression | |
| experiments that are correct. | |
| * **BitextMining:** the selected gold pairs plus a fixed set of distractor target sentences per language pair. The outcome is 1 if | |
| the gold target is the nearest neighbour. | |
| * **STS / PairClassification / Clustering:** the selected pair / item rows (+ pair label weights, clustering label depth), | |
| scored as sets. | |
| * **Summarization:** the selected document ids; the outcome is the per-document Spearman. | |
| * **p-IRT tasks:** additionally the ids, weights and item parameters of the whole candidate pool (no texts). | |
| **Id scheme.** We use the source dataset's own ids where they exist (retrieval query / document ids, SummEval | |
| document ids). Otherwise an id is `<prefix><row>`, the row index in the evaluation split of the dataset exactly as | |
| `mteb==1.39.7`'s `task.load_data()` returns it (after mteb's own `dataset_transform`). The prefix is `r` (reranking sample), | |
| `t` (test example), `p` (pair, flattened pair list), `s` (STS pair), `c` (clustering item) or `b` (bitext gold pair). | |
| Classification train rows are train-split row indices. Retrieval task files also store a 16-hex SHA-1 of every needed | |
| query / document text, and the loader matches texts by these hashes. This is needed because some mteb loaders (e.g. | |
| MintakaRetrieval, MKQARetrieval, PublicHealthQA, XPQARetrieval) number queries and documents via `enumerate(set(...))`, so | |
| their ids change from process to process. The hashes also act as an integrity check. In multi-subset tasks (the Arabic | |
| configs), ids are prefixed with | |
| `<hf_subset>|`, and bitext targets are `<language or subset>|<row>`. Each task file records the dataset path, revision, | |
| eval split and hf_subset(s). | |
| {ara_txt} | |
| ## Reference models | |
| Selection and calibration use a diverse **reference set**: our model families, each thinned to at most 3 models (best / | |
| median / worst by full score), plus every public and base model. Every model that was scored is listed below and in | |
| `models.csv`, which also gives each model's role per config, internal id, family and merge recipe. Our merges are | |
| described only by their merge recipe. | |
| | model | internal id | type | suites scored | tasks with full scores | used in configs | | |
| |---|---|---|---|---|---| | |
| {chr(10).join(mrows)} | |
| ## Validation | |
| Validation is leave-one-out, with selection and calibration redone without the held-out models: | |
| * **family-level LOMO** holds out a whole model family at a time. This is the honest test of generalisation to a new kind of model. | |
| * **distinct-model LOMO** holds out one reference model at a time. | |
| We report the Kendall tau / Pearson / MAE between the estimated and the true benchmark macro and mean (x100) for the | |
| held-out models that have full scores on all tasks. "Resolvable pairs" are model pairs whose true scores differ by at least | |
| 0.5 points. The baselines are K uniformly random items (metrics averaged over 10 single draws) and the whole candidate pool, | |
| which is the ceiling for any subset of it. Per-task tables are in `validation/`. | |
| {val} | |
| ## Limitations | |
| * **The reference set is dominated by Qwen3-Embedding-based models:** our merges of fine-tuned Qwen3-Embedding-0.6B and the | |
| Qwen base models, plus the public models listed above. The calibration is linear, so estimates for very different models are | |
| extrapolations. Expect the ranking to be more reliable than the absolute scores. | |
| * **Set-level tasks** (STS Spearman, pair-classification AP, clustering V-measure) are not sums over items, so per-item IRT | |
| does not apply. They are scored as sets on anchor points of per-item outcomes. Clustering with 20 items is very noisy. | |
| {weak_txt} | |
| * **Pool ceiling.** Items come from candidate pools: up to 1,000 queries per retrieval task with BM25-30 candidates + random | |
| documents, and up to 1,000 items per other task. A retrieval query is scored against its candidate set, not the full | |
| corpus. Even the whole pool only reaches the tau in the "whole candidate pool" rows. Much of the residual tau error comes from | |
| near-tied models (less than 0.5 points apart); see the resolvable-pairs column. | |
| * **Main-score families.** Pair-classification main scores are max-AP over similarity functions; the subsets use cosine | |
| AP and rely on calibration. Bitext mining uses nearest-neighbour accuracy against fixed distractors in place of mteb's F1. | |
| ## License | |
| This repository ships only ids, weights, coefficients and code. Each task's data remains under its source dataset's | |
| license, and `mteb_lite.py` downloads it from the original source at evaluation time. Code: Apache-2.0. | |
| ## Citation | |
| ```bibtex | |
| @misc{{mteb_lite_2026, | |
| title = {{MTEB-lite: validated small subsets of MTEB(eng, v2) and Arabic MMTEB}}, | |
| author = {{ADIP team, QCRI}}, | |
| year = {{2026}}, | |
| note = {{https://huggingface.co/datasets/ADIP-QCRI/MTEB-lite}} | |
| }} | |
| ``` | |
| Please also cite MTEB / MMTEB and the source datasets of the tasks you report. | |
| ## Contact | |
| easgari@hbku.edu.qa | |
| """ | |
| def selection_md(reps: dict, mans: dict) -> str: | |
| fam_txt = [] | |
| for cfg, r in reps.items(): | |
| fams = r.get("families", {}) | |
| fam_txt.append(f"**`{cfg}`** ({len(r['reference'])} models, {len(fams)} families):\n\n" | |
| + "\n".join(f"* {k}: kept {', '.join(v['kept'])} (of {len(v['members'])})" for k, v in sorted(fams.items()))) | |
| chosen = "\n".join(f"* `{cfg}` (selection {mans[cfg]['selection_version']}): per-item tasks **{rep['choice']['per_item']}**, " | |
| f"set-metric tasks **{rep['choice']['set_metric']}**, K = {mans[cfg]['K']}" | |
| for cfg, rep in reps.items()) | |
| return f"""# MTEB-lite: selection method | |
| ## 1. Candidate pools (per task, from the eval split mteb uses) | |
| * **English (`eng*`):** MTEB(eng, v2), with each task's English subset and test split. | |
| * **Arabic (`ara*`):** the 42 Arabic MMTEB test tasks. Each is restricted to its Arabic hf_subsets (Arabic, and | |
| Arabic-English pairs) and to the split our Arabic MMTEB evaluation uses. Multi-subset tasks get their items split evenly over subsets, | |
| and their task score is the mean over subsets, as in mteb. Texts are capped at 512 tokens. | |
| Per task type: | |
| * **Retrieval:** up to 1,000 queries with at least one relevant document (seed 0). Each query keeps its own candidate list: the | |
| BM25 top 30 over the full corpus (Okapi k1=0.9, b=0.4) plus its relevant documents (at most 100). Random corpus documents | |
| shared by all queries are added: 1,000, or max(200, 1000/#subsets) per subset for multi-subset tasks. | |
| * **Reranking:** up to 1,000 samples with their own candidate lists. Arabic MIRACLReranking was cut to 300 queries because of encode cost. | |
| * **Classification:** up to 1,000 test examples (label-stratified). The train rows are the ones mteb's undersampling protocol draws (seed 42). | |
| * **Pair classification:** up to 1,000 pairs, balanced by label. AP is reweighted to the full label prior. | |
| * **STS:** up to 1,000 pairs, stratified by 5 gold-score bins. | |
| * **Clustering:** up to 1,000 items, stratified by label; hierarchical label levels are kept. | |
| * **Summarization:** all SummEval documents. | |
| * **Bitext mining (Arabic):** up to 1,000 gold pairs. Each language pair gets a fixed set of up to 1,000 distractor targets, | |
| and parallel datasets reuse the same rows. | |
| ## 2. Per-item outcomes (one model x one item) | |
| | type | outcome | | |
| |---|---| | |
| | Retrieval | nDCG@10 of the query | | |
| | Reranking | average precision (nDCG@10 for MIRACL-style main scores) | | |
| | Classification | fraction of the n_experiments logistic regressions (mteb protocol) that are correct | | |
| | Summarization | Spearman(human relevance, max cosine to references) of the document | | |
| | Bitext mining | 1 if the gold target is the nearest of target + distractors | | |
| | STS | 1 - abs(percentile(cos) - percentile(gold)) | | |
| | Pair classification | correctness at the accuracy-optimal cosine threshold | | |
| | Clustering | 1 if the item's k-means cluster majority label equals its label | | |
| ## 3. Reference models and full scores | |
| Model families are merge recipes or training runs; every public or base model is its own family. At most 3 models are kept | |
| per family (best / median / worst by full score). Full scores come from our own mteb 1.39.7 runs for our models and the Qwen | |
| base models. For public models they come from the official MTEB results (English: test split of MTEB(eng, v2); Arabic: the same | |
| Arabic subsets / split, available for only 15-31 of the 42 tasks per public model; a model enters a task only where it has a | |
| full score). For English, 18 additional public models (BGE, E5, GTE, Arctic-Embed, mxbai, MiniLM / mpnet, LaBSE, GIST, UAE) | |
| were scored in selection v3 to add diversity. | |
| {chr(10).join(fam_txt)} | |
| ## 4. Item models and selection | |
| The model ability is theta = the full-task score, standardised over the training models. Per item: | |
| * **continuous outcomes:** a linear-Gaussian factor model, y = a * theta + b + e; | |
| * **binary outcomes:** 2PL, sigmoid(alpha * theta + beta), L2-regularised. | |
| Candidates evaluated: | |
| * **anchor**: tinyBenchmarks anchor points. K-means groups the items' outcome vectors over the training models; the anchor is the | |
| item nearest to each centroid, and its weight is the cluster's share of the pool. | |
| * **fisher**: a greedy maximum of sum over models of log(eps + information). | |
| * **estimators**: the weighted subset mean; p-IRT (MAP theta from the selected items, with the rest of the pool predicted); and gp, their average. | |
| * **set-metric tasks**: stratified random, or anchor points on the per-item outcomes. Each estimate is mapped by a per-task | |
| linear calibration fitted on the reference models. | |
| ## 5. Validation protocol | |
| * **family-level LOMO:** for every family, select + calibrate without it and predict its models. | |
| * **distinct-model LOMO:** the same, one reference model at a time. | |
| * **metrics:** Kendall tau / Pearson / MAE of the predicted vs true benchmark macro (mean over type means) and mean (over | |
| tasks), for the held-out models with all full scores. We also report tau on resolvable pairs (difference of at least 0.5 points). | |
| * **baselines:** uniform random K (metrics averaged over 10 single draws) and the whole pool. | |
| ## 6. Chosen variants | |
| {chosen} | |
| Variants were chosen among {{anchor, fisher}} x {{mean, p-IRT, gp}} x {{stratified, anchor set}} on the same LOMO folds, | |
| which makes the numbers mildly optimistic. | |
| """ | |