winzling-embed-SauerkrautLM-MoEdernColBERT-1.5M-weight-space-programming
| Runtime file | Uncompressed | Brotli, level 11 |
|---|---|---|
model_q8.onnx |
2.26 MB | 1.87 MB |
tokenizer.json |
1.57 MB | 0.41 MB |
runtime.json |
0.95 kB | 0.43 kB |
tokenizer_config.json |
0.73 kB | 0.30 kB |
| Client transfer size | 3.83 MB | 2.28 MB |
A multilingual ColBERT reranker in a 2.26 MB int8 (q8) ONNX graph, 64% smaller than the 6.29 MB fp32 graph and 1.87 MB as Brotli. Its quality matches the upstream fp32 model wherever the two can be compared, for example 0.597 against 0.591 nDCG@10 on NanoBEIR English. Against the original q8 graph it is significantly better on GermanDPR and GermanQuAD and significantly worse on none. The original graph cannot read Russian, because its tokenizer maps Russian to <unk>. For 240 KB more, this graph can: on Belebele, nDCG@10 rises from 0.072 to 0.681, and every one of the six Russian tasks improves significantly. It needs no GPU. On one CPU thread it reranks a query's top 25 passages in 89 ms in Node.js and in 161 ms in a browser with WebAssembly (medians on an Apple M5 Max, from the defuss-vectorsearch benchmark). Being q8 makes the download smaller, not inference faster or lighter: the graph computes in fp32.
| Benchmark, nDCG@10 | Upstream fp32 (6.29 MB as ONNX) | Original q8 ONNX (2.02 MB) | This q8 ONNX (2.26 MB) |
|---|---|---|---|
| NanoBEIR English (13 tasks) | 0.591 | 0.594 | 0.597 |
| GermanQuAD | n/a | 0.921 | 0.924 |
| GermanDPR | n/a | 0.782 | 0.791 |
| LegalQuAD | n/a | 0.391 | 0.379 |
| GerDaLIR | n/a | 0.062 | 0.064 |
| Dutch, mean of four card benchmarks | 0.524 | 0.524 | 0.526 |
| Belebele ru | n/a | 0.072 | 0.681 |
| belebele-tiny-20, ru | n/a | 0.090 | 0.725 |
| MIRACL-ru hard negatives | n/a | 0.013 | 0.350 |
| RiaNews hard negatives (ru) | n/a | 0.041 | 0.605 |
| RuBQ (ru) | n/a | 0.017 | 0.384 |
| XQuAD-ru | n/a | 0.160 | 0.861 |
The fp32 column shows the upstream model card's figures where this repository's harness reproduces the card for the original graph, within 0.004. For the other benchmarks it does not: for example, the card scores GerDaLIR and LegalQuAD with 8,192-token documents, and this graph caps inputs at 512 positions. The card reports no Russian results. The Dutch row averages four card benchmarks, which the full results below list one by one. The q8 columns are measured by that harness with exhaustive MaxSim. Bold marks the best score in each row at the precision shown. Between the two q8 graphs, only the GermanDPR, GermanQuAD and Russian differences are significant (paired bootstrap, 95% CI).
This is an edited q8 ONNX graph of VAGOsolutions/SauerkrautLM-MoEdernColBERT-1.5M, derived from the kyr0/SauerkrautLM-MoEdernColBERT-1.5M-ONNX export. model_q8.onnx and tokenizer.json in this repository are the round-4 artifact of 2026-11-08. It combines a weight edit that blends two distillation edits with a Cyrillic vocabulary extension. Both parts were evaluated with exhaustive MaxSim retrieval and paired bootstrap confidence intervals, on the upstream model card's own benchmark tasks and on six Russian retrieval tasks.
Summary:
- Upstream card benchmarks. The macro nDCG@10 is +0.0015 against the original (95% CI −0.0026 to +0.0054) and +0.0012 against the previously shipped round-2 edit (CI −0.0009 to +0.0033). GermanDPR (+0.008) and GermanQuAD (+0.003) improve significantly, and no benchmark gets significantly worse.
- Russian. The original tokenizer maps 95% of Russian content tokens to
<unk>, so the original model cannot read Russian. On six Russian tasks its nDCG@10 is at most 0.160. With 11,998 new Cyrillic tokens, this artifact gains significantly on all six: Belebele goes from 0.072 to 0.681, XQuAD-ru from 0.160 to 0.861 and MIRACL-ru from 0.013 to 0.350. - Other text is unchanged. For any text without Cyrillic letters, token ids and token vectors are bit-identical to the weight edit alone. This was checked in 19 languages. The graph grows by 240 KB.
The previously shipped round-2 graph is kept as model_q8.round2.onnx, and the original tokenizer as tokenizer.no-cyrillic.json. The older round-9 graph is kept as model_q8.round9-symmetric-rank16.onnx. All rounds are compared in WEIGHT-EXPERIMENTS.md.
Usage
This repository holds one graph, model_q8.onnx, with int8 weights and fp32 math. It turns token IDs into L2-normalized 128-dimensional token vectors, and ColBERT MaxSim over those vectors scores a query against a passage.
TypeScript and JavaScript
defuss-vectorsearch loads this graph as its default reranker, model: "1.5m", since version 0.3.0. It pins this repository's files to a commit, checks their SHA-256 and runs them in browsers (WASM) and in Node.js and Bun (WASM, or native ONNX Runtime with device: "cpu"):
npm install defuss-vectorsearch # or: bun add defuss-vectorsearch
npm install onnxruntime-node@1.21.0 # only for device: "cpu" in Node.js or Bun
import { createColbertReranker } from "defuss-vectorsearch/onnx.js"; // in browsers: "defuss-vectorsearch/browser.js"
const reranker = createColbertReranker({ model: "1.5m" });
const passages = [
"Die Zugspitze ist 2962 Meter hoch.",
"Эльбрус высотой 5642 метра — самая высокая гора России.",
"Paris is the capital of France.",
];
for (const question of ["Wie hoch ist die Zugspitze?", "Какая гора самая высокая в России?"]) {
const [best] = await reranker.rerank(question, passages, { topK: 1 });
console.log(question, "→", passages[best.index]);
}
await reranker.dispose();
rerankHits fuses this ranking with the hits of a dense search; the defuss-vectorsearch README covers both.
Python and other ONNX Runtime hosts
Inference needs three files:
hf download kyr0/winzling-embed-SauerkrautLM-MoEdernColBERT-1.5M-weight-space-programming model_q8.onnx tokenizer.json runtime.json --local-dir moederncolbert-1.5m-edit
- Inputs
input_idsandattention_mask: int64, shape [batch, sequence], at most 512 positions. - Output
token_embeddings: float32, shape [batch, sequence, 128], unit length per token. - Queries start with
[Q]and always use 32 positions: the tokenizer's padding ([MASK]) fills the rest, and every position counts in MaxSim. - Documents start with
[D]and use at most 512 positions. Padding and punctuation tokens are excluded from MaxSim. runtime.jsonholds this contract: the prefixes, the lengths, the padding ID and the punctuation IDs that document scoring skips.
The new tokenizer.json emits IDs up to 41,999 and needs this graph: the round-2 and original graphs fail on those IDs. This graph also accepts the old tokenizer (tokenizer.no-cyrillic.json) and then behaves exactly like the weight edit alone. Code that hard-codes a vocabulary size of 30,002 must be updated.
In Python, with onnxruntime, tokenizers and numpy:
from pathlib import Path
import json
import numpy as np
import onnxruntime as ort
from tokenizers import Tokenizer
folder = Path("moederncolbert-1.5m-edit") # from the hf download command above
config = json.loads((folder / "runtime.json").read_text())
tokenizer = Tokenizer.from_file(str(folder / "tokenizer.json"))
tokenizer.no_padding()
tokenizer.no_truncation()
session = ort.InferenceSession(str(folder / "model_q8.onnx"))
def encode(text, kind):
ids = tokenizer.encode(config["prefixes"][kind] + text).ids
limit = config["query_length"] if kind == "query" else config["max_document_length"]
if len(ids) > limit:
raise ValueError(f"{kind} has more than {limit} tokens; chunk it first")
width = limit if kind == "query" else len(ids)
input_ids = np.full((1, width), config["pad_token_id"], dtype=np.int64)
input_ids[0, : len(ids)] = ids
mask = (np.arange(width) < len(ids)).astype(np.int64)[None]
vectors = session.run(None, {"input_ids": input_ids, "attention_mask": mask})[0][0]
if kind == "query":
return vectors # all 32 positions count, including the [MASK] expansion
return vectors[~np.isin(input_ids[0], config["skip_token_ids"])]
def maxsim(query, document):
return float((query @ document.T).max(axis=1).sum())
passages = [
"Die Zugspitze ist 2962 Meter hoch.",
"Эльбрус высотой 5642 метра — самая высокая гора России.",
"Paris is the capital of France.",
]
documents = [encode(passage, "document") for passage in passages]
for question in ["Wie hoch ist die Zugspitze?", "Какая гора самая высокая в России?"]:
query = encode(question, "query")
best = max(zip((maxsim(query, document) for document in documents), passages))
print(question, "→", best[1])
Compressed downloads
All four runtime files also come precompressed: .br files from Brotli at quality 11 with a 16 MiB window, and .zst files from Zstandard at level 22. Each decompresses byte for byte to its original. Hugging Face sends model_q8.onnx uncompressed to every client. It compresses tokenizer.json on the fly only for clients that accept it, to 0.52 MB with Brotli.
| File | Plain | Brotli .br |
Zstandard .zst |
|---|---|---|---|
model_q8.onnx |
2.26 MB | 1.87 MB (−17%) | 1.91 MB (−16%) |
tokenizer.json |
1.57 MB | 0.41 MB (−74%) | 0.44 MB (−72%) |
| All four runtime files | 3.83 MB | 2.28 MB (−40%) | 2.34 MB (−39%) |
A client that accepts Brotli downloads about 2.78 MB of the plain runtime set, and 2.28 MB with the .br files:
hf download kyr0/winzling-embed-SauerkrautLM-MoEdernColBERT-1.5M-weight-space-programming model_q8.onnx.br tokenizer.json.br runtime.json.br --local-dir moederncolbert-1.5m-edit
brotli -d moederncolbert-1.5m-edit/model_q8.onnx.br moederncolbert-1.5m-edit/tokenizer.json.br moederncolbert-1.5m-edit/runtime.json.br
What was edited, and how
Weight edit: a blend of the round-2 and r3b edits
The blend. The blend is computed in the upstream PyTorch parameter space. With
P₀the dequantized original q8 weights, the edited weights areP = P₀ + 0.5 · (P_round2 − P₀) + 0.25 · (P_r3b − P₀). They are then requantized per output column (scale = max|column| / 127). reproduce/blend_edits.py builds the blend. With coefficients 0.75 and 0, it reproduces the previously shipped round-2 graph byte for byte.The two edits. The round-2 edit distills
SauerkrautLM-MoEdernColBERT-27Minto the layer-1 FFN experts, the final norm and the token projection, 458,880 parameters in all. The r3b edit distillsSauerkrautLM-MoEdernColBERT-115M, which shares the tokenizer, into every weight except the hash-embedding table and the two routers, 1,002,368 parameters in all. It trains with 512-token documents. Both edits use score-level distillation over one positive and seven hard negatives: a KL term at τ = 3 plus 0.1 × cross-entropy. Both also use a function-space anchor to the original model with weight 1.0, and straight-through int8 quantization during training. The routers stay frozen, so expert routing changes only through the changed inputs.Training data. Only train splits were used, from 17 sources: MS MARCO plus mMARCO de/nl, NQ, HotpotQA, GermanDPR, GermanQuAD, PubMedQA, SPECTER, StackExchange, GooAQ, ELI5, SQuAD, TriviaQA, BEIR-NL FiQA and SciFact, and MLDR-de. None of the card's evaluation splits were used.
Selection before testing. Nine candidates were compared: round 2, r3b, four blends and three λ values of a new edit called r3d. The first comparison used held-out dev rows of all 17 training sources. The candidates were then gated on out-of-domain sets never used for training:
- BEIR train splits: SciFact, FiQA and NFCorpus.
- Seven German and Dutch retrieval tasks: GermanGovService, MIRACL-de, XQuAD-de, bBSARD-NL, VABB, ArguAna-NL and SCIDOCS-NL.
- Belebele: BelebeleRetrieval and the project's 20-language benchmark.
The pre-registered rule (eval/round4-preregistration.md) takes the highest dev gain among candidates with no significant loss on any gate task or Belebele language. Only this blend qualified. The card was then run for it and for one declared alternative, the 0.5/0.5 blend.
Cyrillic vocabulary extension
Tokenizer. A Russian Unigram model with 12,000 pieces was trained on 134 MB of Cyrillic-only text, using the existing normalizer and pre-tokenizer. The text is a MIRACL-ru Wikipedia sample plus mMARCO-ru passages and queries. The 11,998 pieces that consist only of Cyrillic letters were appended as ids 30002 to 41999. Two placeholders that can never match sit at ids 30000 and 30001, which belong to
[Q]and[D]. A score shift on word-initial pieces makes the merged tokenizer split Russian words exactly as the Russian-only model does, for 40,000 of 40,000 held-out words. On held-out Russian text, the<unk>share falls from 42.6% to 1.4% of tokens.Why other text cannot change.
- A new piece contains only Cyrillic letters, so it can never match text without them.
- Every new score stays above the old minimum, so the penalty for unknown characters is unchanged.
- Punctuation and digits keep their old ids, so the document skiplist still applies.
Token ids are identical on 41,363 texts in 19 languages. Token vectors are identical (max |diff| = 0) on 1,008 query and document encodings.
Embedding rows. The graph's hash-embedding table stores int8 values with one scale per row. It gets 11,998 new 16-dimensional rows in that format, and nothing else in the graph changes. There are no new nodes, and the file grows by 239,961 bytes. Only the new rows were trained, with every other weight frozen. Each row starts as the mean of the original rows of its Latin transliteration. It is then fitted by score distillation with straight-through int8 rounding, on two sources:
- mMARCO-ru. This is 16,000 MS MARCO training queries with their translated passages, which keep the MS MARCO ids. The teacher is
SauerkrautLM-MoEdernColBERT-115Mscoring the English originals, so no Russian-capable ColBERT is needed. Besides the rows with Russian queries and Russian candidates, there are 4,000 rows with Russian queries and English candidates, and 4,000 with English queries and Russian candidates. - MIRACL-ru train. This is 4,683 queries with judged positives and negatives. The teacher is
BAAI/bge-reranker-v2-m3. Its logits are scaled by 0.645, a scale fitted on 1,000 mMARCO-ru rows against the 115M scores of their English side. On those rows the two teachers agree on the top candidate 62% of the time.
Training ran for two epochs with Adam. On 1,500 held-out Russian dev rows, nDCG@10 is 0.080 with the original tokenizer, 0.293 at initialization and 0.357 after training.
- mMARCO-ru. This is 16,000 MS MARCO training queries with their translated passages, which keep the MS MARCO ids. The teacher is
Exact weight change
This compares this repository's model_q8.onnx with the original q8 export. The data is in audit.json, produced by reproduce/audit_graph.py and reproduce/audit_final.py.
| Component | Change from the original export |
|---|---|
| Initializers changed | 137 of 141; unchanged are both routers and the two RoPE tables |
| Edited weights | 1,002,368 values (64.7% of the graph); 615,174 int8 codes changed; relative Frobenius change 3.9% overall |
| Token projection | 9.8% |
| Layer-1 routed and shared experts (27 matrices) | 5.0% to 6.5% each |
| Layer-0 routed and shared experts (27 matrices) | 1.3% to 1.9% each |
| Attention (8 matrices) | 0.9% to 2.2% each |
| Norms and the embedding projection | 0.2% to 1.0% |
| Hash-embedding table | first 30,002 rows byte-identical; 11,998 Cyrillic rows appended (30,002 × 16 becomes 42,000 × 16) |
| Graph nodes, inputs, outputs | unchanged |
tokenizer.json |
11,998 Cyrillic pieces appended; normalizer, pre-tokenizer, special tokens and added tokens unchanged |
runtime.json, tokenizer_config.json |
byte-identical |
| Graph size | 2,256,923 bytes (original 2,016,962) |
Measured retrieval results: the upstream card's benchmark
Protocol. The card's reproducible benchmarks are NanoBEIR English, GermanQuAD, GermanDPR, LegalQuAD, GerDaLIR, LegalQA-NL, NFCorpus-NL, DutchNewsArticles and OpenTender. Their MTEB task data is scored with exhaustive ColBERT MaxSim over the full corpus, with no candidate pool and no fusion. Scoring uses this repository's runtime contract:
[Q]and[D]prefixes.- 32 query positions with
[MASK]expansion. - Documents up to 512 tokens, with punctuation skipped.
nDCG@10 is averaged over queries. The change against the original q8 graph is a paired, per-query comparison with a stratified bootstrap 95% confidence interval from 10,000 resamples. NanoBEIR CIs are over the mean of its 13 tasks. Bold deltas have a CI that excludes zero.
The harness reproduces the card for the original graph where the numbers are comparable:
| Benchmark | This harness | Card |
|---|---|---|
| NanoBEIR | 0.594 | 0.591 |
| LegalQA-NL | 0.694 | 0.690 |
| NFCorpus-NL | 0.291 | 0.293 |
| DutchNews | 0.685 | 0.685 |
| OpenTender | 0.427 | 0.428 |
The card's MKQA, MIRACL and private NanoBEIR translations are not reproducible and were not run.
| Benchmark | Queries | Card (fp32) | Original q8 | Round 2 (previous) | Round 4 (this repository) | Blend 0.5/0.5 (not shipped) |
|---|---|---|---|---|---|---|
| NanoBEIR English (13 tasks) | 649 | 0.591 | 0.5939 | 0.5969 (+0.003 [-0.003, +0.009]) | 0.5973 (+0.003 [-0.003, +0.009]) | 0.5950 (+0.001 [-0.006, +0.009]) |
| GermanQuAD | 2204 | 0.976 | 0.9208 | 0.9231 (+0.002 [-0.000, +0.005]) | 0.9238 (+0.003 [+0.000, +0.006]) | 0.9240 (+0.003 [+0.000, +0.007]) |
| GermanDPR | 1025 | 0.796 | 0.7825 | 0.7909 (+0.008 [+0.002, +0.015]) | 0.7906 (+0.008 [+0.002, +0.014]) | 0.7965 (+0.014 [+0.007, +0.021]) |
| LegalQuAD | 200 | 0.794 | 0.3907 | 0.3774 (-0.013 [-0.032, +0.004]) | 0.3791 (-0.012 [-0.027, +0.003]) | 0.3818 (-0.009 [-0.028, +0.009]) |
| GerDaLIR (1k queries, doc-encoder) | 1000 | 0.354 | 0.0624 | 0.0620 (-0.000 [-0.002, +0.002]) | 0.0638 (+0.001 [-0.001, +0.004]) | 0.0652 (+0.003 [-0.000, +0.006]) |
| LegalQA-NL | 102 | 0.690 | 0.6938 | 0.6896 (-0.004 [-0.029, +0.021]) | 0.7001 (+0.006 [-0.023, +0.036]) | 0.6738 (-0.020 [-0.055, +0.014]) |
| NFCorpus-NL | 323 | 0.293 | 0.2906 | 0.2916 (+0.001 [-0.003, +0.005]) | 0.2890 (-0.002 [-0.006, +0.003]) | 0.2860 (-0.005 [-0.011, +0.001]) |
| DutchNewsArticles | 1000 | 0.685 | 0.6850 | 0.6868 (+0.002 [-0.005, +0.008]) | 0.6849 (-0.000 [-0.007, +0.007]) | 0.6848 (-0.000 [-0.008, +0.008]) |
| OpenTender | 1000 | 0.428 | 0.4272 | 0.4311 (+0.004 [-0.003, +0.011]) | 0.4315 (+0.004 [-0.002, +0.011]) | 0.4325 (+0.005 [-0.004, +0.014]) |
| Macro average over the nine benchmarks | Value | Δ vs original [95% CI] |
|---|---|---|
| Original q8 | 0.5385 | |
| Round 2 (previous) | 0.5388 | +0.0003 [−0.0035, +0.0040] |
| Round 4 (this repository) | 0.5400 | +0.0015 [−0.0026, +0.0054] |
| Blend 0.5/0.5 (not shipped) | 0.5377 | −0.0008 [−0.0056, +0.0039] |
Round 4 against round 2 is +0.0012 [−0.0009, +0.0033]. Per-task numbers are in eval/results-round4-card.json and WEIGHT-EXPERIMENTS.md.
No card query contains Cyrillic, but 262 of about 600,000 card documents do. The table therefore scores the shipped artifact itself, with the extended tokenizer. Against the weight edit alone, it changes the ranking of 4 queries: 1 in GermanDPR, 2 in GermanQuAD and 1 in NanoDBPedia.
Two caveats affect interpretation:
- GerDaLIR and LegalQuAD are not comparable with the card. The card evaluates those two with 8,192-token documents. This ONNX export caps positions at 512, so most of their relevant passages are truncated: GerDaLIR scores 0.062 here against the card's 0.354. The deltas between graphs are still valid, but the absolute numbers are not the card's. GermanQuAD (0.921 against 0.976) differs for the same reason, to a smaller degree.
- Small test sets are noisy. LegalQuAD has 200 queries and LegalQA-NL has 102. Their CIs span ±0.02 to ±0.03.
Russian
These are six Russian tasks, none of them used for training: MTEB BelebeleRetrieval (rus_Cyrl), the Russian slice of the project's 20-language benchmark, MIRACL-ru hard negatives (dev), RiaNews hard negatives, RuBQ and XQuAD-ru. They use the same protocol: exhaustive MaxSim and nDCG@10, with Δ against the original and a 95% CI.
| Task | Queries | Documents | Original q8 | Round-4 weights with the old tokenizer | Round 4 (this repository) |
|---|---|---|---|---|---|
| Belebele ru | 900 | 488 | 0.0716 | 0.0700 (-0.002 [-0.005, +0.001]) | 0.6805 (+0.609 [+0.579, +0.638]) |
| belebele-tiny-20, ru | 50 | 2,000 | 0.0896 | 0.1147 (+0.025 [+0.005, +0.050]) | 0.7250 (+0.635 [+0.495, +0.762]) |
| MIRACL-ru hard negatives | 1000 | 219,114 | 0.0126 | 0.0120 (-0.001 [-0.002, +0.001]) | 0.3502 (+0.338 [+0.317, +0.359]) |
| RiaNews hard negatives | 1000 | 191,237 | 0.0413 | 0.0382 (-0.003 [-0.006, -0.001]) | 0.6047 (+0.563 [+0.537, +0.591]) |
| RuBQ | 1692 | 56,826 | 0.0172 | 0.0173 (+0.000 [-0.001, +0.001]) | 0.3842 (+0.367 [+0.349, +0.385]) |
| XQuAD-ru | 1185 | 240 | 0.1603 | 0.1638 (+0.004 [-0.001, +0.009]) | 0.8605 (+0.700 [+0.677, +0.723]) |
For scale, Belebele ru at 0.68 is now close to French (0.72) and Italian (0.76) with the same graph. MIRACL-ru at 0.35 compares with MIRACL-de at 0.41.
Other languages
| Δ nDCG@10 vs the original q8 [95% CI] | Round 2 (previous) | Round 4 (this repository) |
|---|---|---|
| Belebele, 8 languages outside the training mix (ru, fr, es, it, pt, id, pl, tr) | +0.007 [+0.005, +0.010] | +0.085 [+0.081, +0.090] |
| Belebele, de/en/nl | +0.011 [+0.008, +0.015] | +0.013 [+0.010, +0.017] |
| belebele-tiny-20, primary nine languages (450 queries) | +0.041 [+0.027, +0.057] | +0.096 [+0.076, +0.117] |
| belebele-tiny-20, all twenty (1,000 queries) | +0.031 [+0.021, +0.041] | +0.061 [+0.049, +0.073] |
The Belebele and tiny-20 gains of round 4 over round 2 come from Russian. Without the new vocabulary, the round-4 weight edit alone gives +0.009, +0.013, +0.028 and +0.029 on these four rows, all significant; see WEIGHT-EXPERIMENTS.md. belebele-tiny-20 scores each language's queries against one shared 2,000-passage pool, which includes Russian passages. Because Russian passages now get distinct vectors, rankings for other languages' queries can shift a little. In the 19 other languages the shift is at most 0.013 nDCG@10, and none is significant.
Still unreadable: Arabic, Devanagari, Bengali, Thai, Hangul and CJK script still map to <unk>, because the tokenizer has no byte fallback. Ukrainian, Bulgarian, Serbian, Macedonian and Kazakh text now tokenizes almost without <unk>, in shorter pieces, but those languages were neither trained nor evaluated.
Verification and scope
- Export parity. The weight edit reproduces the upstream PyTorch model loaded with its exported, dequantized weights to a maximum token-vector error of 6.1 × 10⁻⁷ (reproduce/export_layer.py). The final graph reproduces the PyTorch model with the extended table and tokenizer on Russian queries and documents to 8.8 × 10⁻⁷ (reproduce/export_vocab.py).
- Rebuild. reproduce/rebuild_artifact.sh rebuilds
model_q8.onnxbyte for byte from the original export and the trained tensors inreproduce/ingredients/. It takes about a minute on CPU. - Structure.
audit.jsonrecords that nodes, inputs and outputs are byte-identical. It lists every changed initializer with its upstream parameter and change statistics, plus the vocabulary extension. - Cross-runtime parity. The live tests of defuss-vectorsearch run this graph in Node.js (native ONNX Runtime and WASM) and in Chromium (WASM). On 8 queries and 10 documents in German, English and Russian, their MaxSim scores stay within 0.001 of Python ONNX Runtime, with the same top document for every query (2026-11-08).
- Scope. Only the q8 graph is edited. The edit adds no nodes and does not change speed.
Earlier edits
Round 2, previously shipped and kept as model_q8.round2.onnx (SHA-256
de37b395…). It is the layer-1 FFN, norm and projection distillation from the 27M sibling at λ = 0.75. Its card macro is +0.0003, with GermanDPR +0.008 significant and everything else neutral.Round 4 alternatives, not shipped.
- The 0.5/0.5 blend gives the largest GermanDPR gain (+0.014) but loses on LegalQA-NL (−0.020, not significant). Its macro is −0.0011 against round 2.
- r3d, the r3b recipe with 2,331 extra NFCorpus-NL training rows, did not pass the selection rule. Its results are in WEIGHT-EXPERIMENTS.md.
The 0.5/0.5 blend graph is kept in eval/candidates/round4/.
Round 3, with the 115M teacher, not shipped. r3b edits all non-router weights at λ = 0.75. It gives GermanDPR +0.017 and GermanQuAD +0.004, both significant, but loses significantly on NFCorpus-NL (−0.011). Its macro is −0.0013. It is kept as eval/candidates/model_q8.round3-r3b-lam0.75.onnx.
Round 9, a symmetric rank-16 projection edit (SHA-256
89cf9e8c…). It was selected on the project's own 20-language rerank benchmark, but it is significantly worse than the original on five of the nine card benchmarks (macro −0.012). It is kept as model_q8.round9-symmetric-rank16.onnx.theta.npyandweight-results.jsonbelong to that round.Round 1, projection-only distillation at λ = 0.5. It is neutral on every card benchmark and was not shipped. Its results are in eval/results-round1-card.json.
Provenance
- Original ONNX export:
kyr0/SauerkrautLM-MoEdernColBERT-1.5M-ONNX, revisionf386a021490a5cd9202a049024561420655065ae. Original q8 SHA-2567d709c97fd59c8eaea361faeb20f55c7a61a9c718587f2f4d3023dcce77e8d11. - Upstream checkpoint:
VAGOsolutions/SauerkrautLM-MoEdernColBERT-1.5M, revision9d360b8b88ae11bea5784bf9012ff509fdd5c2da. It served as the PyTorch host for training and parity. - Teachers:
VAGOsolutions/SauerkrautLM-MoEdernColBERT-27M, revisiond2b7b1feaaac1bf87510ca9525208c3daeabcc5a, for round 2.VAGOsolutions/SauerkrautLM-MoEdernColBERT-115M, revision66380d2ade3b5027bba83bdcdba052d0bb86dcdb, for r3b and the mMARCO-ru rows.BAAI/bge-reranker-v2-m3, revision953dc6f6f85a1b2dbfca4c34a2796e7dde08d41e, for the MIRACL-ru rows.
- Russian data (train splits):
unicamp-dl/mmarco(Google-translated Russian queries and collection),miracl/miraclv1.0 ru train topics and qrels, andmiracl/miracl-corpusv1.0 ru. The Dutch rows for r3d come fromclips/beir-nl-nfcorpustrain. - This repository's files:
model_q8.onnx: SHA-256162a2b7cf814940cc79cfc154ae33309063fc9d0dde8d5f067373a6ba35be09b, 2,256,923 bytes.tokenizer.json: SHA-256d7b2ba6bf68fd03cdb4f728196da966ba169572c4c8c1f06deda4ff5ee058598.- The weight edit without the Cyrillic rows: eval/candidates/round4/model_q8.round4-blend-b5025-no-cyrillic.onnx, SHA-256
b617a14d55c8cee7385ec323f3678243432e01566d5b0e89df594e6b351f02fe.
- Evaluation and training: the scripts, the trained tensors and a one-command rebuild are in reproduce/, whose README gives the order of the full chain. The result JSONs, logs and candidate graphs are in eval/. Heavy steps run under
reproduce/memguard.py, memory-capped and strictly sequential. - Environment: Python 3.12, onnxruntime 1.31.1, torch 2.15.0, sentence-transformers 6.2.0, mteb 2.27.1, tokenizers (HF), macOS arm64.
Conversion
This graph keeps the structure of the original export. That export's card documents its four precisions and their cross-runtime parity: kyr0/SauerkrautLM-MoEdernColBERT-1.5M-ONNX. Its exporter re-implements the checkpoint's two attention and mixture-of-experts layers with plain tensor operations and exports them with torch.onnx.export (opset 17, dynamic batch and sequence axes). The graph includes the projection head and per-token normalization.
Changes from the upstream model, as required by the Apache License 2.0:
- Every routed expert is computed and the learned router gates weight their outputs. Results match upstream, but the graph does not skip unused experts.
- Positions are capped at 512; upstream's sliding-window attention for longer inputs is not exported.
- The graph stores int8 weights and computes in fp32. The routers stay fp32, because small router errors can change which experts run.
- The weights are edited and the vocabulary is extended, as described in What was edited, and how.
Limitations
- Only the q8 graph exists; there is no fp32, fp16 or int8 variant of this edit.
- q8 makes the download smaller than fp32; it does not make inference faster or reduce memory.
- Inputs are capped at 512 positions, so longer documents must be chunked.
- Arabic, Devanagari, Bengali, Thai, Hangul and CJK script still map to
<unk>(see Other languages).
License
Apache-2.0, the license of the upstream checkpoint. This graph is a derivative of VAGOsolutions/SauerkrautLM-MoEdernColBERT-1.5M.