tomkay commited on
Commit
190f3ed
·
verified ·
1 Parent(s): a79daf5

Rebrand card to Merino-Pro-4bit

Browse files
Files changed (1) hide show
  1. MODEL_CARD.md +37 -32
MODEL_CARD.md CHANGED
@@ -1,42 +1,47 @@
1
- # baa-ai-Embedding-Reranker-v1
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- Unified **embedder + reranker** in one package, sharing a single XLM-RoBERTa-large word-embedding table.
4
- By BAA AI (Black Sheep AI).
 
 
 
 
 
5
 
6
  ## What it is
7
- A two-role retrieval model over a **shared input word-embedding matrix** (250002x1024 ~ 256M params, stored
8
- once). Validated finding: the word-embedding table is fully shareable between a bi-encoder embedder and a
9
- cross-encoder reranker (both built on `xlm-roberta-large`) at **zero quality loss**, while the transformer
10
- *layers* are NOT mergeable. So we keep each role's native layers + head and dedupe only the embedding table.
11
-
12
- - **Embed role:** bi-encoder. 1024-d, CLS-pool, L2-normalized. Use `"query: "` prefix on queries.
13
- - **Rerank role:** cross-encoder. Single relevance logit per (query, doc) pair.
14
- - **Router:** trivial — call `.embed(...)` or `.rerank(...)`.
15
-
16
- ## Footprint
17
- ~**0.77x** the two separate models (the 256M word-embedding table is stored once and tied at load), with
18
- **no quality loss** and **no retraining**. Disk: the reranker's word-embedding copy is stripped and injected
19
- from the embedder at load.
20
-
21
- ## Eval (450-query ML-PDF holdout)
22
- | Role | hit@3 | note |
23
- |---|---|---|
24
- | Embed (dense retrieval) | 0.9511 | == standalone bi-encoder baseline |
25
- | Rerank (full pipeline) | 0.9511 | == standalone cross-encoder baseline |
26
- Both identical to the two-model baseline; sharing the word-embedding table is a no-op on quality.
27
 
28
  ## Usage
 
29
  ```python
30
- from modeling_baa import BaaEmbeddingReranker
31
- m = BaaEmbeddingReranker() # loads embedder + reranker (shared word-emb)
32
- qv = m.embed(["my query"], is_query=True) # 1024-d normalized
33
- dv = m.embed(["doc a", "doc b"]) # doc embeddings
34
- ranked = m.rerank("my query", ["doc a","doc b"], top_k=10) # [(doc, score), ...]
 
35
  ```
36
 
37
- ## License
38
- - **BAA Contributions** (shared-embedding architecture, router/loader code, packaging, weights, docs) are
39
- **proprietary to BAA AI (Black Sheep AI)** — see `LICENSE`.
40
  - Incorporates the `xlm-roberta-large` backbone under the **MIT License** — see `LICENSE-xlm-roberta-large.txt`.
41
 
42
- Build: shared-embedding MoE (Experiment A, 2026-06-22).
 
1
+ ---
2
+ license: other
3
+ license_name: baa-proprietary
4
+ library_name: sentence-transformers
5
+ tags:
6
+ - retrieval
7
+ - embeddings
8
+ - reranker
9
+ - cross-encoder
10
+ - rag
11
+ - sentence-similarity
12
+ pipeline_tag: sentence-similarity
13
+ ---
14
 
15
+ # baa.ai · Merino-Pro-4bit
16
+
17
+ **The premium unified retrieval model — bi-encoder embedding *and* cross-encoder reranking in one package, over a single shared word-embedding table.** A 1024-dimensional multilingual model, by BAA AI (Black Sheep AI). ~872M params, 4-bit quantized (~0.5 GB).
18
+
19
+ ## Get the optimal model for *your* data
20
+
21
+ Merino-Pro-4bit is baa.ai's flagship default. But the best embedder + reranker is **corpus-specific** — the ideal choice depends on your documents and your notion of relevance. **baa.ai offers exclusive tooling that identifies the optimal embedding and reranking models for your specific data**, so you ship the smallest models that maximize document recovery on your corpus. For a tailored recommendation, **reach out to baa.ai**.
22
 
23
  ## What it is
24
+
25
+ A two-role retrieval model over a **shared input word-embedding matrix** (~256M params, stored once). The bi-encoder embedder and cross-encoder reranker are both built on the `xlm-roberta-large` backbone and **co-trained** to share a single word-embedding table at **no quality loss**, while each role keeps its native layers and head. 4-bit weight quantization is lossless on this stack (the embedder is the limiter; rerank tolerates lower bits).
26
+
27
+ - **Embed role:** bi-encoder, 1024-d, L2-normalized. Prepend `"query: "` to queries.
28
+ - **Rerank role:** cross-encoder, single relevance logit per (query, document) pair.
29
+ - **Router:** call `.embed(...)` or `.rerank(...)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  ## Usage
32
+
33
  ```python
34
+ from modeling_baa import BaaEmbeddingReranker # included in this repo
35
+
36
+ m = BaaEmbeddingReranker("baa-ai/Merino-Pro-4bit")
37
+ qv = m.embed(["my query"], is_query=True)[0] # 1024-d normalized
38
+ dv = m.embed(["doc a", "doc b"])
39
+ ranked = m.rerank("my query", ["doc a", "doc b"], top_k=10) # [(doc, score), ...]
40
  ```
41
 
42
+ ## License & attribution
43
+
44
+ - **BAA Contributions** (shared-embedding architecture, router/loader code, packaging, weights, docs) are **proprietary to BAA AI (Black Sheep AI)** — see `LICENSE`.
45
  - Incorporates the `xlm-roberta-large` backbone under the **MIT License** — see `LICENSE-xlm-roberta-large.txt`.
46
 
47
+ © 2026 BAA AI (Black Sheep AI) — baa.ai. Provided "as is" without warranty.