AbstractPhil commited on
Commit
e21cf19
Β·
verified Β·
1 Parent(s): 62d7e62

technical companion (week-in-review docket, verified)

Browse files
Files changed (1) hide show
  1. deep-arm/TECHNICAL.md +261 -0
deep-arm/TECHNICAL.md ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deep Arm β€” Depth Extension for captionbert-8192-v2-B
2
+
3
+ **A technical companion to the week-in-review article. Ships as `deep-arm/TECHNICAL.md` inside the
4
+ `AbstractPhil/captionbert-8192-v2-B` repository.**
5
+
6
+ This document describes **deep-1**: a ~5M-parameter depth-extension module ("deep arm") that
7
+ extends the encoder's usable conditioning depth from 256 tokens to 2048+ while leaving the base
8
+ encoder untouched. It covers the measurement that motivated it, the construction, the
9
+ preregistered gate and its result, a zero-parameter finding about positional initialization, the
10
+ measured cost of the engaged mode, and the variant catalogue this work opens.
11
+
12
+ ---
13
+
14
+ ## 1. Overview
15
+
16
+ captionbert-8192-v2-B is a 512-dimensional caption encoder whose position table carries 8192 rows,
17
+ of which only rows 0–255 were ever trained (the training corpus averaged 48 tokens per caption).
18
+ The deep arm is a **switchable long-prompt mode** layered over that frozen base:
19
+
20
+ - **Disengaged**, the model is bit-identical to stock β€” the added adapters are gated wrappers
21
+ initialized nearly closed, and position rows 0–255 are frozen throughout, so short-input
22
+ behavior is preserved by construction (and verified at benchmark, section 6).
23
+ - **Engaged**, the model carries attribute binding β€” the semantic property long prompts actually
24
+ need β€” at every measured depth from 10 to 2288 tokens, where the stock encoder's binding
25
+ collapses to chance near depth 480.
26
+
27
+ The arm adds ~5M trainable parameters (~4.06M re-initialized deep position rows + ~0.92M gated
28
+ relay adapters) against a frozen trunk, trained in 8k steps overnight on a single consumer GPU by
29
+ distilling token-state behavior from Longformer-base-4096 across a learned cross-dimensional
30
+ bridge. Its preregistered depth gate passed, and a labeled harder secondary passed as well.
31
+
32
+ ---
33
+
34
+ ## 2. Motivation β€” the gauge must match the consumer
35
+
36
+ ### 2.1 Similarity plateaus; binding dies
37
+
38
+ Downstream consumers of this encoder (diffusion cross-attention among them) do not read a pooled
39
+ sentence vector β€” they read **per-token states**. So depth claims have to be made on a gauge those
40
+ consumers care about.
41
+
42
+ Under a wide-spectrum depth instrument (15 depths out to 8000 tokens, 138 measurement rows, 10
43
+ models), the encoder's state-similarity curve looks healthy at depth: a degraded-but-stable
44
+ plateau around **.77** with no cliff. Token recoverability also holds up, at **.61–.66 through
45
+ depth 1024** β€” the strongest of the models tested. But the semantic gauge tells a different
46
+ story: **attribute binding collapses to roughly chance (~1.0) near token depth 480 and never
47
+ returns.** For reference on the same instrument, t5-base holds binding 1.9–3.0 through 2048
48
+ (relative position encodings are the real long-context contribution there), and bert-base reads
49
+ 3.6 within its native 512.
50
+
51
+ *The binding gauge, briefly:* a contrast score read from the token states at the two noun
52
+ positions of a relational caption ("a red cube on a blue sphere") against its attribute-swapped
53
+ counterpart. A score near 1.0 means the states cannot distinguish the correct assignment from the
54
+ swapped one β€” chance. Higher is stronger binding. `bind1`/`bind2` denote the first and second
55
+ noun of the relation.
56
+
57
+ The law this minted: **depth claims require spectrum sampling plus the semantic gauge; similarity
58
+ curves lie.** A "stable plateau to 1500" read from sparse sampling on the wrong gauge had stood
59
+ for exactly one day before re-instrumentation overturned it.
60
+
61
+ ### 2.2 The failure decomposes into two mechanical parts
62
+
63
+ An offset-curve instrument placed the binding payload at window offsets 2–240 inside the trained
64
+ positional range, embedded in realistic caption context. Binding is alive (**1.4–2.6**) at every
65
+ offset from 2 through 192 and dies only at offset 240 β€” the truncation edge, where a
66
+ bidirectional encoder's second noun loses its right context. The depth cliff therefore resolves
67
+ into exactly two defects:
68
+
69
+ 1. **Untrained position rows past 256** β€” an initialization problem.
70
+ 2. **Right-context starvation in the last ~16 pre-edge tokens** β€” a windowing problem.
71
+
72
+ Context interference is refuted. Both defects are mechanical, and each fix below targets one or
73
+ both; each fix's success is itself a confirmation of the decomposition.
74
+
75
+ A zero-training wrapper (V0, section 7) already validates the story: encoding in 256-token windows
76
+ with a ~16-token edge margin (stride ~224–240, clause-aligned splits) recovers shallow-grade
77
+ binding at any prompt depth, with cross-window anaphora as the only loss. The deep arm is the
78
+ **native** fix β€” no wrapper, single forward pass, trunk untouched.
79
+
80
+ ---
81
+
82
+ ## 3. Design
83
+
84
+ Seven load-bearing elements:
85
+
86
+ 1. **Frozen trunk.** captionbert-8192-v2-B loaded through the certified loader. Disengaged mode
87
+ is bit-identical stock by construction: adapters are sigma-gated wrappers born nearly closed,
88
+ and position rows 0–255 are never updated.
89
+ 2. **Mod-256 tiled deep position rows (~4.06M trainable).** Rows 256+ are re-initialized by
90
+ tiling the trained 0–255 table (plus small noise), and made trainable under a masked-gradient
91
+ hook so only the deep rows learn.
92
+ 3. **Gated relay adapters (MslRelay, ~0.92M trainable).** Small certified adapter modules wrapped
93
+ around each frozen block, sigma-gated.
94
+ 4. **Longformer targets.** Teacher token states from Longformer-base-4096 on long documents,
95
+ span-resampled onto the encoder's token grid, then mapped 768β†’512.
96
+ 5. **Cross-dimensional Procrustes bridge.** A whitened-Procrustes map into the encoder's real
97
+ 512-d token frame, fit at **cos .5013 / retrieval R@1 .849**, with a paired shuffled-null
98
+ control at floor. This exceeds the earlier 768-d proxy-frame fit (.35). Stage 0 aborts by
99
+ construction if the fit lands below cos .20.
100
+ 6. **Loss.** Per-token (1 βˆ’ cosine) to the mapped teacher targets on valid positions, with 2Γ—
101
+ weight past position 256. Optimizer: Adam, weight decay 0.
102
+ 7. **The gate is the instrument.** The binding-at-depth battery runs inside the eval loop, so the
103
+ preregistered criterion is measured continuously rather than once at the end.
104
+
105
+ Total: **~5M trainable parameters over a frozen trunk**; 8k training steps; overnight on a single
106
+ consumer GPU.
107
+
108
+ ### Gates cleared before any training compute
109
+
110
+ - **Teacher check.** Longformer-base-4096's deep binding measures **2.1–3.5 at depths 480–3800**
111
+ β€” the strongest measured in this battery β€” and it strengthens with depth. A teacher without
112
+ the target property would make the distillation pointless; this one has it.
113
+ - **Bridge check.** The 512-d Procrustes fit above (.5013 / .849) cleared its .20 abort threshold
114
+ with margin.
115
+
116
+ ---
117
+
118
+ ## 4. Preregistered gate and result
119
+
120
+ **Preregistered bar (set before training):** deep binding at depths {1024, 2048} must reach at
121
+ least **0.8Γ— the shallow value**.
122
+
123
+ **Final battery (bind1 / bind2):**
124
+
125
+ | Depth | bind1 | bind2 |
126
+ |---|---|---|
127
+ | 10 | 2.69 | 2.27 |
128
+ | 480 | 1.63 | 3.50 |
129
+ | 1024 | 2.66 | 3.96 |
130
+ | 1248 | 3.18 | 3.80 |
131
+ | 2048 | 4.83 | 13.14 |
132
+ | 2288 | 1.63 | 1.58 |
133
+
134
+ **All cells above 1.5, no inversions. The preregistered gate passed.**
135
+
136
+ Two discipline notes belong next to that result:
137
+
138
+ - **The "too lucky" rule.** The preregistered gate passed *at initialization*, before any
139
+ training, because of the tiling effect described in section 5. Rather than declaring a quiet
140
+ victory, harder off-phase depths (1248 and 2288 β€” depths not aligned to the 256-token tile)
141
+ were added to the battery as a **labeled post-hoc secondary**. They passed as well, which is
142
+ what makes the headline pass credible.
143
+ - **Open flag, owed before any strength claim.** The aligned bind2 value of **13.1 at depth
144
+ 2048** requires an absolute-distance decomposition before it can be read as strength β€” it may
145
+ be inflated by aligned-tile geometry. Until that decomposition is published, read it as "well
146
+ above threshold," not as a magnitude claim.
147
+
148
+ **Consequence.** The encoder's "≀256 tokens" conditioning constraint is repealed:
149
+ captionbert-B + deep arm binds natively through 2048+ tokens, trunk untouched, at a cost of ~5M
150
+ trainable parameters.
151
+
152
+ ---
153
+
154
+ ## 5. The zero-parameter finding, and what training actually bought
155
+
156
+ ### 5.1 Tiling alone restores aligned-depth binding
157
+
158
+ Re-initializing rows 256+ by tiling the trained 0–255 table β€” **zero parameters trained** β€”
159
+ restores binding of **2.7–3.3 at tile-aligned depths** (1024, 2048: depth mod 256 β‰ˆ 0), versus
160
+ ~1.0 (chance) under random row initialization. The failure does not disappear; it becomes
161
+ **periodic**: tile-edge offsets stay at chance (depth 480, which lands at offset ~224 within its
162
+ tile, reads 1.16 at init) β€” the section 2.2 edge pathology repeating every 256 positions.
163
+
164
+ This re-scopes the training problem. The arm's job is not to learn depth from scratch; it is
165
+ **boundary-smoothing and cross-window integration** β€” repairing the edges the tiling leaves
166
+ behind. The tiling law is free to any model with a partially trained positional table.
167
+
168
+ ### 5.2 Contribution ledger
169
+
170
+ The result is reported per component, because the contributions are layered and non-competing β€”
171
+ a single scoreboard number would erase the mechanism:
172
+
173
+ - **Tiled init (0 params):** aligned-depth binding 1.0 β†’ 2.7–3.3, at initialization.
174
+ - **Deep position rows (~4.06M params):** edge repair arriving as a **near-to-far wave** β€” depth
175
+ 480's bind2 climbs .81 β†’ 3.50 by step 4.5k; depth 1248 passes through a transient inversion on
176
+ its way from .72 β†’ 3.80; depth 2288 crosses 1.5 only in the final 500 of 8k steps.
177
+ - **Relay adapters (~0.92M params):** retroactive-binding amplification wherever gradient
178
+ reached β€” bind1 moved first at every depth. The adapter gates finished **.35 β†’ .51, opening
179
+ monotonically with depth** β€” the third independent architecture in this research line to show
180
+ the depth-gradient regularity (its third substrate).
181
+ - **Longformer supervision through the .5013-cos bridge:** shallow behavior **improved** under
182
+ it β€” depth-10 binding 1.59/2.01 β†’ 2.69/2.27. Depth was bought without taxing the trained
183
+ regime.
184
+
185
+ ---
186
+
187
+ ## 6. Honest costs
188
+
189
+ The engaged mode is not free, and both numbers ship together.
190
+
191
+ - **Engaged-mode short-input cost:** on the certified 8-task benchmark, engaged mode scores
192
+ **.5655 versus stock .6031 β€” a βˆ’.0376 mean difference** β€” with token self-cosine up +.288: the
193
+ Longformer-mapped frame's anisotropy pulls shallow states toward a cone.
194
+ - **Disengaged mode: bit-identical stock.** Because the adapters are sigma-gated wrappers and
195
+ rows 0–255 are frozen, disengaging the arm reproduces stock behavior exactly β€” guaranteed by
196
+ construction and verified at benchmark.
197
+
198
+ The arm is therefore carded as a **length-conditional mode**: engage it for long prompts, leave
199
+ it off for short ones. The capability trade is a mode switch, not a regression. Closing the
200
+ βˆ’.0376 gap natively is the named refinement path (V2, below).
201
+
202
+ ---
203
+
204
+ ## 7. Variant catalogue β€” V0 through V6
205
+
206
+ | # | Name | Status | What it is / why it exists |
207
+ |---|---|---|---|
208
+ | V0 | Chunk wrapper | Validated, zero training | 256-token windows with a ~16-token edge margin (stride ~224–240), clause-aligned; shallow-grade binding at any depth; window placement is part of the contract (an edge-placed payload falsely reads "no help") |
209
+ | V1 | deep-1 as shipped | Trained, gate PASS | Tiled deep rows + relay adapters under Longformer supervision; the baseline variant, described in this document |
210
+ | V2 | Joint-objective revision | Named, unbuilt | Distillation plus a shallow-capability anchor, to close the .5655 engaged-mode gap; the refinement path recorded on the model card |
211
+ | V3 | Token-fidelity masked-span arm | Named, unbuilt | A span-reconstruction objective on the existing trunks β€” the targeted fix for the encoder's binding gap and the conditioning line's shelf upgrade |
212
+ | V4 | Interpolation-init deep rows | Named, unbuilt | Interpolation initialization as an ablation against tiling (which is free and strong) |
213
+ | V5 | Anchored-trunk deep arm | Named, unbuilt β€” queue head | The V1 recipe applied to the AlephLM-0 anchored trunks β€” the variant that extends that family's inference depth. Two free reads: whether signed dispatch shapes depth repair differently than a dense trunk, and whether the a3 trunk's early-grid diversity advantage survives depth extension. Requires normalized-gauge grid reads and context layer-norm in any consumer |
214
+ | V6 | RoPE-native next trunk | Design-level | A related hybrid with a RoPE trunk measures ~.98 positional integrity, flat to depth 8000 β€” evidence that rotary positions remove the position-row problem at the root for the *next* pretrain, rather than retrofitting this one |
215
+
216
+ **Queue by leverage:** V5 β†’ V2 β†’ V3 β†’ V6. All of V2/V3/V5 are single-consumer-GPU overnight runs
217
+ at the deep arm's ~5M-parameter scale.
218
+
219
+ ---
220
+
221
+ ## 8. Laws established or confirmed on this line
222
+
223
+ 1. **The spectrum-sampling law.** Depth claims require spectrum sampling plus the semantic gauge
224
+ (binding); state-similarity curves lie. A plausible "stable plateau to 1500" survived exactly
225
+ one day before the right instrument overturned it.
226
+ 2. **The two-part depth decomposition.** The long-context failure is exactly (a) untrained
227
+ position rows and (b) pre-edge right-context starvation; context interference is refuted.
228
+ Fixes become mechanical, and their success confirms the theory.
229
+ 3. **The tiling law.** Tiling a trained positional table into untrained rows restores
230
+ aligned-depth semantics at zero cost and makes the residual failure periodic β€” re-scoping
231
+ depth training as boundary-smoothing. Free to any model with a partially trained positional
232
+ table.
233
+ 4. **Window placement is part of the wrapper's contract.** An edge-placed payload falsely reads
234
+ "no help"; the naive test's false negative would have discarded the cheapest fix in the
235
+ catalogue.
236
+ 5. **The "too lucky" rule.** A preregistered gate that passes at initialization triggers labeled
237
+ harder secondaries rather than a quiet victory. deep-1's pass is credible because off-phase
238
+ depths were added β€” and passed.
239
+ 6. **Honest dual-mode accounting.** A module that buys depth at a measured shallow cost ships
240
+ with both numbers (βˆ’.0376 here) and a construction-guaranteed disengaged mode.
241
+ 7. **The depth-gradient law, third substrate.** Adapter gates opening monotonically with depth
242
+ (.35 β†’ .51) reappeared here β€” the third independent architecture in this line to show it.
243
+ 8. **Contribution ledgers, not leaderboards.** The result is reported as per-component
244
+ contributions (init / rows / relays / supervision) because the components are layered and
245
+ non-competing; a single scoreboard number would have erased the mechanism.
246
+
247
+ Two further measurement laws established in the same coverage window β€” amplitude-vs-direction in
248
+ grid-rank reads, and the invariance of binding under per-token normalization β€” belong to the
249
+ adjacent conditioning-viability line and are covered in the accompanying week-in-review article.
250
+
251
+ ---
252
+
253
+ ## 9. Provenance
254
+
255
+ Research and writing: **AbstractPhil**. Coverage window: **2026-08-04 through 2026-08-06**.
256
+ Shipped artifacts, in this repository under `deep-arm/`: the trained arm weights
257
+ (`deep1_arm_s0.pt`), the full training and battery record (`deep1_results.json`), and the
258
+ engaged-mode benchmark (`deep_arm_bench.json`), alongside the model-card section covering
259
+ construction, the before/after battery, the bridge fit, the honest cost, toggle semantics, and
260
+ usage. Every number in this document is inherited from the registered measurement record for
261
+ that window.