faxenoff commited on
Commit
0aaf185
·
verified ·
1 Parent(s): 11e14c0

refresh the model card

Browse files
Files changed (1) hide show
  1. README.md +26 -45
README.md CHANGED
@@ -18,10 +18,6 @@ base_model:
18
  - intfloat/multilingual-e5-base
19
  - Alibaba-NLP/gte-modernbert-base
20
  - Qwen/Qwen3-Reranker-4B
21
- datasets:
22
- - CoIR-Retrieval/cosqa
23
- - CoIR-Retrieval/codesearchnet
24
- - CoIR-Retrieval/stackoverflow-qa
25
  ---
26
 
27
  # code-daemon-embed-v1
@@ -56,7 +52,7 @@ Queries and documents are embedded **the same way** — no `query:` / `passage:`
56
  3. The vector channel runs next to a lexical (BM25-style) channel and the two are fused.
57
 
58
  Point 3 matters: this model was trained to be **the dense half of a hybrid retriever**, not
59
- to win alone. Its training queries imitate real captured agent traffic — short keyword bags,
60
  behaviour descriptions, identifier fragments — rather than docstring paraphrases.
61
 
62
  ### Design choices vs a typical general-purpose text embedder
@@ -71,7 +67,7 @@ behaviour descriptions, identifier fragments — rather than docstring paraphras
71
  | Weights | FP32 / FP16 | **INT8** from quantization-aware training |
72
  | Top-rank precision | needs a separate cross-encoder pass | **cross-encoder ranking distilled into the vectors** |
73
 
74
- ### The built-in reranker
75
 
76
  A bi-encoder compresses each document into a vector *before* it sees the query, so it cannot
77
  do the pairwise comparison a cross-encoder reranker does. This model closes part of that gap
@@ -139,36 +135,25 @@ had already captured the useful part, at zero inference cost.
139
  no `last_hidden_state` copy, and no way to accidentally compare unnormalized vectors.
140
  - **Q/DQ nodes with QAT-trained scales**, so a TensorRT/OpenVINO build is INT8 end-to-end
141
  without a calibration pass.
142
- - **Ranking knowledge from a 4B cross-encoder** (the built-in reranker above).
143
  - **Four length-bucketed engine builds** with a dynamic sequence dimension (§3, §4.4).
144
 
