Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- README.md +154 -0
- doc_ids.npy +3 -0
- doclens.npy +3 -0
- documents.npy +3 -0
- gt_top100.tsv +3 -0
- qrels.test.tsv +0 -0
- queries.npy +3 -0
- queries_ids.npy +3 -0
- query_lens.npy +3 -0
- token_ids.npy +3 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
gt_top100.tsv filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: msmarco_answerai_colbert_small
|
| 3 |
+
license: cc-by-sa-4.0
|
| 4 |
+
tags:
|
| 5 |
+
- multi-vector
|
| 6 |
+
- late-interaction
|
| 7 |
+
- colbert
|
| 8 |
+
- embeddings
|
| 9 |
+
- retrieval
|
| 10 |
+
- text
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# msmarco_answerai_colbert_small
|
| 14 |
+
|
| 15 |
+
Multi-vector (late-interaction) embeddings of **BEIR msmarco** (`beir/msmarco/dev`), encoded with
|
| 16 |
+
**[lightonai/answerai-colbert-small-v1](https://huggingface.co/lightonai/answerai-colbert-small-v1)** at revision `e507cd12947a2b4b52201d150967df3c19a90590`.
|
| 17 |
+
|
| 18 |
+
**Source data:** [ir_datasets](https://ir-datasets.com/beir.html#beir/msmarco/dev) `beir/msmarco/dev` (ir_datasets 0.6.3), which downloads [msmarco.zip](https://public.ukp.informatik.tu-darmstadt.de/thakur/BEIR/datasets/msmarco.zip) (md5 `444067daf65d982533ea17ebd59501e4`). BEIR also publishes this corpus on the Hub as [`BeIR/msmarco`](https://huggingface.co/datasets/BeIR/msmarco), whose card gives this dataset's license; the data here was loaded through ir_datasets, not from that repo. Document, query and qrel ids are the source's own ids,
|
| 19 |
+
unchanged.
|
| 20 |
+
|
| 21 |
+
Every document is one variable-length set of 96-d vectors; every query is one variable-length
|
| 22 |
+
set of 96-d vectors. Documents and queries are stored at different precisions (fp16 and fp32
|
| 23 |
+
respectively), see [Encoding](#encoding).
|
| 24 |
+
|
| 25 |
+
## Files
|
| 26 |
+
|
| 27 |
+
| file | dtype | shape | contents |
|
| 28 |
+
|---|---|---|---|
|
| 29 |
+
| `documents.npy` | float16 (`<f2`) | `[597,909,930, 96]` | every document vector, concatenated document by document (109,480.6 MiB) |
|
| 30 |
+
| `doclens.npy` | int32 | `[8,841,823]` | vectors per document; `cumsum` gives offsets |
|
| 31 |
+
| `token_ids.npy` | uint32 | `[597,909,930]` | tokenizer id of each `documents.npy` row, 1:1 |
|
| 32 |
+
| `doc_ids.npy` | `<U7` | `[8,841,823]` | original document ids |
|
| 33 |
+
| `queries.npy` | float32 (`<f4`) | `[6,980, 32, 96]` | query vectors, zero-padded at the end (81.8 MiB) |
|
| 34 |
+
| `query_lens.npy` | int32 | `[6,980]` | true vectors per query, before padding |
|
| 35 |
+
| `queries_ids.npy` | `<U7` | `[6,980]` | original query ids |
|
| 36 |
+
| `qrels.test.tsv` | text | 7,437 rows | TREC qrels, `qid \t 0 \t docid \t relevance`, no header |
|
| 37 |
+
| `gt_top100.tsv` | text | 698,000 rows | exact MaxSim top-100, see below |
|
| 38 |
+
|
| 39 |
+
All positional indices (`gt_top100.tsv`, and the row order of every `.npy` file) refer to the order
|
| 40 |
+
of `doc_ids.npy` and `queries_ids.npy`. Reordering either file invalidates `gt_top100.tsv`.
|
| 41 |
+
|
| 42 |
+
## Statistics
|
| 43 |
+
|
| 44 |
+
| | |
|
| 45 |
+
|---|---|
|
| 46 |
+
| documents | 8,841,823 |
|
| 47 |
+
| document vectors | 597,909,930 |
|
| 48 |
+
| vectors per document (min / median / mean / max) | 4 / 60 / 67.6 / 300 |
|
| 49 |
+
| queries | 6,980 |
|
| 50 |
+
| vectors per query (min / median / max) | 32 / 32 / 32 |
|
| 51 |
+
| queries with at least one qrel | 6,980 |
|
| 52 |
+
| qrels rows | 7,437 |
|
| 53 |
+
| embedding dimension | 96 |
|
| 54 |
+
|
| 55 |
+
## Encoding
|
| 56 |
+
|
| 57 |
+
| | |
|
| 58 |
+
|---|---|
|
| 59 |
+
| model | [lightonai/answerai-colbert-small-v1](https://huggingface.co/lightonai/answerai-colbert-small-v1) |
|
| 60 |
+
| model revision | `e507cd12947a2b4b52201d150967df3c19a90590` |
|
| 61 |
+
| library | sentence-transformers 6.1.0 `MultiVectorEncoder` (transformers 5.17.0, torch 2.13.0+cu126) |
|
| 62 |
+
| document compute dtype | float16 (model weights loaded at this dtype for the document pass) |
|
| 63 |
+
| document storage dtype | fp16 |
|
| 64 |
+
| query compute dtype | float32 (model weights loaded at this dtype for the query pass) |
|
| 65 |
+
| query storage dtype | fp32 |
|
| 66 |
+
| normalization | L2, by the model's own `Normalize` module, before the storage cast |
|
| 67 |
+
| document truncation | 300 tokens (the checkpoint's `document_length`), before the skiplist; longest document here 300 vectors |
|
| 68 |
+
| query truncation | `query_length` unset; fixed query expansion: every query is padded to 32 tokens with the tokenizer's mask token, which are not attended to, and those expansion vectors are kept |
|
| 69 |
+
| document skiplist | 32 words removed: ['!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'] |
|
| 70 |
+
| document input | `title + "\n\n" + text` when the corpus has a title, else `text`; stripped |
|
| 71 |
+
| query input | query text, stripped of surrounding whitespace, formatted by the model's own query prompt/template |
|
| 72 |
+
| query vectors | every vector the model emits for the query is kept, including any query-expansion tokens its template adds; `query_lens` counts them all |
|
| 73 |
+
| document padding | none: `documents.npy` holds real vectors only, `sum(doclens) == n_tokens` |
|
| 74 |
+
| query padding | rows at or beyond `query_lens[i]` in `queries.npy[i]` are exactly zero |
|
| 75 |
+
| token_ids | tokenizer id of each kept document token (after the skiplist above), aligned 1:1 with `documents.npy` |
|
| 76 |
+
|
| 77 |
+
## Ground truth: `gt_top100.tsv`
|
| 78 |
+
|
| 79 |
+
Exact brute-force MaxSim top-100 per query over the full corpus, from the vectors in this repo.
|
| 80 |
+
No header; tab-separated `qidx docidx rank score`:
|
| 81 |
+
|
| 82 |
+
- `qidx`: 0-based row into `queries_ids.npy` / `queries.npy`
|
| 83 |
+
- `docidx`: 0-based position into `doc_ids.npy` / `doclens.npy`
|
| 84 |
+
- `rank`: 1-based, descending score
|
| 85 |
+
- `score`: `sum over the query's query_lens[qidx] vectors of max over the document's vectors of the
|
| 86 |
+
dot product`, computed in fp32 with the fp16 document vectors upcast to fp32. Expansion vectors
|
| 87 |
+
are included in the sum. Printed to 6 decimals.
|
| 88 |
+
|
| 89 |
+
No query id appears as a document id, so there are no self-matches.
|
| 90 |
+
|
| 91 |
+
## Retrieval quality
|
| 92 |
+
|
| 93 |
+
Sanity check of the vectors, not a leaderboard number: exact MaxSim over the full corpus scored
|
| 94 |
+
against `qrels.test.tsv` with ir_measures.
|
| 95 |
+
|
| 96 |
+
| nDCG@10 | Recall@100 | MRR@10 | MAP |
|
| 97 |
+
|---|---|---|---|
|
| 98 |
+
| 0.4352 | 0.9035 | 0.3692 | 0.3749 |
|
| 99 |
+
|
| 100 |
+
## Loading
|
| 101 |
+
|
| 102 |
+
```python
|
| 103 |
+
import numpy as np
|
| 104 |
+
|
| 105 |
+
documents = np.load("documents.npy", mmap_mode="r") # [n_tokens, 96] float16
|
| 106 |
+
doclens = np.load("doclens.npy") # [n_docs] int32
|
| 107 |
+
offsets = np.concatenate([[0], np.cumsum(doclens)])
|
| 108 |
+
doc_ids = np.load("doc_ids.npy") # [n_docs] str
|
| 109 |
+
|
| 110 |
+
def document(i):
|
| 111 |
+
return documents[offsets[i]:offsets[i + 1]] # [doclens[i], 96]
|
| 112 |
+
|
| 113 |
+
queries = np.load("queries.npy") # [n_queries, 32, 96] float32
|
| 114 |
+
query_lens = np.load("query_lens.npy") # [n_queries] int32
|
| 115 |
+
query_ids = np.load("queries_ids.npy") # [n_queries] str
|
| 116 |
+
|
| 117 |
+
def query(j):
|
| 118 |
+
return queries[j, :query_lens[j]] # [query_lens[j], 96]
|
| 119 |
+
|
| 120 |
+
def maxsim(q, d):
|
| 121 |
+
return (q @ d.astype(np.float32).T).max(axis=1).sum()
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
## Validation
|
| 125 |
+
|
| 126 |
+
Checks run by the exporter on the files exactly as written here:
|
| 127 |
+
|
| 128 |
+
- ✅ file set — missing=[] extra=[]
|
| 129 |
+
- ✅ documents.npy dtype/shape — <f2 (597909930, 96)
|
| 130 |
+
- ✅ doclens.npy dtype/shape — <i4 (8841823,)
|
| 131 |
+
- ✅ doc_ids.npy is a string array — <U7 (8841823,)
|
| 132 |
+
- ✅ queries.npy dtype/shape — <f4 (6980, 32, 96)
|
| 133 |
+
- ✅ query_lens.npy dtype/shape — <i4 (6980,)
|
| 134 |
+
- ✅ queries_ids.npy is a string array — <U7 (6980,)
|
| 135 |
+
- ✅ sum(doclens) == n_tokens — 597909930 vs 597909930
|
| 136 |
+
- ✅ no empty documents — min doclen 4
|
| 137 |
+
- ✅ len(doc_ids) == len(doclens) == corpus size — 8841823, 8841823, 8841823
|
| 138 |
+
- ✅ doc_ids unique
|
| 139 |
+
- ✅ query arrays aligned — 6980, 6980, 6980
|
| 140 |
+
- ✅ doc and query dim agree — 96 / 96
|
| 141 |
+
- ✅ token_ids.npy dtype/shape — <u4 (597909930,)
|
| 142 |
+
- ✅ document vectors unit-norm (100k sample) — norm range [0.9995, 1.0006]
|
| 143 |
+
- ✅ query vectors unit-norm — norm range [1.000000, 1.000000]
|
| 144 |
+
- ✅ all vectors finite
|
| 145 |
+
- ✅ gt_top100.tsv has k rows per query — 698000 rows, k=100
|
| 146 |
+
- ✅ gt rows grouped by qidx with ranks 1..k and descending scores
|
| 147 |
+
- ✅ gt indices in range
|
| 148 |
+
|
| 149 |
+
## Provenance
|
| 150 |
+
|
| 151 |
+
| | |
|
| 152 |
+
|---|---|
|
| 153 |
+
| exported | 2026-09-27 |
|
| 154 |
+
| hardware | Tesla V100S-PCIE-32GB |
|
doc_ids.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0ac9bd7504d8569fb4e04b1dbb73c0a450e5dcb9b15112d9cb753bec0c374e9
|
| 3 |
+
size 247571172
|
doclens.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb00cc3f34c5a065dededb5095edc446472f085205f6e74c18b2f19010f6b895
|
| 3 |
+
size 35367420
|
documents.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ce6ddf05903066145277eabfca4dafc391c559c6d1685e1960e051c2de86696
|
| 3 |
+
size 114798706688
|
gt_top100.tsv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3953fc221cff7b8b39c93a71878f865b3952f917be4dfa71cdb59f363b551526
|
| 3 |
+
size 17892607
|
qrels.test.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
queries.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7194374728d621e80628c48f7cbfade1ba3bc3de593979f00dee6c0f0e8f71d
|
| 3 |
+
size 85770368
|
queries_ids.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4018bf254630358c78ef1786defe075b6c0485d564836827f61521e500a6fd38
|
| 3 |
+
size 195568
|
query_lens.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:009c17396fc151fd815942fca1227bdbd70fe8220a85322b1b2ebe8764cf32e2
|
| 3 |
+
size 28048
|
token_ids.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:333003624c73a14f9324da58139d1af18adddb3f5992b67403d99e493085f664
|
| 3 |
+
size 2391639848
|