SourceMemorization Capacity of Multi-Head Attention in Transformers
The paper tests whether context vectors remain linearly independent (assumption 2) at the embedding layer (l0) and after one attention layer (l1) in pre-trained BERT and GPT-2 on Wikipedia text. In BERT, sinusoidal positional encodings preserve full rank at both depths. In GPT-2, the learned positional encodings in the pre-trained model have lower rank, causing assumption 2 to fail at l1 while it holds at l0. General position fails in all four model/depth combinations. The Kruskal rank of query vectors in trained BERT is 291 (below the context size 512), and in random BERT is 349.