145
- ### Training recipe, in brief
146
-
147
- 1. Strided depth truncation of the e5 backbone, vocabulary pruning, re-indexing to the
148
- raw-SentencePiece id convention.
149
- 2. **Dense representation distillation** from `Alibaba-NLP/gte-modernbert-base` (MSE against
150
- the teacher's embeddings) over real repository entities.
151
- 3. **Listwise-KL ranking distillation** from `Qwen/Qwen3-Reranker-4B` over mined hard
152
- negatives.
153
- 4. **Diversity regularization** — ~26% of the grouped training stream is out-of-domain
154
- code-retrieval pairs (CoIR-derived). Measured sweet spot: 0% loses deep recall, 50%
155
- dilutes the top.
156
- 5. **Self-distillation QAT** to INT8, exported with the scales learned during training.
157
-
158
- ### If you re-train, cut or re-quantize it
159
-
160
- Two results that will cost you a training run if you rediscover them yourself:
161
-
162
- - ⚠ **Do not run PTQ/calibration over the shipped INT8 graph.** It overwrites the trained
163
- scales with fitted ones and measurably degrades the model (cosine .93 against the correct
164
- export). `model_int8qdt.onnx` *is* the artifact — feed it to your builder as-is. Plain
165
- post-training quantization of this body was also tried on its own and is quality-broken:
166
- engine hit@1 fell .200 → .133, which is why the shipped weights come from QAT.
167
- - ⚠ **Heal a depth cut on documents *and* queries.** Re-distilling the 4-layer student
168
- against document texts only cost **−29.8% hit@1**; the same initialization and budget
169
- against documents *and* queries cost **−3.9%** on the same 2,441-query gate. Retrieval
170
- lives in the *relation* between the two sides — a document-only anchor lets the query side
171
- drift.
172
 
173
  ---
174
 
@@ -231,7 +216,9 @@ Three things to take from that table when you build your own serving path:
231
  ### Without a discrete GPU — OpenVINO on CPU, integrated GPU and NPU
232
 
233
  Same model, no NVIDIA card involved. Measured on an **Intel Core Ultra 9 275HX** — its CPU
234
- cores, its integrated GPU, and its *AI Boost* NPU — with OpenVINO 2026.3. An OpenVINO IR is
 
 
235
  reshaped to **one static shape** at build time (unlike the TensorRT engines, whose sequence
236
  dimension is a range), so each bucket is a single number per device:
237
 
@@ -321,8 +308,8 @@ php 31.59, go 31.06, python 30.68.
321
  long problem statements — the opposite of what this model was tuned for, and the spread proves
322
  it: 68.30 on Python docstring→code against 17.50 on cosqa's noisy question→code. Four of
323
  CoIR's ten tasks (code↔code translation, multi-turn dialogue, long problem statements) exceed
324
- the 128-token scope and are not shown. ~2k CoIR-derived rows were present in training as
325
- diversity regularization; overlap with the test splits was not audited.
326
 
327
  ---
328
 
@@ -507,19 +494,13 @@ normally.
507
 
508
  ---
509
 
510
- ## License & training data
511
 
512
  Released under the **MIT license**.
513
 
514
  The backbone (`intfloat/multilingual-e5-base`) is MIT; the teachers (`gte-modernbert-base`,
515
  `Qwen3-Reranker-4B`) are Apache-2.0. As is standard practice for distilled embedding models,
516
- the **weights are released under MIT**. Training corpus, for transparency:
517
-
518
- | Data | License note |
519
- |---|---|
520
- | Repository entity texts + synthetic search queries over an MIT-licensed codebase | MIT |
521
- | CoIR-derived code-retrieval pairs (~26% diversity stream) | per-subset CoIR licenses (research benchmark) |
522
- | Teacher embeddings / scores (gte-modernbert, Qwen3-Reranker-4B) | Apache-2.0 teachers |
523
 
524
  ## Attribution
525
 
 
18
  - intfloat/multilingual-e5-base
19
  - Alibaba-NLP/gte-modernbert-base
20
  - Qwen/Qwen3-Reranker-4B
 
 
 
 
21
  ---
22
 
23
  # code-daemon-embed-v1
 
52
  3. The vector channel runs next to a lexical (BM25-style) channel and the two are fused.
53
 
54
  Point 3 matters: this model was trained to be **the dense half of a hybrid retriever**, not
55
+ to win alone. Its training queries follow the shape an agent actually issues — short keyword bags,
56
  behaviour descriptions, identifier fragments — rather than docstring paraphrases.
57
 
58
  ### Design choices vs a typical general-purpose text embedder
 
67
  | Weights | FP32 / FP16 | **INT8** from quantization-aware training |
68
  | Top-rank precision | needs a separate cross-encoder pass | **cross-encoder ranking distilled into the vectors** |
69
 
70
+ ### Ranking distilled from a cross-encoder
71
 
72
  A bi-encoder compresses each document into a vector *before* it sees the query, so it cannot
73
  do the pairwise comparison a cross-encoder reranker does. This model closes part of that gap
 
135
  no `last_hidden_state` copy, and no way to accidentally compare unnormalized vectors.
136
  - **Q/DQ nodes with QAT-trained scales**, so a TensorRT/OpenVINO build is INT8 end-to-end
137
  without a calibration pass.
138
+ - **Ranking knowledge from a 4B cross-encoder** (the rank-distillation above).
139
  - **Four length-bucketed engine builds** with a dynamic sequence dimension (§3, §4.4).
140
 
141
+ ### How it was made, in brief
142
+
143
+ The e5 backbone was truncated in depth, its vocabulary pruned and re-indexed to the
144
+ raw-SentencePiece id convention, then trained by **distillation** — dense representation
145
+ distillation against the embedding teacher, plus **listwise-KL ranking distillation** against the
146
+ cross-encoder teacher, which is where the rank knowledge in section 1 comes from. The INT8 weights
147
+ come from **quantization-aware training**, not from a calibration pass, and the export carries the
148
+ scales learned during it.
149
+
150
+ ### ⚠ If you build your own engines from this ONNX
151
+
152
+ **Do not run PTQ/calibration over the shipped INT8 graph.** It overwrites the trained scales with
153
+ fitted ones and measurably degrades the model. `model_int8qdt.onnx` *is* the artifact — feed it to
154
+ your builder as-is (sections 4.4 and 4.5 show the TensorRT and OpenVINO invocations). This is the
155
+ failure mode that produces an engine which builds cleanly, loads cleanly and quietly retrieves
156
+ worse.
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  ---
159
 
 
216
  ### Without a discrete GPU — OpenVINO on CPU, integrated GPU and NPU
217
 
218
  Same model, no NVIDIA card involved. Measured on an **Intel Core Ultra 9 275HX** — its CPU
219
+ cores, its integrated GPU, and its *AI Boost* NPU (13 TOPS) — with OpenVINO 2026.3 and Intel
220
+ NPU driver 32.0.100.4841. Both versions matter for the NPU rows: the numbers moved by an order
221
+ of magnitude across an earlier OpenVINO release, so treat them as version-stamped. An OpenVINO IR is
222
  reshaped to **one static shape** at build time (unlike the TensorRT engines, whose sequence
223
  dimension is a range), so each bucket is a single number per device:
224
 
 
308
  long problem statements — the opposite of what this model was tuned for, and the spread proves
309
  it: 68.30 on Python docstring→code against 17.50 on cosqa's noisy question→code. Four of
310
  CoIR's ten tasks (code↔code translation, multi-turn dialogue, long problem statements) exceed
311
+ the 128-token scope and are not shown. A small share of out-of-domain retrieval pairs was
312
+ present in training as diversity regularization; overlap with the test splits was not audited.
313
 
314
  ---
315
 
 
494
 
495
  ---
496
 
497
+ ## License
498
 
499
  Released under the **MIT license**.
500
 
501
  The backbone (`intfloat/multilingual-e5-base`) is MIT; the teachers (`gte-modernbert-base`,
502
  `Qwen3-Reranker-4B`) are Apache-2.0. As is standard practice for distilled embedding models,
503
+ the **weights are released under MIT**. Not legal advice.
 
 
 
 
 
 
504
 
505
  ## Attribution
506