unparallelled commited on
Commit
9f21763
·
verified ·
1 Parent(s): 47805c1

Upload docs/ClaudeReport_session_2026-09-16_yarn_scale_ceiling.md with huggingface_hub

Browse files
docs/ClaudeReport_session_2026-09-16_yarn_scale_ceiling.md ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 2026-09-16 - YaRN configuration is a large free lever; training still matters at the length you train for
2
+
3
+ Workspace: Context_Parallelism (2x H100, fresh box)
4
+ Files: p1_eval32k.sh, e_short.sh, e64k.sh, e128k.sh, ctl_106b.sh, dl_eval32k.sh,
5
+ run_longeval.sh, mk_p1_plots.py
6
+
7
+ > **READ THE CONTROL SECTION FIRST.** Sections up to "State" were written before
8
+ > the 1.06B control had run, and two of their conclusions do not survive it:
9
+ > "training adds nothing" and "the ceiling is purely configuration". Both are
10
+ > corrected under "THE 1.06B CONTROL". The sections are kept as written rather
11
+ > than silently edited, because the sequence of wrong turns is part of the record.
12
+
13
+ ## The question this started from
14
+
15
+ Phase 1 (680M, 4k -> 16k, 1,200 steps) produced a null: base680 untrained scored
16
+ 84 @8192 / 40 @16360, p1final scored 77 / 42, both inside the +-9-13pp Wilson band
17
+ at N=100. Four explanations were offered for why training did nothing. Three were
18
+ checked and found wrong (see ERRORS). The fourth turned out to be the wrong
19
+ question.
20
+
21
+ ## The finding
22
+
23
+ Retrieval accuracy is governed by the YaRN CONFIGURATION, not by extension
24
+ training. Sweeping YARN_SCALE with ORIG_MAXPOS held at the 4096 pretrain length,
25
+ on the UNTRAINED base680, niah_single N=100, haystack byte-identical
26
+ (199,754,694 B) to every prior evaluation in this project:
27
+
28
+ prompt x4 x8 x16 x32
29
+ 1,024 99 99 - -
30
+ 4,096 89 91 92 91
31
+ 8,192 84 88 - -
32
+ 16,360 40 67 92 -
33
+ 32,744 - 34 54 79
34
+ 65,512 - - 32 46
35
+
36
+ Same weights throughout. 16,360 goes 40 -> 92 on a configuration change worth
37
+ +52pp. No short-context cost anywhere: 4,096 is 89 -> 92 across the same sweep.
38
+
39
+ At its best config the UNTRAINED 680M beats the 1.06B's entire three-stage
40
+ extension ladder:
41
+
42
+ prompt 680M best (no training) 1.06B best (3 trained stages) delta
43
+ 16,360 92 (x16) 70 (mix64k @1200) +22
44
+ 32,744 79 (x32) 50-52 +27
45
+ 65,512 46 (x32) 31 (mix64k @1200) +15
46
+
47
+ ## The model: two independent factors
48
+
49
+ Arrange every measurement as a grid, rows = token count, columns = VIRTUAL
50
+ POSITION (real position / scale = where content lands inside the 4,096 range the
51
+ model was actually pretrained on):
52
+
53
+ tokens v128 v256 v512 v1024 v2048 v4096
54
+ 1024 99 99 . . . .
55
+ 4096 91 92 91 89 . .
56
+ 8192 . . . 88 84 .
57
+ 16360 . . . 92 67 40
58
+ 32744 . . . 79 54 34
59
+ 65512 . . . . . 32
60
+
61
+ Reading ACROSS a row isolates positional conditioning (same content, same
62
+ distractors, only the scale changed). Reading DOWN a column isolates distractor
63
+ load (same virtual position, more competing keys in the softmax). Both are real:
64
+
65
+ across, 16,360 tok: v4096 -> 40, v2048 -> 67, v1024 -> 92
66
+ down, v1024: 4k -> 89, 8k -> 88, 16k -> 92, 32k -> 79
67
+
68
+ Practical rule: the best scale is the one landing content near virtual
69
+ 1,000-2,000, i.e. SCALE ~= prompt_len / 1500.
70
+
71
+ ## Why a 4k-pretrained model retrieves at 65k
72
+
73
+ It does not, positionally. At x32 a 65,512-token prompt lands at virtual 2,047,
74
+ so the model never sees a rotary angle outside its pretraining distribution.
75
+ What is new is attending over 65,536 keys instead of 4,096 -- and attention is
76
+ content-addressed, so a distinctive needle remains findable regardless of the
77
+ token count, PROVIDED the positional encoding does not corrupt the match. That is
78
+ why score tracks virtual position and largely ignores context length.
79
+
80
+ (YaRN does not interpolate everything: dims below low=14 keep extrapolating, but
81
+ those are the highest-frequency dims which already wrap many times inside 4k, so
82
+ wrapping is their normal regime. Dims above high=32 interpolate and stay in range.)
83
+
84
+ ## Why training did not raise it
85
+
86
+ 1. At SCALE=4 a 16k prompt sits at virtual 4,090 -- the badly-conditioned edge.
87
+ That is a property of the RoPE cache, not of the weights. Phase 1 trained
88
+ inside the broken regime; gradient descent cannot repair a config choice.
89
+ 2. The objective gives almost no retrieval signal. 2026-09-02 measured flux p90
90
+ document length at 2,721 tokens: "there was never a gradient signal for
91
+ attending past a document boundary."
92
+ 3. The update was small regardless -- 629M tokens, 0.9 tok/param, against a
93
+ 7.13B-token pretrain.
94
+
95
+ ## Reconciling with 2026-09-09 ("more steps DID increase retrieval")
96
+
97
+ Not a contradiction. b3_long_run.sh confirms the 1.06B's 16k ladder trained at
98
+ YARN_SCALE=4 YARN_ORIG_MAXPOS=4096 -- the identical config phase 1 used. On that
99
+ one axis at 16,360:
100
+
101
+ 1.06B untrained 0 steps 14-27
102
+ 1.06B l1 400 steps 30
103
+ 1.06B l2/l3 400 steps 35
104
+ 1.06B l3long 1000 steps 36
105
+ 1.06B l3long2k 2000 steps 43
106
+ 680M base680 0 steps 40
107
+ 680M p1final 1200 steps 42
108
+
109
+ There is a ceiling at ~40-43 for scale-4 at 16k. The 1.06B started far below and
110
+ climbed 2,000 steps to reach it; the 680M started AT it. Training moves a model
111
+ toward its config's ceiling and never past it. Widening the config moves the
112
+ ceiling itself (to ~92 at x16).
113
+
114
+ Two models of 36 and 24 layers plateau at the same ~40-43, which matches the
115
+ 2026-09-09 peer finding that Qwen3 0.6B through 8B all score 100% with "zero
116
+ variation" over a 13x parameter range: size is not the variable.
117
+
118
+ ## Mechanism: inferred, not measured
119
+
120
+ The bend in the positional axis sits at virtual ~2,000-3,000. 2026-09-02
121
+ independently measured reach saturating at 2,700-3,500 tokens, equal to flux p90
122
+ document length 2,721. Two analyses months apart landing on the same number is
123
+ suggestive that the ceiling is set by PRETRAINING POSITION OCCUPANCY -- positions
124
+ rarely filled during pretraining are poorly conditioned.
125
+
126
+ This is a correlation, not a measurement. Position occupancy in the corpus was
127
+ never counted directly, and the 2,721 figure is the 1.06B's corpus: varybatch's
128
+ pretraining data is unknown to me and assumed to have a similar shape.
129
+
130
+ ## Pre-registered predictions for x32, and what the miss taught
131
+
132
+ Written into e128k.sh before the run:
133
+
134
+ 4,096 -> 92-99 actual 91 near miss
135
+ 32,744 -> 85-92 actual 79 MISS, too high
136
+ 65,512 -> 45-55 actual 46 hit
137
+
138
+ The two predictions derived from virtual position ALONE were wrong; the one that
139
+ also reasoned about distractor load was right. The failure mode is what
140
+ established the second factor -- the "token count washes out at low virtual
141
+ position" claim held over 4k-16k tokens and broke at 32k.
142
+
143
+ ## Errors made this session
144
+
145
+ - Named LEARNING RATE as the likely cause of the phase-1 null. CP_MAX_LR and
146
+ CP_MIN_LR appear ZERO times in bluscriptCP.cpp; max_lr is hardcoded 6e-4 at
147
+ line 151, so every run on both models trained at 6e-4 x REWARMUP_PEAK 0.3 =
148
+ 1.8e-4. ext64k_b5.sh:23 already documented this as a no-op. THE SAME ERROR IS
149
+ IN MY OWN 2026-09-09 LOG LINE.
150
+ - Claimed phase 1 saw too few long tokens: it saw 314,572,800 b3 tokens against
151
+ mix64k's 188,743,680, i.e. 1.67x MORE.
152
+ - Worried b3 documents were truncated by the 16k window. Backwards: b3 >= window
153
+ means every window is contiguous single-document text, the good case.
154
+ - Compared phase 1 against ext64k (three trained stages) instead of the
155
+ stage analogue, then built a correction table across eval dirs using DIFFERENT
156
+ haystacks -- checkpoint run2_step_400 scores 78 under lenb (b3val) and 62 under
157
+ decide (b2val). Only mix64k and mixcont share phase 1's haystack for certain.
158
+ - Presented a both-models comparison showing only the base column, so it looked
159
+ like p1final had never been evaluated at the wider caches. It always was.
160
+ - Ran make with no target in Tensor-Implementations and in Profiler (which has no
161
+ Makefile), then printed BUILD_EXIT=0 from a trailing ls rather than from make.
162
+ - set -u: `local A=$1 B="${A}"` on one line is unbound, bash creates all locals
163
+ before assigning.
164
+
165
+ ## State
166
+
167
+ Reproduction check pending in ctl_106b.sh: mix64k_step1200 at 16,360 under its
168
+ as-trained ORIG=32768 SCALE=2 must return ~70. If it does not, the harness
169
+ differs from the prior session and every cross-session number here is void.
170
+
171
+ ## THE 1.06B CONTROL (ctl_106b.sh) -- reverses two conclusions above
172
+
173
+ Reproduction check FIRST: mix64k_step1200 at 16,360 under its as-trained
174
+ ORIG=32768 SCALE=2 returned 70.0, exactly the prior session's 70. The harness is
175
+ sound and every cross-session number in this report is comparable.
176
+
177
+ 1.06B under its own config vs the corrected parameterisation (ORIG held at 4096):
178
+
179
+ prompt model own cfg corrected gain
180
+ 16,360 mix1200 70 78 +8
181
+ 16,360 cliff1400 54 66 +12
182
+ 32,744 mix1200 50 73 +23
183
+ 32,744 cliff1400 31 70 +39
184
+ 65,512 mix1200 31 65 +34
185
+ 65,512 cliff1400 18 65 +47
186
+
187
+ ### Reversal 1: long-context training DOES buy capability, at the trained length
188
+
189
+ prompt 680M base (no long-ctx training) 1.06B mix1200 (trained to 64k)
190
+ 16,360 92 78
191
+ 32,744 79 73
192
+ 65,512 46 65 <-- 1.06B +19
193
+
194
+ The 680M wins at 16k and 32k. At 65,512 the 1.06B wins by 19pp -- exactly the
195
+ length it was trained at. I predicted 40-50 there from the 680M's curve and the
196
+ actual was 65. That miss is the clearest evidence in this whole session that
197
+ training installs long-context ability a base model does not have.
198
+
199
+ The earlier "training adds nothing" claim was an artefact of three compounding
200
+ mistakes: only ever training at the WRONG scale, on a model already sitting at
201
+ that config's ceiling, and evaluating below the length where training pays.
202
+
203
+ ### Reversal 2: the collapse was substantially a configuration artefact
204
+
205
+ collapse gap (healthy minus collapsed)
206
+ prompt own cfg corrected
207
+ 16,360 +16pp +12pp
208
+ 32,744 +19pp +3pp
209
+ 65,512 +13pp +0pp
210
+
211
+ cliff1400 recovers 18 -> 65 at 65,512 and becomes IDENTICAL to the healthy
212
+ checkpoint. Days were spent diagnosing that collapse -- the copying analysis, the
213
+ per-position NLL dumps, the mix redesign -- and most of the lost retrieval returns
214
+ with a better RoPE parameterisation. Residual damage remains at 16k (12pp), so it
215
+ was not purely artefact, but the headline collapse was largely the model failing
216
+ under a badly-conditioned config rather than destroyed retrieval.
217
+
218
+ ### Control predictions: 1 hit, 2 misses, both misses the same direction
219
+
220
+ 16,360 @x16 predicted 85-92 actual 78 MISS
221
+ 32,744 @x32 predicted 70-80 actual 73 HIT
222
+ 65,512 @x32 predicted 40-50 actual 65 MISS
223
+
224
+ Both misses under-weighted what training does. Having spent the session
225
+ correcting an over-claim ABOUT training, I over-corrected into dismissing it.
226
+
227
+ ## What the literature says (searched 2026-09-16)
228
+
229
+ - YaRN (arxiv 2309.00071): Dynamic-YaRN gives >2x extension WITHOUT fine-tuning;
230
+ fine-tuned YaRN reaches SOTA on ~400 steps and <0.1% of pretraining data.
231
+ - Llama 3 (arxiv 2407.21783): does NOT use position interpolation. Raises RoPE
232
+ base frequency to 500,000 and TRAINS DIRECTLY at each target length, six stages
233
+ 8K -> 128K on ~800B tokens. Train config == eval config at every stage; there is
234
+ no train/eval mismatch. NIAH is a GATE to advance, passed only alongside full
235
+ short-context recovery.
236
+ - Qwen2.5 (arxiv 2412.15115): 4,096 -> 32,768; Turbo uses four stages to 262,144
237
+ with 40% of sequences at the current max length and 60% shorter.
238
+ - RULER (arxiv 2404.06654): vanilla NIAH is "indicative of only a superficial
239
+ form of long-context understanding"; models near-perfect on NIAH still drop
240
+ sharply on multi-hop and aggregation.
241
+
242
+ So the mismatch exploited in this session is NOT a frontier technique. It was an
243
+ inconsistency in my own experiment -- phase 1 trained at x4, evaluated at x8/16/32
244
+ -- that I then discovered and reported as a finding. For base680 there is no
245
+ mismatch (it never trained under any YaRN cache, so scale selection is legitimate
246
+ config choice); for p1final there is, and its x16/x32 numbers are diagnostic only.
247
+
248
+ Our models already use rope_theta 500,000, the value Llama 3 adopted.
249
+
250
+ ## Revised conclusions
251
+
252
+ 1. YaRN scale is a large free lever, worth up to +47pp, and every run in this
253
+ project left it on the table.
254
+ 2. Training is NOT useless. It installs capability at the length trained, worth
255
+ +19pp at 64k over a better-pretrained base that never saw long context.
256
+ 3. The 680M's pretrain advantage is real at <=32k and gone at 64k.
257
+ 4. The original collapse was over-attributed to training damage.
258
+ 5. Everything here is niah_single, which RULER and our own 2026-09-09 peer sweep
259
+ both show is the WEAK benchmark: Qwen3 0.6B-8B all score 100% with zero
260
+ variation across 13x params, while val_backward separates them and ours is at
261
+ chance. The correct next measurement is val_backward / multi-hop, not more NIAH.
262
+
263
+ ## Open
264
+
265
+ - Never tested: TRAINING AT THE GOOD SCALE. Phase 1 trained at x4 only, so
266
+ "training adds nothing" was never established at x16/x32. This is the missing
267
+ cell and the obvious next run.
268
+ - val_backward and multi-hop under the corrected config, for all checkpoints.
269
+ - Whether the 680M trained at 64k would beat the 1.06B's 65 there.
270
+ - Position occupancy in varybatch's pretraining corpus, to test the
271
+ document-length mechanism directly rather than by correlation.
272
+ - Qwen3-0.6B scores 100% to 32,736. The gap to peers is unclosed.