Feature Extraction
Transformers
TensorBoard
Safetensors
English
captionbert_v2
sentence-similarity
consensus-distillation
geometric-deep-learning
amoe
custom_code
Instructions to use AbstractPhil/captionbert-8192-v2-b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AbstractPhil/captionbert-8192-v2-b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="AbstractPhil/captionbert-8192-v2-b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AbstractPhil/captionbert-8192-v2-b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,26 +33,62 @@ model.attach_amoe() # this repo's NATIVE arms -- see the warning below
|
|
| 33 |
emb = model.encode(["a cat on a windowsill"])
|
| 34 |
```
|
| 35 |
|
| 36 |
-
##
|
| 37 |
-
|
| 38 |
-
Measured in one harness; every model mean-pooled and L2-normalized, no task
|
| 39 |
-
tuning. `erank` is the participation ratio of the embedding spectrum -- how many
|
| 40 |
-
of the 768 directions are actually used.
|
| 41 |
|
| 42 |
| model | params | STS-B | SICK-R | STS12 | STS13 | STS14 | STS15 | STS16 | BIOSSES | mean |
|
| 43 |
|---|---|---|---|---|---|---|---|---|---|---|
|
| 44 |
-
| bert-base | 109.5M | .4729 | .5865 |
|
| 45 |
-
|
|
| 46 |
-
|
|
| 47 |
-
|
|
| 48 |
-
|
|
| 49 |
-
|
| 50 |
-
**
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
## More data bought nothing (and that is the finding)
|
| 58 |
|
|
@@ -64,7 +100,7 @@ comparison class, listed for scale.
|
|
| 64 |
| 7 tasks excluding BIOSSES | -- | -- | **+.0009** |
|
| 65 |
| erank (STS-B) | 36.6 | 36.1 | -0.5 |
|
| 66 |
| self_cos (STS-B) | +.1396 | +.1411 | +.0015 |
|
| 67 |
-
| 8-task mean, native arms | .7287 | **.
|
| 68 |
|
| 69 |
The entire -.0046 comes from BIOSSES, which is 100 rows -- a 0.4-sigma move.
|
| 70 |
Everything else is a dead heat.
|
|
@@ -88,7 +124,7 @@ baseline and the adapted model.
|
|
| 88 |
| `equiv` only | .7219 | .7200 | .6842 |
|
| 89 |
| `simplify` only | .5995 | .6603 | .6254 |
|
| 90 |
| `paraphrase` only | .6137 | .6612 | .6295 |
|
| 91 |
-
| **all three** | **.7675** | **.7374** | **.
|
| 92 |
|
| 93 |
An `-only` row is that arm **as damped by the dispatch** -- masking never
|
| 94 |
renormalizes, so it reads lower than the same anchor trained alone.
|
|
@@ -100,7 +136,7 @@ renormalizes, so it reads lower than the same anchor trained alone.
|
|
| 100 |
| v2 arms on v2 | .7287 |
|
| 101 |
| v2 arms on **-b** | .6863 |
|
| 102 |
| + re-aligned routing keys | .6987 |
|
| 103 |
-
| **-b native anchors** | **.
|
| 104 |
|
| 105 |
Transferring the arms costs **31% of their gain**. Re-training only the 1,536
|
| 106 |
routing keys recovers 29% of that; retraining the anchors recovers all of it.
|
|
|
|
| 33 |
emb = model.encode(["a cat on a windowsill"])
|
| 34 |
```
|
| 35 |
|
| 36 |
+
## Benchmark
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
| model | params | STS-B | SICK-R | STS12 | STS13 | STS14 | STS15 | STS16 | BIOSSES | mean |
|
| 39 |
|---|---|---|---|---|---|---|---|---|---|---|
|
| 40 |
+
| bert-base | 109.5M | 0.4729 | 0.5865 | 0.3087 | 0.5988 | 0.4773 | 0.6029 | 0.6373 | 0.5469 | 0.5289 |
|
| 41 |
+
| ModernBERT-base | 149.0M | 0.4215 | 0.5479 | 0.3527 | 0.4247 | 0.3795 | 0.5349 | 0.4174 | 0.5630 | 0.4552 |
|
| 42 |
+
| roberta-base | 124.6M | 0.5436 | 0.6296 | 0.3211 | 0.5631 | 0.4522 | 0.6134 | 0.6198 | 0.5777 | 0.5401 |
|
| 43 |
+
| albert-base-v2 | 11.7M | 0.4784 | 0.5364 | 0.3101 | 0.4831 | 0.3809 | 0.5542 | 0.5491 | 0.4863 | 0.4723 |
|
| 44 |
+
| distilbert | 66.4M | 0.5717 | 0.6424 | 0.4344 | 0.6490 | 0.5410 | 0.6663 | 0.6854 | 0.5162 | 0.5883 |
|
| 45 |
+
| **captionbert-8192-b** | 58.3M | **0.5752** | **0.6548** | **0.5012** | **0.6037** | **0.5470** | **0.7146** | **0.6782** | **0.5500** | **0.6031** |
|
| 46 |
+
| **captionbert-8192-b + arms** | 63.2M | **0.7675** | **0.7374** | **0.6706** | **0.7381** | **0.6945** | **0.8109** | **0.7695** | **0.6472** | **0.7295** |
|
| 47 |
+
| captionbert-8192-v2 | 58.3M | 0.5747 | 0.6526 | 0.5051 | 0.5995 | 0.5452 | 0.7136 | 0.6776 | 0.5933 | 0.6077 |
|
| 48 |
+
| all-MiniLM-L6-v2 | 22.7M | 0.8203 | 0.7758 | 0.7237 | 0.8058 | 0.7559 | 0.8539 | 0.7899 | 0.8144 | 0.7925 |
|
| 49 |
+
|
| 50 |
+
All ten models measured in **one harness**, same eight tasks, **mean-pooled and
|
| 51 |
+
L2-normalized**, no task tuning. Spearman correlation; `mean` is the unweighted
|
| 52 |
+
average over the eight.
|
| 53 |
+
|
| 54 |
+
`all-MiniLM-L6-v2` was contrastively trained on 1B+ curated sentence pairs. It is
|
| 55 |
+
listed for scale, not as a peer -- nothing here saw a similarity label.
|
| 56 |
+
|
| 57 |
+
**The trunk beats every teacher it was distilled from**, and the best of them
|
| 58 |
+
(distilbert, .5883) by +.0194 -- at **13% of their combined 461M parameters**,
|
| 59 |
+
having never seen a similarity label. The margin comes mostly from STS12, where
|
| 60 |
+
every teacher collapses to .31-.43 and the trunk holds .50.
|
| 61 |
+
|
| 62 |
+
**With arms it clears the best teacher by +.14** and closes to within **.063** of
|
| 63 |
+
a model trained on a billion curated pairs.
|
| 64 |
+
|
| 65 |
+
Mean-pooled BERT-family encoders are known-weak sentence encoders -- that is the
|
| 66 |
+
reason Sentence-BERT exists -- so beating them is an efficiency result rather
|
| 67 |
+
than a state-of-the-art one. The MiniLM row is in the table to keep that honest.
|
| 68 |
+
|
| 69 |
+
### Geometry
|
| 70 |
+
|
| 71 |
+
| model | self_cos | erank |
|
| 72 |
+
|---|---|---|
|
| 73 |
+
| bert-base | +0.6071 | 32.8 |
|
| 74 |
+
| ModernBERT-base | +0.9001 | 26.1 |
|
| 75 |
+
| roberta-base | +0.9594 | 19.8 |
|
| 76 |
+
| albert-base-v2 | +0.7473 | 20.9 |
|
| 77 |
+
| distilbert | +0.6920 | 31.1 |
|
| 78 |
+
| **captionbert-8192-b** | +0.1411 | 36.1 |
|
| 79 |
+
| **captionbert-8192-b + arms** | +0.0984 | 55.5 |
|
| 80 |
+
| captionbert-8192-v2 | +0.1396 | 36.6 |
|
| 81 |
+
| all-MiniLM-L6-v2 | +0.0251 | 86.7 |
|
| 82 |
+
|
| 83 |
+
`self_cos` is the isotropy gauge: the mean cosine between unrelated sentences.
|
| 84 |
+
Mean-pooled BERT-family embeddings sit in a narrow cone (+.61 to +.96), where
|
| 85 |
+
cosine cannot discriminate. `erank` is the participation ratio -- how many of the
|
| 86 |
+
768 directions carry variance.
|
| 87 |
+
|
| 88 |
+
Both track capability almost perfectly across all ten models, and **isotropy is
|
| 89 |
+
the mechanism**: no isotropy objective appears anywhere in the training stack.
|
| 90 |
+
The arms then lift erank 36.6 -> 57.6, the first evidence in this line that
|
| 91 |
+
adaptation *adds* usable directions rather than only rotating them.
|
| 92 |
|
| 93 |
## More data bought nothing (and that is the finding)
|
| 94 |
|
|
|
|
| 100 |
| 7 tasks excluding BIOSSES | -- | -- | **+.0009** |
|
| 101 |
| erank (STS-B) | 36.6 | 36.1 | -0.5 |
|
| 102 |
| self_cos (STS-B) | +.1396 | +.1411 | +.0015 |
|
| 103 |
+
| 8-task mean, native arms | .7287 | **.7295** | **+.0008** |
|
| 104 |
|
| 105 |
The entire -.0046 comes from BIOSSES, which is 100 rows -- a 0.4-sigma move.
|
| 106 |
Everything else is a dead heat.
|
|
|
|
| 124 |
| `equiv` only | .7219 | .7200 | .6842 |
|
| 125 |
| `simplify` only | .5995 | .6603 | .6254 |
|
| 126 |
| `paraphrase` only | .6137 | .6612 | .6295 |
|
| 127 |
+
| **all three** | **.7675** | **.7374** | **.7295** |
|
| 128 |
|
| 129 |
An `-only` row is that arm **as damped by the dispatch** -- masking never
|
| 130 |
renormalizes, so it reads lower than the same anchor trained alone.
|
|
|
|
| 136 |
| v2 arms on v2 | .7287 |
|
| 137 |
| v2 arms on **-b** | .6863 |
|
| 138 |
| + re-aligned routing keys | .6987 |
|
| 139 |
+
| **-b native anchors** | **.7295** |
|
| 140 |
|
| 141 |
Transferring the arms costs **31% of their gain**. Re-training only the 1,536
|
| 142 |
routing keys recovers 29% of that; retraining the anchors recovers all of it.
|