AbstractPhil commited on
Commit
fbd7a0d
·
verified ·
1 Parent(s): 6f01f98

card: the b-collective shipped with NO README. Adds the native 8-task table (.6031 -> .7294, BIOSSES inverts favourably vs v2), the trunk-bound decomposition (port -.0424, keys recover 29%, retrain recovers all), alignment health, and the final_model.pt-vs-best_model.pt root distinction between the two repos

Browse files
Files changed (1) hide show
  1. amoe/b-collective/README.md +137 -0
amoe/b-collective/README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags: [amoe, adapter, mixture-of-experts, sentence-similarity, captionbert, aleph]
4
+ base_model: AbstractPhil/captionbert-8192-v2-B
5
+ library_name: amoe-lora
6
+ ---
7
+
8
+ # captionbert-8192-v2-B :: AMOE 3-anchor collective (native)
9
+
10
+ Three [amoe-lora](https://github.com/AbstractEyes/amoe-lora) aleph anchors trained
11
+ on the **frozen** `captionbert-8192-v2-B` trunk, under a trained dispatch. The
12
+ trunk never moves; only the adapters and the routing keys train.
13
+
14
+ This folder exists because of a negative result: **the sibling trunk's anchors do
15
+ not port here.** Both the ported set and the natively retrained set ship, so the
16
+ comparison is reproducible.
17
+
18
+ | file | what it is |
19
+ |---|---|
20
+ | `captionbert-b-arms-native.dispatch.pt` | **the ship** -- anchors retrained on -B |
21
+ | `captionbert-b-arms-realigned.dispatch.pt` | v2's anchors, routing keys re-aligned on -B |
22
+ | `equiv/simplify/paraphrase.anchor.pt` | the natively trained anchors |
23
+
24
+ ## Results -- 8 tasks, Spearman rho
25
+
26
+ Single-anchor columns are **masked** reads (collective with the other two arms
27
+ disabled). Masking never renormalizes the amplitude budget, so a masked single is
28
+ not the same measurement as that anchor run alone.
29
+
30
+ | task | OFF | `equiv` m | `simplify` m | `paraphrase` m | **COLLECTIVE** | v2's collective |
31
+ |---|---|---|---|---|---|---|
32
+ | STS-B | .5752 | .7219 | .5995 | .6137 | **.7675** | .7684 |
33
+ | SICK-R | .6548 | .7200 | .6603 | .6612 | **.7374** | .7391 |
34
+ | STS12 | .5012 | .6381 | .5266 | .5177 | **.6706** | .6682 |
35
+ | STS13 | .6037 | .6890 | .6325 | .6361 | **.7381** | .7557 |
36
+ | STS14 | .5470 | .6410 | .5760 | .5808 | **.6945** | .6921 |
37
+ | STS15 | .7146 | .7793 | .7402 | .7325 | **.8109** | .8055 |
38
+ | STS16 | .6782 | .7143 | .6896 | .7325 | **.7695** | .7626 |
39
+ | BIOSSES | .5500 | .5702 | .5789 | .5612 | **.6472** | .6382 |
40
+ | **mean** | **.6031** | .6842 | .6254 | .6295 | **.7294** | .7287 |
41
+ | mean erank | 30.47 | 35.33 | 34.74 | 33.78 | **44.33** | 45.00 |
42
+
43
+ With native anchors this trunk reaches **.7294**, against v2's .7287 -- a tie,
44
+ and on **BIOSSES it inverts favourably** (.6472 vs .6382). "-B is worse out of
45
+ domain" was an artifact of foreign anchors, not a property of the trunk.
46
+
47
+ Note the bare trunk reads **.6031** here versus v2's .6077, despite -B training
48
+ on 19% more corpus (66/66 chunks, ~33M rows, against v2's 56). **More data bought
49
+ nothing.** The ceiling is teacher agreement, not corpus size: the consensus
50
+ target uses only ~28.7 of 768 directions.
51
+
52
+ ## Why this folder exists: anchors are trunk-bound
53
+
54
+ The two trunks are indistinguishable on every capability gauge available -- 8 STS
55
+ tasks within +/-.0042 excluding the 100-row BIOSSES, erank 36.6 vs 36.1, self_cos
56
+ +.1396 vs +.1411. They are *not* indistinguishable to a 1.6M-parameter adapter:
57
+
58
+ | configuration | 8-task mean |
59
+ |---|---|
60
+ | v2's arms on the v2 trunk | .7287 |
61
+ | v2's arms on -B, unchanged | .6863 |
62
+ | + routing keys re-aligned on -B (800 steps, anchors frozen) | .6987 |
63
+ | **anchors retrained natively on -B** | **.7294** |
64
+
65
+ Porting costs **.0424**. Re-aligning the keys recovers **.0124 -- 29%**.
66
+ Retraining the anchors recovers all of it.
67
+
68
+ **So 71% of transfer loss lives in the anchors, 29% in the routing keys.**
69
+ Adapters read the *residual stream*; task gauges read the *pooled output*. The
70
+ stream carries trunk identity the output does not, which makes an adapter a more
71
+ sensitive instrument for trunk identity than the entire STS suite.
72
+
73
+ Preregistered bars for the realignment stage were PASS >= .7100 and
74
+ PARTIAL >= .6980; it landed .6987 -- **PARTIAL**.
75
+
76
+ **Reusing anchors across trunks is a silent ~31% loss. No error, no warning.**
77
+ That is why `modeling_captionbert.py` resolves the arms repo from the model's own
78
+ identity rather than a hardcoded constant.
79
+
80
+ ## Alignment health (native stage)
81
+
82
+ Mean `|w/z|` .4987 / .1944 / .1810 -- sum **.874**, matching the conserved
83
+ amplitude-budget prediction. Usage .39 / .30 / .31, zero starvation strikes.
84
+ Anchor drift plateaued (equiv .147 rad, paraphrase .110, simplify .081).
85
+
86
+ ## Load
87
+
88
+ The model resolves its own arms -- this is the supported path, and on this repo
89
+ it selects the native dispatch:
90
+
91
+ ```python
92
+ from transformers import AutoModel
93
+ model = AutoModel.from_pretrained("AbstractPhil/captionbert-8192-v2-B",
94
+ trust_remote_code=True)
95
+ model.attach_amoe() # -> amoe/b-collective/...native.dispatch.pt
96
+ emb = model.encode(["a cat on a windowsill"])
97
+ with model.amoe_off(): # the unsupervised baseline
98
+ base = model.encode(["a cat on a windowsill"])
99
+ model.detach_amoe() # bit-exact restore, asserted
100
+ ```
101
+
102
+ Explicitly, via amoe-lora:
103
+
104
+ ```python
105
+ import amoe
106
+ h = amoe.attach(trunk, ["amoe/b-collective/equiv.anchor.pt",
107
+ "amoe/b-collective/simplify.anchor.pt",
108
+ "amoe/b-collective/paraphrase.anchor.pt"],
109
+ dispatch="amoe/b-collective/captionbert-b-arms-native.dispatch.pt",
110
+ binding=CaptionBertV2Binding(d=512)) # from modeling_captionbert.py
111
+ base = h.detach() # bit-exact or raises
112
+ ```
113
+
114
+ The trunk these anchors expect is **`checkpoints/final_model.pt`**, which is what
115
+ this repo's root `model.safetensors` carries (verified tensor-for-tensor, max
116
+ absolute delta 0.0). Note the sibling v2 repo ships `best_model.pt` at its root
117
+ instead -- each repo's arms match its own root, but the two roots are selected by
118
+ different criteria, so do not mix a trunk from one with arms from the other.
119
+
120
+ All anchors disabled reproduces the bare trunk **bit-exact** (asserted at build
121
+ time). Masking never renormalizes -- that is the damping law, not an oversight.
122
+
123
+ Anchor `.pt` key layout is `{block}.{param}`. (`blocks.{site}.{param}` in the
124
+ amoe README is the *safetensors* layout, a different serializer.)
125
+
126
+ ## Training
127
+
128
+ Anchors: MNRL, in-batch + hard negatives where the source provides them, 1,500
129
+ steps at batch 256, pure Adam wd=0 (`amoe.laws.make_optimizer`), fp32 / TF32 off
130
+ (`amoe.laws.pin_precision`). Trunk frozen throughout. Dispatch: 800 steps,
131
+ routing keys only, anchors frozen, starvation safeguard armed. tau 0.1.
132
+
133
+ Budget for a fresh trunk: **~18 minutes** (3 anchors x 1,500 steps, plus the
134
+ 800-step keys-only alignment).
135
+
136
+ SICK-R and BIOSSES are never trained on and are the honest transfer reads.
137
+ Every number above is in `metrics.json`.