DylanCouzon commited on
Commit
d9d575a
·
verified ·
1 Parent(s): 1cfae6c

constella-zero — FastEmbed-first card, run p35w-2m-s2500

Browse files
Files changed (1) hide show
  1. README.md +124 -193
README.md CHANGED
@@ -1,273 +1,202 @@
1
  ---
2
  license: mit
3
  language: en
4
- library_name: numpy
5
  tags:
 
 
 
6
  - retrieval
7
- - sentence-similarity
8
  - asymmetric-dual-encoder
9
  - edge
10
- - quantized
11
  base_model: NovaSearch/stella_en_400M_v5
12
  pipeline_tag: feature-extraction
13
  ---
14
 
15
- # zero — a query encoder with no transformer in it
16
 
17
- `zero` is the query side of an **asymmetric dual encoder**. Documents are indexed once, in the
18
- cloud, by a large frozen encoder ([`NovaSearch/stella_en_400M_v5`](https://huggingface.co/NovaSearch/stella_en_400M_v5),
19
- 1024-d). Queries are encoded on the edge by **this table**: 30,522 × 1024 int8 rows and one
20
- pooling rule. Encoding a query is a gather and a weighted sum — **no transformer, no matmul,
21
- no GPU**. Sub-millisecond per query on one CPU core; the whole query asset is **31.8 MB**.
22
 
23
- It was distilled from stella so that its output lands in stella's document space. Cosine
24
- similarity against stella document vectors is the score.
 
25
 
26
- > **Research preview.** This model **missed its own release bar** — see [Results](#results).
27
- > It is published so the architecture can be tested, not as a recommended drop-in retriever.
28
- > Read the results section before using it for anything.
 
 
 
 
 
 
29
 
30
  ## Usage
31
 
32
- The query side needs `numpy` and `tokenizers`. That is the entire runtime.
33
 
34
  ```python
35
- # pip install numpy tokenizers huggingface_hub
36
- from huggingface_hub import snapshot_download
37
- import sys
38
 
39
- d = snapshot_download("DylanCouzon/zero-query-encoder-v1") # ~94 MB
40
- sys.path.insert(0, d)
41
- from zero_encoder import ZeroQueryEncoder
42
-
43
- enc = ZeroQueryEncoder(d, variant="int8") # or "fp16"
44
- q = enc.encode(["how do mrna vaccines work?"]) # (1, 1024), L2-normalized
45
  ```
46
 
47
- ### ONNX
48
-
49
- The same query path is also an ONNX graph, so you can serve it without numpy or `tokenizers`
50
- Python — no transformer, still a gather and a sum. `model.onnx` returns the pooled, normalized
51
- vector; `model_tokens.onnx` returns one weighted row per token, for pipelines that do their own
52
- masked-mean pooling (fastembed's, for instance).
53
 
54
- ```python
55
- # pip install onnxruntime tokenizers
56
- import numpy as np, onnxruntime as ort
57
- from tokenizers import Tokenizer
58
-
59
- tok = Tokenizer.from_file(f"{d}/tokenizer.json") # padding/truncation already correct
60
- sess = ort.InferenceSession(f"{d}/model.onnx", providers=["CPUExecutionProvider"])
61
-
62
- encs = [tok.encode(t) for t in ["how do mrna vaccines work?", "who invented the barometer"]]
63
- L = max(len(e.ids) for e in encs)
64
- ids = np.zeros((len(encs), L), np.int64)
65
- attn = np.zeros((len(encs), L), np.int64)
66
- for i, e in enumerate(encs):
67
- ids[i, :len(e.ids)], attn[i, :len(e.ids)] = e.ids, 1
68
-
69
- Q = sess.run(None, {"input_ids": ids, "attention_mask": attn})[0] # (2, 1024), normalized
70
- assert Q.shape == (2, 1024)
71
- ```
72
 
73
- Both graphs are opset 17, standard operators only, and carry the table as an **int8 initializer
74
- with a per-row fp32 scale** dequantized in-graph — so each is ~31 MB rather than the 125 MB fp32
75
- rows would cost. **You need exactly one of `model.npz`, `model.onnx` or `model_tokens.onnx`**, not
76
- all three; the repo ships all of them so you can pick your runtime.
77
 
78
- Documents are encoded by the frozen teacher — **pin the revision**, the table is only valid
79
- against this exact document space:
80
 
81
  ```python
82
- # pip install sentence-transformers
83
- from sentence_transformers import SentenceTransformer
84
- import numpy as np
85
-
86
- doc_model = SentenceTransformer(
87
- "NovaSearch/stella_en_400M_v5",
88
- revision="ffeb2b7ee715c226d4ffe5e4619f7dbb48624c20",
89
- trust_remote_code=True,
90
- # required unless xformers is installed; also the pinned setting the table was distilled under
91
- config_kwargs={"use_memory_efficient_attention": False, "unpad_inputs": False},
92
- )
93
  docs = [
94
  "mRNA vaccines deliver a strand of messenger RNA encoding a viral antigen.",
95
  "The Treaty of Westphalia ended the Thirty Years' War in 1648.",
96
  ]
97
- D = doc_model.encode(docs, normalize_embeddings=True) # no prefix on the document side
98
-
99
- scores = q @ D.T
100
- print(docs[int(np.argmax(scores))])
101
  ```
102
 
103
- That asymmetry is the point: `doc_model` runs once per document, in the cloud. `enc` runs on
104
- every query, on the device, and costs almost nothing.
105
-
106
- ## Using it with Qdrant
107
 
108
- The output is an ordinary 1024-d dense vector, so no special handling is needed. Both sides are
109
- L2-normalized, which means `DOT` ranks identically to `COSINE` and is cheaper.
110
 
111
  ```python
112
  from qdrant_client import QdrantClient, models
113
 
114
  client = QdrantClient(":memory:") # or your cluster
115
  client.create_collection("docs", vectors_config=models.VectorParams(
116
- size=1024, distance=models.Distance.DOT))
117
  client.upsert("docs", points=[
118
  models.PointStruct(id=i, vector=D[i].tolist(), payload={"text": t})
119
- for i, t in enumerate(docs)]) # D from the document encoder above
120
 
121
- hits = client.query_points("docs", query=q[0].tolist(), limit=5).points
122
- print(hits[0].payload["text"]) # q is the (1, 1024) array from Usage above
123
  ```
124
 
125
- **On the edge, put the table in the store too.** A second collection holds one point per vocab
126
- row, created with `hnsw_config=models.HnswConfigDiff(m=0)` — it is retrieve-by-id only, and
127
- indexing it inflated the shard from 466 MB to 1.82 GB for no benefit. The query path becomes
128
- tokenize → fetch rows by id → pool → search, with no model weights in your process at all.
129
 
130
- **If you fuse with BM25, the fusion rule matters.** The system that ties OpenSearch (0.4911)
131
- uses **convex score fusion at w=0.8**, not RRF: on development sets RRF scored 0.5504 against
132
- convex's 0.5727. Qdrant's native `Fusion.RRF` is therefore a *different, weaker* operating point,
133
- not the published one — combine the scores yourself to reproduce it. Dense-only in Qdrant
134
- reproduces 0.4339 exactly **with exact search** — the HNSW advice above is about cost, and ANN
135
- recall is a separate confound the published numbers deliberately avoid.
136
 
137
- Scalar-quantizing the document index to int8 halves it to ~1.02 GB per 1M vectors, but **that
138
- was never measured for quality here** — treat it as untested. (The int8 quality-free result
139
- above is about the *query table*, not the document index.)
140
 
141
- ### The rule, if you reimplement it
 
142
 
143
- Tokenize with the bundled WordPiece tokenizer (`add_special_tokens=True`, truncate at 512,
144
- **no padding**, no prefix). A token appearing `c` times in the query carries **total weight
145
- `sqrt(c)`**, not `c`. Sum the rows, divide by the weight sum, L2-normalize. An empty or
146
- near-zero-norm bag falls back to the normalized `[CLS]` row (id **101**; row 0 is `[PAD]`).
147
- `zero_encoder.py` is 89 lines and is the reference. `config.json` carries the rule and its
148
- fingerprint (`adb24fb2e8cad66f`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
  ## Files
151
 
152
- | file | what |
153
- |---|---|
154
- | `model.npz` | `rows_int8` (30522×1024) + `int8_scale`, and `rows_fp16` for reference |
155
- | `model.onnx` | the whole query path as one opset-17 graph → `(b, 1024)` pooled + normalized |
156
- | `model_tokens.onnx` | the same, emitting `(b, s, 1024)` per-token weighted rows for pipelines that pool themselves |
157
- | `config.json` | the frozen preprocessing rule, teacher pin, document-encoder spec, shas |
158
- | `zero_encoder.py` | the whole query path — numpy + tokenizers, no torch |
159
- | `tokenizer.json`, `vocab.txt`, … | stella's WordPiece tokenizer, copied at the pinned revision — with the two edits below |
160
-
161
- **Two deliberate edits to the copied tokenizer files.** stella's own files declare
162
- `model_max_length: 32768`, `max_length: 8000` and fixed-512 padding; the frozen rule here — and
163
- the document index — are **512 with no padding**. This bundle ships `model_max_length: 512`,
164
- `max_length: 512` and `padding: null`. `config.json` records the original values under
165
- `tokenizer_deviation_from_teacher`.
166
-
167
- Precisely what that changes, by caller:
168
-
169
- | caller | before | after |
170
  |---|---|---|
171
- | `zero_encoder.py` (the reference path) | 512, no padding | unchanged — **byte-identical output**; it calls `no_padding()` and reads truncation from `config.json` |
172
- | `tokenizers` directly | every `encode` padded to 512 | ragged unless you enable padding yourself |
173
- | `transformers` | `model_max_length` 32768, so `truncation=True` with no explicit length truncated at 32768 | 512 — but truncation and padding still happen only when the *call* asks for them |
174
- | Sentence Transformers | requests truncation itself and may impose its own `max_seq_length` | unchanged in that respect; only the underlying default moves to 512 |
175
- | fastembed's tokenizer loader | truncation 8000, fixed-512 padding kept | truncation 512, dynamic padding |
176
 
177
- The reference path is unaffected either way, so no published number changes; only what a
178
- third-party loader does with the same files. The fastembed row is about
179
- `fastembed.common.preprocessor_utils.load_tokenizer` only — **this repo ships no ONNX graph**, so
180
- there is no fastembed inference path to describe yet.
181
 
182
- Per-token learned weights are **folded into the rows**, so the int8 artifact is self-contained.
183
- `int8` is the variant every published number below was measured on; it was measured
184
- quality-free against `fp16` (upper bound **0.00013** nDCG@10).
 
185
 
186
  ## Results
187
 
188
- nDCG@10, exact search (no ANN, so recall is not a confound), on six BEIR datasets. These are
189
- **confirmatory** numbers from a single pre-registered run against frozen comparator vectors —
190
- the system was frozen (sha `a7007b1a…`) before any of them were observed.
191
 
192
- | system | arguana | fiqa | nfcorpus | scidocs | scifact | trec-covid | **avg-6** |
193
  |---|---|---|---|---|---|---|---|
194
- | **`zero` (int8)** | 0.5916 | 0.3728 | 0.3124 | 0.1677 | 0.6101 | 0.5490 | **0.4339** |
195
- | `zero` + BM25, fused | 0.5975 | 0.4026 | 0.3497 | 0.1881 | 0.7068 | 0.7018 | **0.4911** |
196
  | BM25 alone | 0.4878 | 0.2532 | 0.3180 | 0.1565 | 0.6791 | 0.6099 | 0.4174 |
197
- | stella, symmetric (the teacher ceiling) | 0.6369 | 0.5536 | 0.4134 | 0.2395 | 0.7796 | 0.8234 | 0.5744 |
198
 
199
- The three registered comparisons, paired bootstrap + sign-flip, Holm-corrected across the family:
 
200
 
201
- | | Δ | 95% CI | verdict |
202
- |---|---|---|---|
203
- | `zero` > LightRetriever dense (0.4583) | **−0.0243** | [−0.0405, −0.0086] | **miss, resolved below the bar** |
204
- | `zero` > BM25 (0.4174) | +0.0165 | [+0.0017, +0.0311] | CI passes, multiplicity does not — unresolved |
205
- | fused > OpenSearch sparse (0.4868) | +0.0043 | [−0.0063, +0.0151] | **statistical tie** |
206
 
207
- **What that means.** A pure lookup table retains **75.5%** of its teacher's quality on these six
208
- sets at ~1/1000 of the query-side cost, and beats BM25 on average — but it does **not** beat a
209
- comparable small dense query encoder, and the honest headline is the miss. The one bright spot
210
- is fusion: `zero` + BM25 is a **statistical tie with OpenSearch's learned sparse retriever**
211
- while its query side remains a table lookup plus token counts.
212
-
213
- ### Caveats you should read before trusting a number
214
 
215
  - **Teacher contamination.** stella discloses **ArguAna** and **FiQA** in its training data —
216
- exactly this system's two strongest datasets. On the four sets with no disclosed overlap
217
- (nfcorpus, scidocs, scifact, trec-covid), `zero` is **below BM25** (−0.0311 [−0.0517, −0.0109]).
218
- - **Distribution.** Training was Wikipedia- and e-commerce-shaped. Retention is 0.915 on
219
- in-distribution development sets and 0.755 on these six. Expect the low number out of domain.
220
- - **English only**, 512 wordpieces, WordPiece-30522 vocab. Out-of-vocabulary terms degrade to
221
- their subword rows; heavily fragmented queries are where the gap with a real encoder is widest.
222
- - The table is a **bag of tokens**. Word order, negation and syntax are not represented at all.
 
 
 
 
223
 
224
  ## Costs
225
 
226
  | | |
227
  |---|---|
228
- | query asset (int8 rows + scales + tokenizer) | **31.8 MB** |
229
- | query encode, batch 1, one CPU core | **0.38 ms** (`zero_encoder.py` measures ~0.07 ms) |
230
- | `model.onnx`, batch 1, one thread, 8-token query | **0.047 ms** |
231
- | `model.onnx`, batch 1, one thread, 512-token query | **1.22 ms** |
232
- | hydration (cold load to first query) | **0.22 s** |
233
- | document index, 1024-d fp16 | 2.05 GB per 1M documents |
234
- | document index, 1024-d int8 | 1.02 GB per 1M documents |
235
-
236
- The ONNX graph derives token counts from an all-pairs comparison, so its cost grows with the
237
- SQUARE of the sequence length — 26x from an 8-token query to a 512-token one. Real queries sit at
238
- the short end (the dev set's median is 13 wordpieces), but a long one is not free.
239
 
240
- For reference at the document side: LightRetriever 3.07, OpenSearch sparse 1.40,
241
- bge-small 0.77 GB/1M. `zero`'s document index is not cheap — the trade is all on the query side.
 
242
 
243
  ## Training
244
 
245
- L2 regression of the table's pooled output onto stella's query embeddings, over 340,850
246
- approved pairs plus 220,632 query-text-only rows. Sources: **Amazon ESCI** (Apache-2.0),
247
- **FEVER**, **HotpotQA**, **SQuAD**, **NQ-open**, **TriviaQA**, **Mr. TyDi (en)**.
248
 
249
- **MS MARCO is permanently excluded** from this lineage — its terms forbid commercial use.
250
- (Measured cost of that exclusion: +0.0058 [−0.0015, +0.0131] avg-6 had it been included, which
251
- still misses the bar. The gap is architectural, not licensing.)
252
 
253
- ### Attribution
254
-
255
- NQ, SQuAD, HotpotQA, FEVER and Mr. TyDi derive from Wikipedia and are **CC BY-SA** (3.0/4.0).
256
- Amazon ESCI is Apache-2.0. The teacher, `NovaSearch/stella_en_400M_v5`, is MIT.
257
-
258
- ## Revisions
259
-
260
- | | |
261
- |---|---|
262
- | first published | 2026-09-03 — the frozen M7 bundle, with stella's tokenizer files copied verbatim |
263
- | ONNX added | 2026-09-03, commit `fb8e5c5b` — `model.onnx` and `model_tokens.onnx`; the `.npz` and its numbers unchanged |
264
- | tokenizer fixed | 2026-09-03, commit `1aa60418` — `tokenizer_config.json` `model_max_length`/`max_length` 32768/8000 → 512, `tokenizer.json` `padding` `Fixed(512)` → `null`, and one broken snippet in this card fixed |
265
-
266
- `model.npz` is byte-identical across both (sha `a7007b1a…`) and the reference encoder's output is
267
- unchanged, so **no published number differs between revisions**. Pass `revision=` to
268
- `snapshot_download` if you need to pin one.
269
-
270
- ## Citation / provenance
271
 
272
  ```
273
  run_id p35w-2m-s2500
@@ -276,3 +205,5 @@ teacher NovaSearch/stella_en_400M_v5 @ ffeb2b7ee715c226d4ffe5e4619f7d
276
  preproc prefix="" · add_special_tokens · max_length=512 · pool_mode=sqrt
277
  preproc fingerprint adb24fb2e8cad66f
278
  ```
 
 
 
1
  ---
2
  license: mit
3
  language: en
4
+ library_name: fastembed
5
  tags:
6
+ - fastembed
7
+ - qdrant
8
+ - onnx
9
  - retrieval
 
10
  - asymmetric-dual-encoder
11
  - edge
 
12
  base_model: NovaSearch/stella_en_400M_v5
13
  pipeline_tag: feature-extraction
14
  ---
15
 
16
+ # constella-zero
17
 
18
+ The query side of an **asymmetric dual encoder**: documents are indexed once, in the cloud, by a
19
+ large frozen encoder; queries are encoded on the device by **a lookup table**.
 
 
 
20
 
21
+ There is no transformer here. The model is 30,522 × 1024 int8 rows and one pooling rule —
22
+ encoding a query is a gather and a weighted sum. The query asset is **31.8 MB** and a query costs
23
+ **~0.05 ms** on one CPU core.
24
 
25
+ It was distilled from [`stella_en_400M_v5`](https://huggingface.co/NovaSearch/stella_en_400M_v5)
26
+ so that its output lands in that model's document space. The matching document encoder is
27
+ published as [`stella-en-400M-v5-doc-onnx`](https://huggingface.co/DylanCouzon/stella-en-400M-v5-doc-onnx);
28
+ the two are only meaningful together.
29
+
30
+ *constella = constellation + stella: navigate by fixed stars, no engine.*
31
+
32
+ > **Research preview.** It is a bag of tokens and behaves like one. Read
33
+ > [Results](#results) and [Limits](#limits) first.
34
 
35
  ## Usage
36
 
37
+ The snippets in this section run in order, sharing state.
38
 
39
  ```python
40
+ from fastembed import TextEmbedding
 
 
41
 
42
+ NAME = "DylanCouzon/constella-zero"
43
+ query_model = TextEmbedding(NAME)
44
+ q = next(iter(query_model.embed(["how do mrna vaccines work?"]))) # (1024,), L2-normalized
 
 
 
45
  ```
46
 
47
+ Not in a FastEmbed release yet. Until it is:
 
 
 
 
 
48
 
49
+ pip install "fastembed @ git+https://github.com/Dylancouzon/fastembed@add-constella-models"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
 
51
+ FastEmbed fetches only `model.onnx` and the tokenizer — about 31 MB, not the whole repo. Pooling
52
+ and L2 normalization happen inside the graph.
 
 
53
 
54
+ ### The document side
 
55
 
56
  ```python
57
+ DOC_NAME = "DylanCouzon/stella-en-400M-v5-doc-onnx"
58
+
59
+ doc_model = TextEmbedding(DOC_NAME) # 1.75 GB, runs in the cloud, once per document
 
 
 
 
 
 
 
 
60
  docs = [
61
  "mRNA vaccines deliver a strand of messenger RNA encoding a viral antigen.",
62
  "The Treaty of Westphalia ended the Thirty Years' War in 1648.",
63
  ]
64
+ D = list(doc_model.embed(docs))
 
 
 
65
  ```
66
 
67
+ That asymmetry is the point: `doc_model` is a 400M-parameter transformer that runs once per
68
+ document. `query_model` runs on every query, on the device, and costs almost nothing.
 
 
69
 
70
+ ### With Qdrant
 
71
 
72
  ```python
73
  from qdrant_client import QdrantClient, models
74
 
75
  client = QdrantClient(":memory:") # or your cluster
76
  client.create_collection("docs", vectors_config=models.VectorParams(
77
+ size=1024, distance=models.Distance.COSINE))
78
  client.upsert("docs", points=[
79
  models.PointStruct(id=i, vector=D[i].tolist(), payload={"text": t})
80
+ for i, t in enumerate(docs)])
81
 
82
+ hits = client.query_points("docs", query=q.tolist(), limit=5).points
83
+ print(hits[0].payload["text"])
84
  ```
85
 
86
+ Qdrant implements cosine as a dot product — it normalizes on upsert and compares with dot — so
87
+ `COSINE` costs the same as `DOT` here without assuming the caller preserved unit norm.
 
 
88
 
89
+ The table itself can also live in Qdrant, as a retrieve-by-id collection of one point per vocab
90
+ row (`hnsw_config=models.HnswConfigDiff(m=0)` — indexing it is pure waste), so the query path holds
91
+ no model weights at all.
 
 
 
92
 
93
+ ### Without FastEmbed
 
 
94
 
95
+ `zero_encoder.py` is the reference implementation — 93 lines, `numpy` and `tokenizers`, no torch.
96
+ This downloads the whole repo, not just the 31 MB graph.
97
 
98
+ ```python
99
+ from huggingface_hub import snapshot_download
100
+ import sys, numpy as np
101
+
102
+ d = snapshot_download("DylanCouzon/constella-zero")
103
+ sys.path.insert(0, d)
104
+ from zero_encoder import ZeroQueryEncoder
105
+
106
+ enc = ZeroQueryEncoder(d, variant="int8") # or "fp16"
107
+ q_np = enc.encode(["how do mrna vaccines work?"]) # (1, 1024), L2-normalized
108
+ assert np.abs(q_np[0] - q).max() < 1e-5 # the vector FastEmbed just produced
109
+ ```
110
+
111
+ ## How it works
112
+
113
+ Tokenize (WordPiece, special tokens on, truncate at 512, no padding, no prefix). A token appearing
114
+ `c` times carries **total weight `sqrt(c)`** — repetition saturates. Sum the rows, divide by the
115
+ weight sum, L2-normalize. An empty or near-zero-norm bag falls back to the normalized `[CLS]` row
116
+ (id 101). Per-token learned weights are folded into the rows, so the artifact is self-contained.
117
+
118
+ Because pooling is not a masked mean, it is done inside the ONNX graph rather than by the caller.
119
+ `config.json` carries the rule and its fingerprint (`adb24fb2e8cad66f`).
120
+
121
+ `int8` is the variant every number below was measured on; it is loss-free against `fp16` to within
122
+ 0.00013 nDCG@10.
123
 
124
  ## Files
125
 
126
+ You need exactly one of these three.
127
+
128
+ | file | for | size |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  |---|---|---|
130
+ | `model.onnx` | FastEmbed, or any ONNX runtime — pooled and normalized, `(b, 1024)` | 31 MB |
131
+ | `model_tokens.onnx` | pipelines that insist on pooling themselves, `(b, s, 1024)` | 31 MB |
132
+ | `model.npz` | the numpy reference path | 94 MB |
 
 
133
 
134
+ Both graphs are opset 17, standard operators only, carrying the table as an int8 initializer with a
135
+ per-row fp32 scale dequantized in-graph.
 
 
136
 
137
+ The bundled tokenizer files are stella's, with `model_max_length`/`max_length` set to **512** and
138
+ `padding` to **null** — the rule the document index was built with. stella ships 32768/8000 and
139
+ fixed-512 padding, which any loader honouring those fields would otherwise apply.
140
+ `config.json` records the originals under `tokenizer_deviation_from_teacher`.
141
 
142
  ## Results
143
 
144
+ nDCG@10 on six BEIR datasets, exact search so ANN recall is not a confound. Measured once, on the
145
+ table shipped here (sha `a7007b1a…`).
 
146
 
147
+ | system | arguana | fiqa | nfcorpus | scidocs | scifact | trec-covid | **average** |
148
  |---|---|---|---|---|---|---|---|
149
+ | **constella-zero (int8)** | 0.5916 | 0.3728 | 0.3124 | 0.1677 | 0.6101 | 0.5490 | **0.4339** |
150
+ | + BM25, convex fusion | 0.5975 | 0.4026 | 0.3497 | 0.1881 | 0.7068 | 0.7018 | **0.4911** |
151
  | BM25 alone | 0.4878 | 0.2532 | 0.3180 | 0.1565 | 0.6791 | 0.6099 | 0.4174 |
152
+ | the teacher, used on both sides | 0.6369 | 0.5536 | 0.4134 | 0.2395 | 0.7796 | 0.8234 | 0.5744 |
153
 
154
+ A lookup table retains **75.5%** of the teacher's quality (0.4339 / 0.5744), with a query side
155
+ that does no matrix multiplication at all.
156
 
157
+ The fused row is **weighted score fusion**, `0.8 × dense + 0.2 × BM25` on min-max normalized
158
+ scores — not reciprocal rank fusion, so Qdrant's `Fusion.RRF` will not reproduce it.
 
 
 
159
 
160
+ ## Limits
 
 
 
 
 
 
161
 
162
  - **Teacher contamination.** stella discloses **ArguAna** and **FiQA** in its training data —
163
+ two of the six above, and ArguAna is its second-highest score. On the four sets with no
164
+ disclosed overlap it averages **0.4098 against BM25's 0.4409** — below BM25. Weight the
165
+ average accordingly.
166
+ - **It is a bag of tokens.** Word order, negation and syntax are not represented: "dog bites man"
167
+ and "man bites dog" give the same vector.
168
+ - **Out of domain it drops.** Training was Wikipedia- and e-commerce-shaped, and the six sets
169
+ above are further from that than the data it was fitted on.
170
+ - **English only**, 512 wordpieces, 30,522-token WordPiece vocab. Out-of-vocabulary terms degrade
171
+ to subword rows.
172
+ - **The document side is not cheap** — 2.05 GB per 1M documents at 1024-d fp16. The whole trade is
173
+ on the query side.
174
 
175
  ## Costs
176
 
177
  | | |
178
  |---|---|
179
+ | query asset (int8 rows + scales + tokenizer) | 31.8 MB |
180
+ | `model.onnx`, batch 1, one thread, 8-token query | 0.047 ms |
181
+ | `model.onnx`, batch 1, one thread, 512-token query | 1.22 ms |
182
+ | `zero_encoder.py`, batch 1, one CPU core | 0.38 ms |
183
+ | hydration (cold load to first query) | 0.22 s |
184
+ | document vectors, 1024-d fp16 / int8 | 2.05 / 1.02 GB per 1M — raw payload, before index overhead |
 
 
 
 
 
185
 
186
+ The graph derives token counts from an all-pairs comparison, so cost grows with the **square** of
187
+ sequence length — 26x from an 8-token query to a 512-token one. Real queries sit at the short end
188
+ (median 13 wordpieces).
189
 
190
  ## Training
191
 
192
+ L2 regression of the table's pooled output onto the teacher's query embeddings, over 340,850
193
+ pairs plus 220,632 query-text-only rows, from **Amazon ESCI**, **FEVER**, **HotpotQA**, **SQuAD**,
194
+ **NQ-open**, **TriviaQA** and **Mr. TyDi (en)**. No MS MARCO.
195
 
196
+ Attribution: NQ, SQuAD, HotpotQA, FEVER and Mr. TyDi are Wikipedia-derived and **CC BY-SA**
197
+ (3.0/4.0); Amazon ESCI and TriviaQA are Apache-2.0; the teacher is MIT.
 
198
 
199
+ ## Provenance
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
  ```
202
  run_id p35w-2m-s2500
 
205
  preproc prefix="" · add_special_tokens · max_length=512 · pool_mode=sqrt
206
  preproc fingerprint adb24fb2e8cad66f
207
  ```
208
+
209
+ Published as `zero-query-encoder-v1` and renamed on 2026-09-03; the old URL redirects.