Merino-XL / README.md
tomkay's picture
Retire from recommended lineup (superseded by Merino-Large/Large-v2)
074fced verified
|
Raw
History Blame Contribute Delete
3.32 kB
---
license: other
license_name: baa-proprietary
library_name: sentence-transformers
tags:
- retrieval
- embeddings
- reranker
- cross-encoder
- rag
- sentence-similarity
pipeline_tag: sentence-similarity
---
# baa.ai · Merino-XL
**One model that does both halves of RAG retrieval — bi-encoder embedding *and* cross-encoder reranking — over a single shared word-embedding table.** A 1024-dimensional multilingual model, ~880M parameters, by BAA AI (Black Sheep AI).
## Get the optimal model for *your* data
Merino-XL is a strong, cost-efficient **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**.
## What it is
A two-role retrieval model over a **shared input word-embedding matrix** (stored once). The bi-encoder embedder and a v2 cross-encoder reranker are built on the same `xlm-roberta-large` backbone, so their word-embedding table is stored a single time and injected into the reranker at load — a smaller download at **no measured quality loss**, with no retraining.
- **Embed role:** bi-encoder, 1024-d, L2-normalized.
- **Rerank role:** cross-encoder, single relevance logit per (query, document) pair.
- **Router:** call `.embed(...)` or `.rerank(...)`.
## Usage
```python
from modeling_baa import BaaEmbeddingReranker # included in this repo
m = BaaEmbeddingReranker("baa-ai/Merino-XL")
qv = m.embed(["how does a cross-encoder reranker work?"], is_query=True)[0]
dv = m.embed(["a cross-encoder scores a (query, document) pair jointly",
"bi-encoders embed query and document separately for fast retrieval"])
ranked = m.rerank("how does a cross-encoder reranker work?",
["a cross-encoder scores a (query, document) pair jointly",
"the mitochondria is the powerhouse of the cell"])
# -> [(doc, score), ...] sorted best-first
```
## Specs
| | |
|---|---|
| Embedding dim | 1024 |
| Parameters | ~880M (embedder + reranker, shared word-embedding table) |
| Languages | multilingual |
| Max sequence length | 512 |
| Hardware | CPU / edge / GPU |
## License & attribution
- **BAA Contributions** (shared-embedding architecture, router/loader code, packaging, weights, docs) are **proprietary to BAA AI (Black Sheep AI)** — see `LICENSE`.
- Incorporates the `xlm-roberta-large` backbone under the **MIT License** — see `LICENSE-xlm-roberta-large.txt`.
© 2026 BAA AI (Black Sheep AI) — baa.ai. Provided "as is" without warranty.
## ⚠️ Retired from the recommended lineup (2026-07)
This model is superseded by [Merino-Large](https://huggingface.co/baa-ai/Merino-Large) and
[Merino-Large-v2](https://huggingface.co/baa-ai/Merino-Large-v2), which match or exceed it on our
evaluations, pass 4-bit distractor-stress certification cleanly, and cost less to serve. This model's
4-bit variant failed that certification (a small but statistically separated robustness regression,
invisible to standard hit@k) and will not be published. fp16 weights remain available for reproducibility.