Pitfall: The Fixed-Offset Positional Shortcut
Why Fixed Periods Mislead
What happens if we train a one-block model (num_blks=1, bias=True) on sequences with a fixed pattern period L = 32?
first copy 4.38 nats, second copy 0.14 nats, second-copy accuracy 1.00
patterns of length 24: second-copy accuracy 0.02
mass at offset 31, per head: 1.00 0.96 1.00 1.00
mass at offset 23, per head: 0.00 0.00 0.00 0.00
Mechanistic Pitfall: On L = 32, the 1-block model reaches 1.00 accuracy (about 0.1\text{ nats}) by using constant bias queries and keys under RoPE to attend purely to fixed offset j - i = -31. Tested on period L = 24 (target at offset -23), its heads still place more than 0.9 of their mass at offset -31 and accuracy collapses to 0.02, which is chance.
Variable Periods Force Content-Based Induction
1-Block vs. 2-Block Experiment
Sampling the period uniformly from L \in \{16, \ldots, 32\} on every sequence destroys any fixed-offset shortcut. We train three 2-block runs and a 1-block control (bias=False) for 5{,}000 Adam steps:
blocks first copy later copies accuracy below 1 nat at step
2 4.44 0.30 0.94 2150
2 4.31 0.16 0.96 1550
2 4.31 0.19 0.95 2650
1 4.26 3.55 0.11 never
- Two Blocks Solve Retrieval: All three 2-block seeds drop below 1\text{ nat} between steps 1{,}000 and 3{,}000, reaching roughly 0.2–0.4\text{ nats} and more than 90\% later-copy accuracy.
- One Block Fails: The 1-block control stalls above 3.5\text{ nats} (about 10\% accuracy)—all it can do is boost the unigram set of tokens that appeared anywhere in the prefix.
Quantifying Previous-Token and Induction Head Scores
Aggregated Attention Metrics
head_scores averages each head’s attention weight on the previous token (j = i - 1) and on the variable induction target (j = i + 1 - L for i \ge L) over 256 sequences with L \in \{16, \ldots, 32\}:
run 1, block 1, previous : 0.34 0.46 0.00 0.50
run 1, block 1, induction: 0.00 0.01 0.00 0.00
run 1, block 2, previous : 0.09 0.12 0.07 0.14
run 1, block 2, induction: 0.40 0.38 0.41 0.58
run 2, block 1, previous : 0.02 0.03 0.99 0.00
run 2, block 1, induction: 0.00 0.01 0.00 0.00
run 2, block 2, previous : 0.07 0.06 0.08 0.06
run 2, block 2, induction: 0.45 0.58 0.23 0.61
run 3, block 1, previous : 0.19 0.01 0.39 0.46
run 3, block 1, induction: 0.00 0.00 0.00 0.00
run 3, block 2, previous : 0.08 0.07 0.06 0.07
run 3, block 2, induction: 0.20 0.20 0.47 0.24
- Clean Separation of Labor: In every run, Block 1 has 1–3 previous-token heads (scores from about 0.3 to 0.99) and at most 0.02 induction score, whereas Block 2 heads concentrate up to \approx 0.6 of their mass directly on the moving target i + 1 - L (vs. \approx 0.025 uniform chance).
Ablation Results: Necessity, Redundancy, and Surprises
Interpreting Interventions
run 1: block 1 previous-token heads [0, 1, 3], others [2]
run 2: block 1 previous-token heads [2], others [0, 1, 3]
run 3: block 1 previous-token heads [2, 3], others [0, 1]
heads removed later-copy loss / accuracy: run 1, 2, 3
none 0.31 / 0.94 0.15 / 0.96 0.17 / 0.96
block 1, previous-token heads 4.64 / 0.07 3.71 / 0.09 3.80 / 0.17
block 1, all other heads 5.66 / 0.02 3.96 / 0.10 3.85 / 0.13
block 2, top 1 induction 0.63 / 0.92 0.56 / 0.91 1.65 / 0.70
block 2, top 2 induction 1.66 / 0.68 4.49 / 0.28 3.14 / 0.45
block 2, top 3 induction 3.38 / 0.24 5.68 / 0.06 3.88 / 0.23
block 2, top 4 induction 4.25 / 0.02 4.19 / 0.01 4.18 / 0.02
one-block model 3.56 / 0.11
- 1. Block-1 Previous-Token Heads Are Necessary: Removing them drops accuracy from above 0.9 to below 0.2.
- 2. Surprise—Block 1’s “Inert” Heads Are Also Necessary: Removing them drops accuracy below 0.15: Block 2’s OV copy circuit relies on their stream transformation (zero-ablation also shifts stream norms off-distribution).
- 3. Block-2 Redundancy: Removing the single strongest induction head leaves accuracy at 0.7–0.9; all four Block-2 heads share the induction workload and must be removed together to drop to chance.
In-Context Learning: Generalizing to Unseen Patterns
One-Shot Pattern Completion
- With 64^{24} \approx 2.2 \times 10^{43} possible patterns of length 24, the model has never seen any test pattern during training, and all token transitions are equally likely a priori.
- First Copy (t < 24): Accuracy sits at the chance baseline 1/64 \approx 0.016.
- Second Copy (t \ge 25): Jumps immediately above 0.90 from a single in-context exposure. (At the exact restart t = 24, content matching has not yet seen a repeated token.)
Dissecting the Remaining Error: Repeated Tokens
Beyond Single-Token Matching
Why does accuracy after the restart plateau a few points short of 100\%? When a token occurs K > 1 times inside the L-token pattern with different successors, matching on the current token alone is ambiguous:
\mathbb{E}\!\left[\frac{1}{K}\right] = \frac{1 - (1 - p)^L}{L p} \approx 0.84 \quad\textrm{overall}\quad (\approx 0.47 \textrm{ on repeated tokens } K > 1), \qquad p = \frac{1}{64},\; L = 24
current token unique repeated all
share of targets 0.69 0.31 1.00
single-token match 1.00 0.47 0.84
run 1 accuracy 0.99 0.80 0.93
run 2 accuracy 1.00 0.87 0.96
run 3 accuracy 1.00 0.85 0.95
On unique pattern tokens (K = 1, 70\% of positions), model_two achieves 0.97–1.00 accuracy; on repeated tokens (K > 1, 30\% of positions), it reaches roughly 0.7–0.9, beating the 0.47 uniform single-token match by combining multi-token prefix context and RoPE distance preferences.