Downloads · 30 days
82
18% of all-time downloads
capemox/ettin-encoder-68m-contrastive-2.5m
ettin-encoder-68m-contrastive-2.5m is a sentence similarity model from capemox. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
Weakly-supervised contrastive pre-training of jhu-clsp/ettin-encoder-68m on ~2.5 million (query, passage) pairs drawn from three open-domain datasets.
Downloads · 30 days
82
18% of all-time downloads
All-time downloads
460
Public
Parameters
68.1M
273 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors273 MB · 99%
From the Hugging Face model README
Weakly-supervised contrastive pre-training of jhu-clsp/ettin-encoder-68m on ~2.5 million (query, passage) pairs drawn from three open-domain datasets.
This is Stage 1 of a two-stage training pipeline. The model produces 512-dimensional sentence embeddings via mean pooling and is a strong starting point for task-specific retrieval fine-tuning.
| Property | Value |
|---|---|
| Base model | jhu-clsp/ettin-encoder-68m (ModernBERT encoder) |
| Architecture | ModernBERT — 68M parameters |
| Embedding dimension | 512 |
| Pooling | Mean pooling over last-layer token embeddings |
| Max sequence length | 256 tokens |
| Weight dtype | float32 |
| Training precision | bf16 (autocast) |
Training pairs come from three sources, interleaved with fixed probabilities (seed 42):
| Dataset | Pairs | Probability | Pair type |
|---|---|---|---|
| GooAQ | ~3.0M | 58% | question → long-form answer |
Wikipedia Sections (pair config) | ~2.0M | 38% | section title → section body |
| Natural Questions | ~100K | 4% | question → Wikipedia passage |
Interleaving stops when NQ exhausts, giving 2,504,448 total training pairs (~9,783 gradient steps at batch size 256).
CachedMultipleNegativesRankingLoss with in-batch negatives. Mini-batch size of 32 is used for embedding (cached), while the contrastive loss is computed over the full effective batch of 256 — enabling large-batch training on 8 GB VRAM.
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | 2e-5 |
| LR schedule | Linear with 5% warmup |
| Effective batch size | 256 |
| Mini-batch size (embedding) | 32 |
| Epochs | 1 |
| Max sequence length | 256 |
Single NVIDIA RTX 4060 Laptop (8 GB VRAM).
Evaluated on NanoBEIR (13 subsets, NDCG@10) after Stage 1 training:
| Metric | Score |
|---|---|
| NanoBEIR NDCG@10 | 0.3572 |
For comparison, the base model (jhu-clsp/ettin-encoder-68m) without any contrastive training achieves NanoBEIR NDCG@10 of ~0.10.
After an additional Stage 2 hard-negative fine-tuning on MS MARCO, the combined pipeline reaches NanoBEIR NDCG@10 of 0.5145 — see capemox/ettin-encoder-68m-msmarco-combined (coming soon).
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("capemox/ettin-encoder-68m-contrastive-2.5m")
queries = ["What is the capital of France?"]
passages = ["Paris is the capital and most populous city of France."]
q_emb = model.encode(queries, normalize_embeddings=True)
p_emb = model.encode(passages, normalize_embeddings=True)
scores = q_emb @ p_emb.T
print(scores)
If you use this model, please cite the original Ettin paper:
@misc{weller2025seqvsseq,
title = {Seq vs Seq: An Open Suite of Paired Encoders and Decoders},
author = {Orion Weller and Kathryn Ricci and Marc Marone and Antoine Chaffin and Dawn Lawrie and Benjamin Van Durme},
year = {2025},
eprint = {2507.11412},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2507.11412}
}