card: random baseline floor for MTEB(por)
Browse files
README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- pt
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- mteb
|
| 7 |
+
- baseline
|
| 8 |
+
- random-baseline
|
| 9 |
+
- portuguese
|
| 10 |
+
- brazilian-portuguese
|
| 11 |
+
pipeline_tag: sentence-similarity
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# MTEB(por) β Random Baseline Encoder
|
| 15 |
+
|
| 16 |
+
> β οΈ **This is NOT a trained model.** It is the **chance-level floor** reference for the
|
| 17 |
+
> [MTEB(por, v2)](https://huggingface.co/mteb-pt) Brazilian-Portuguese embedding benchmark.
|
| 18 |
+
|
| 19 |
+
It maps each input text to a deterministic, L2-normalized **random** vector (seeded by a hash of
|
| 20 |
+
the text). It carries **zero semantic signal** β two textually-different but semantically-similar
|
| 21 |
+
sentences get unrelated vectors β so it scores at chance level on every task family (STS,
|
| 22 |
+
retrieval, classification, clustering, reranking, regression).
|
| 23 |
+
|
| 24 |
+
## Why a random baseline?
|
| 25 |
+
|
| 26 |
+
1. **Interpretability** β it anchors every number. Is `0.30` on a retrieval task *good* or
|
| 27 |
+
near-random? Only the floor answers that.
|
| 28 |
+
2. **Task discrimination** β if a real model scores near the floor on a task, that task does not
|
| 29 |
+
discriminate. A concrete empirical sanity check.
|
| 30 |
+
3. **Convention** β mirrors `mteb/baseline-random-encoder` from the upstream MTEB leaderboard.
|
| 31 |
+
|
| 32 |
+
## Design
|
| 33 |
+
|
| 34 |
+
- Each text `t` β `rng = numpy.random.default_rng(sha256("42|" + t))` β `v = rng.standard_normal(768)` β `v / βvβ`.
|
| 35 |
+
- **Deterministic per text** (fully reproducible), **dim 768**, **seed 42**.
|
| 36 |
+
- No weights, no GPU, no training.
|
| 37 |
+
|
| 38 |
+
## Reproduce
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
import hashlib
|
| 42 |
+
import numpy as np
|
| 43 |
+
|
| 44 |
+
DIM, SEED = 768, 42
|
| 45 |
+
|
| 46 |
+
def encode(texts: list[str]) -> np.ndarray:
|
| 47 |
+
"""Deterministic per-text L2-normalized random vectors (chance-level floor)."""
|
| 48 |
+
out = np.empty((len(texts), DIM), dtype=np.float32)
|
| 49 |
+
for i, t in enumerate(texts):
|
| 50 |
+
h = int(hashlib.sha256((str(SEED) + "|" + (t or "")).encode()).hexdigest(), 16) % (2**32)
|
| 51 |
+
v = np.random.default_rng(h).standard_normal(DIM).astype(np.float32)
|
| 52 |
+
out[i] = v / (np.linalg.norm(v) + 1e-9)
|
| 53 |
+
return out
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
The full evaluation script (`run_random_baseline.py`, using the same pinned-revision MTEB(por)
|
| 57 |
+
tasks as the benchmarked models) is included in this repo.
|
| 58 |
+
|
| 59 |
+
## Floor scores β MTEB(por, v2)
|
| 60 |
+
|
| 61 |
+
**Retrieval (nDCG@10)**
|
| 62 |
+
|
| 63 |
+
| Task | Floor |
|
| 64 |
+
|---|---|
|
| 65 |
+
| MedPTRetrieval | 0.0083 |
|
| 66 |
+
| FaQuADIR | 0.0235 |
|
| 67 |
+
| Quati | 0.0 |
|
| 68 |
+
| FaqBacenRetrieval | 0.0027 |
|
| 69 |
+
| JurisTCU | 0.0 |
|
| 70 |
+
| BRTaxQAR | 0.0129 |
|
| 71 |
+
|
| 72 |
+
**Reranking (MAP)**
|
| 73 |
+
|
| 74 |
+
| Task | Floor |
|
| 75 |
+
|---|---|
|
| 76 |
+
| QuatiReranking | 0.1804 |
|
| 77 |
+
| JurisTCUReranking | 0.1434 |
|
| 78 |
+
| PortuLexRRIP | 0.1415 |
|
| 79 |
+
|
| 80 |
+
**STS (Spearman)**
|
| 81 |
+
|
| 82 |
+
| Task | Floor |
|
| 83 |
+
|---|---|
|
| 84 |
+
| AssinSTS | 0.005 |
|
| 85 |
+
| Assin2STS | -0.0288 |
|
| 86 |
+
|
| 87 |
+
**Pair classification (AP)**
|
| 88 |
+
|
| 89 |
+
| Task | Floor |
|
| 90 |
+
|---|---|
|
| 91 |
+
| AssinRTE | 0.2328 |
|
| 92 |
+
| InferBR | 0.3556 |
|
| 93 |
+
|
| 94 |
+
**Classification (acc/AP)**
|
| 95 |
+
|
| 96 |
+
| Task | Floor |
|
| 97 |
+
|---|---|
|
| 98 |
+
| HateBR | 0.5016 |
|
| 99 |
+
| ToxSynPT | 0.495 |
|
| 100 |
+
| FactckBrClassification | 0.322 |
|
| 101 |
+
| OlidBrMultilabelClassification | 0.2035 |
|
| 102 |
+
| BrighterEmotionMultilabelClassification | 0.2027 |
|
| 103 |
+
|
| 104 |
+
**Clustering (V-measure)**
|
| 105 |
+
|
| 106 |
+
| Task | Floor |
|
| 107 |
+
|---|---|
|
| 108 |
+
| MedPTClustering | 0.5289 |
|
| 109 |
+
| WikipediaPTCategoriesClusteringP2P | 0.3248 |
|
| 110 |
+
| JurisTCUClusteringP2P | 0.1225 |
|
| 111 |
+
| SciELOClusteringP2P | 0.0859 |
|
| 112 |
+
| StackoverflowPtClustering | 0.3353 |
|
| 113 |
+
| CamaraProposicoesClustering | 0.4912 |
|
| 114 |
+
|
| 115 |
+
**Regression (Spearman)**
|
| 116 |
+
|
| 117 |
+
| Task | Floor |
|
| 118 |
+
|---|---|
|
| 119 |
+
| BrighterEmotionIntensityRegression | 0.0223 |
|
| 120 |
+
| EnemEssayRegression | -0.0783 |
|
| 121 |
+
| NarrativeEssaysBRRegression | -0.0526 |
|
| 122 |
+
|
| 123 |
+
*Floor is non-zero for clustering (the V-measure of a random partition is not 0) and for
|
| 124 |
+
classification (chance β 1/num-classes); real models score well above it on every task.*
|
| 125 |
+
|
| 126 |
+
## Citation
|
| 127 |
+
|
| 128 |
+
Part of the **MTEB(por)** benchmark by the `mteb-pt` project. The floor is computed with the
|
| 129 |
+
identical pinned-SHA tasks used for every benchmarked model.
|